Home / GIS and Open Map Data for Beginners

How to Merge Layers in QGIS: One Layer, Same Geometry, Shared CRS

Aerial view of a river valley with forest and mountains

Photo: Okan Demircan / Pexels

Data arrives in pieces. A national dataset ships as one file per province, a field team returns one layer per surveyor, a portal offers downloads one year at a time, and your analysis needs exactly one layer containing all of it. Merging is the answer, and in QGIS it is a single named tool: Merge Vector Layers, under Vector, Data Management Tools. It sounds like a utility and behaves like one, quick, literal, and unforgiving of mismatched inputs. This guide teaches the merge itself, the two conditions your layers must meet before the tool will treat them fairly, and the quiet attribute-table consequences, unioned fields, null padding, renamed collisions, that decide whether the merged layer is an asset or a trap. If your layers need to be combined by matching attributes rather than stacked, that is a join, a different tool with its own article in this series; merging is stacking, rows upon rows, into one geometry collection of the same kind.

Interactive tool

Harmonize First: The Merge Layers Checklist

Check off each step as you finish it. Your progress stays on this page.

0 of 8 complete

0% done

Before You Merge: The Two Conditions

Merge Vector Layers stacks layers vertically: every feature from every input becomes a feature of the output. For that to mean anything, the inputs must be stackable, and the tool enforces two conditions you should verify yourself rather than discover in an error. Same geometry type. Points merge with points, lines with lines, polygons with polygons; a point layer and a polygon layer have no meaningful stack, and the tool will refuse or produce nonsense from mixed types. Check each layer's type in its properties before you begin, including the quiet trap of multi versus single geometries, a MultiPolygon province file and a single-polygon district file are cousins, not twins. Shared coordinate reference system. All inputs must already be in the same CRS, because the merge tool does not reproject: it trusts the numbers as they are, so layers whose coordinates are degrees in one file and meters in another would be stacked into geographic nonsense without a warning proportional to the damage. If your layers disagree, reproject the strays first, permanently, as our guide to reprojecting a layer in QGIS teaches, and then merge the harmonized set. Two softer preparations pay for themselves as well: open each attribute table and eyeball the field names, because the next section's rules are about to apply to them, and make the merge output a new file rather than a temporary layer if the result matters, so the stack survives the session.

Running the Merge

Open Vector, Data Management Tools, Merge Vector Layers. The dialog asks for input layers, with a selector that accepts every layer currently loaded in your project, and a destination for the merged output. Tick the layers to stack, in any order, order affects nothing but the sequence of rows in the result, choose or create the output file, and run. QGIS writes a single layer containing every input feature, each carrying its original attributes as mapped by the field rules below, plus, if you keep the default, the tool can add fields recording which source layer and file each feature came from, provenance worth keeping whenever the stack mixes sources you may later need to unmix. The result loads into your project ready for styling, filtering, and analysis as one dataset. Resist the urge to delete the inputs the moment the merge succeeds. The merged layer is a derivative; until you have run the checks in the final section, the originals are your only way back from a silent mistake, and disk is cheaper than reconstruction. When the same stacking job recurs, monthly exports, weekly field returns, note that the tool is also available in the Processing toolbox, where it can sit inside a saved model and run the whole merge, checks and all, in one click next time.

Aerial view of a river running between croplands
Aerial view of a river running between croplands

What Happens to the Attribute Fields

Geometry stacking is simple; attribute stacking is where merges go subtly wrong, so read the rules before they apply to you. The output's field set is the union of the inputs' fields: if layer A has a Name field and layer B has a Name and a Population field, the output has both, and every feature from layer A carries a null in Population, because it never had one. Nulls are honest, but downstream tools that count, sum, or filter will meet them, so a merged table with ragged schemas needs a deliberate cleanup pass, filling, standardizing, or consciously leaving null where unknown is the truth. Field name collisions with different types are the sharper hazard: if one layer stores Code as text and another stores Code as a number, the tool cannot stack them into one field of one type, and it resolves the conflict by renaming, producing sibling fields with suffixed names. The merge succeeds, the map looks right, and the table now has two Code columns quietly splitting your data between them. The cure is upstream: harmonize field names and types in the inputs before merging, renaming in the layer properties or through the field calculator, so the union the tool builds is the schema you designed rather than the one it improvised. A merged layer is only as trustworthy as its table, and the table is decided before you ever open the tool.

After the Merge: Four Checks Before You Trust It

Run these in order; together they take two minutes and catch essentially every way a merge lies. Count the features. The output's feature count must equal the sum of the inputs' counts, exactly. A shortfall means a layer was skipped or a type mismatch quietly dropped features, and no other check can excuse it. Check the extent. Zoom to the merged layer's full extent and compare it against the inputs overlaid: the stack should occupy exactly the union of the inputs' footprints over a basemap, and any feature sitting in an ocean or a neighboring continent is a CRS confession. Sample the table. Sort by the provenance field if you kept it, open a few features from each source, and confirm their attributes arrived intact and in the right columns, especially any field that had a near-twin in another layer. Hunt the renamed fields. Read the output's field list once, fully: suffixed duplicates are the signature of a type conflict, and finding them now, while the inputs are still loaded and the fix is a rename and a re-run, is the entire point of looking. Pass all four and the merged layer has earned its place as your working dataset. Fail one and the merge is not done, merely attempted, and the honest move is to fix the inputs and run it again rather than patch the output.

Merging Is Not Appending to a Database, and Other Cousins

Three neighboring operations are constantly confused with merging, and a minute on each saves a wrong tool choice. Appending to a database table, in PostGIS or a GeoPackage, writes new rows into an existing table with an established schema: the destination's fields rule, and incoming data must conform or be cast to fit. Merging, by contrast, creates a new layer whose schema is negotiated from the inputs, which is why the field rules in this article exist. Appending is the better tool when the destination is a maintained database with a schema worth defending; merging is the better tool when peers of equal standing need to become one file. Packaging layers, through Layer, Package Layers, gathers several layers into one container file while keeping them separate layers inside it: nothing is stacked, and the output answers "give me one file" without answering "give me one dataset." And virtual layers and unions in the database sense combine data at query time without writing anything, the right answer when the inputs keep changing and any merged file would be stale by Friday. The question that sorts all four is whether you need one geometry collection, one file, one table, or one live view. Merging owns exactly the first of those, and the discipline of this whole guide, harmonize first, check after, exists because a merged file freezes its inputs' sins into a single, confident layer.

Provenance: Knowing Which Rows Came From Where

A merged layer's last professional duty is memory. Six months after the merge, someone, often you, will ask which office contributed the suspicious cluster of rows, or whether a district's data predates the boundary change, and the merged file alone cannot answer unless the answer was built in. The cheap insurance is a provenance field: before merging, add a text field to each input naming its source, its office, its survey, its date, and let the merge carry it through like any other attribute. With that one column, the merged layer stays auditable forever: filter by source to re-check a contributor, symbolize by source to see the patchwork's seams, extract by source to return a corrected subset to its owner. Without it, a merged layer is an orphanage, complete, useful, and silent about its origins. The same instinct extends to the file itself: name the merged output with its date and scope, and keep the inputs untouched in the project folder, because the merge is a derived product, and derived products are only trustworthy when their ingredients survive. Merging well is mostly this kind of housekeeping raised to a method: harmonize before, verify after, and keep the receipts throughout.

Related Guides

Readers working through this topic usually need its closest companions too. These GIS and open map data guides cover the neighboring ground:

Frequently Asked Questions

Where is the merge tool in QGIS?

Under Vector, Data Management Tools, Merge Vector Layers. It is also available in the Processing toolbox, which is the version to use when you want the merge inside a saved, repeatable model.

Can I merge layers in different projections?

Not directly. Merge Vector Layers does not reproject its inputs, so all layers must already share one coordinate reference system. Reproject the mismatched layers to a common CRS first, then merge.

Can I merge a point layer with a polygon layer?

No. Merging stacks features of the same geometry type: points with points, lines with lines, polygons with polygons. Mixed types have no meaningful stack, and the tool will refuse or fail on them.

What happens when the layers have different fields?

The output takes the union of all fields, and features from a layer that lacked a field carry null in it. If two layers use the same field name with different data types, the tool renames one, creating suffixed duplicate fields, so harmonize names and types before merging.

How do I know the merge worked correctly?

Check that the output feature count equals the sum of the inputs, that the extent matches the inputs over a basemap, that sampled attributes sit in the right columns, and that no suffixed duplicate fields appeared. Those four checks catch nearly every merge failure.

Photo credits: Okan Demircan (Pexels); Radoslaw Sikorski (Pexels). Photos are served from this site; follow the credit to the library page for the original.