Indexof

Lite v2.0Geographic Information Systems › How to Copy Polygons Between Layers with Common Attributes in QGIS › Last update: About

How to Copy Polygons Between Layers with Common Attributes in QGIS

Copying Polygons Between Layers with Common Attribute Mapping in QGIS

Managing disparate vector datasets often requires merging features into a master template. A recurring challenge for GIS analysts is copying polygons from a "Source" layer to a "Destination" layer when the two layers have different attribute structures. If you simply copy and paste, QGIS may create null values for missing fields or discard data that doesn't align. To maintain Schema Integrity, you must use a method that filters for shared fields. This tutorial focuses on the most efficient way to append spatial features while ensuring that only the Common Attributes—the fields that exist in both layers—are preserved and populated.

Table of Content

Purpose

The primary purpose of this workflow is to achieve Data Harmonization. When merging polygons from different providers, you often want to ignore "junk" fields (like internal IDs or temporary notes) while retaining core information (like Area, Type, or Name). By focusing on common attributes, you prevent the destination layer from becoming cluttered with empty columns, which optimizes the performance of the Geopackage or Shapefile and simplifies future spatial queries.

Use Case

Selective attribute copying is essential for:

  • Inventory Consolidation: Merging municipal building footprints into a regional database where only "Building_ID" and "Address" match.
  • Environmental Monitoring: Combining habitat polygons from different years where the data collection standards (and fields) changed over time.
  • Standardizing CAD Imports: Extracting specific shapes from a messy CAD-to-GIS conversion into a clean, pre-defined spatial template.
  • Collaborative Mapping: Integrating field data from various mobile teams who may have used slightly different naming conventions for their fields.

Step by Step

1. Inspect the Schemas

Open the Attribute Table for both layers. Identify the fields that match exactly in name and data type (e.g., "LandUse" as a String). QGIS is case-sensitive; "landuse" and "LandUse" are viewed as different fields.

2. Use the "Append Features" Tool

While manual copy-paste is an option, the Append Features tool in the Processing Toolbox is safer for attribute mapping.

  1. Open the Processing Toolbox (Ctrl+Alt+T) and search for Append Features.
  2. Set the Input Layer as your Source (the layer you are copying from).
  3. Set the Target Layer as your Destination (the layer you are copying to).

3. Configure Field Mapping

Within the tool, look at the Field Mapping section:

  • The tool will automatically attempt to match fields with identical names.
  • For fields that don't match exactly but contain the same data, you can manually select the source field from the dropdown menu.
  • Set any fields that don't exist in the source to "Ignore" or "Null."

4. Execute and Validate

Run the tool. This will add the polygons to the target layer. Open the target layer's attribute table to verify that the geometries are present and the common fields are populated correctly without creating unwanted new columns.

5. Alternative: Merge Vector Layers

If you don't have a destination layer ready and want to create a new one:

  • Use the Merge Vector Layers tool.
  • It will create a new layer containing all fields from all inputs.
  • You can then use the Refactor Fields tool to delete the non-common columns in one batch.

Best Results

Technique Preservation Level Complexity
Append Features High (Specific Mapping) Moderate
Copy/Paste (Standard) Low (Literal Copy) Easy
Refactor Fields Very High (Complete Overhaul) Advanced

FAQ

What happens if the data types don't match?

If you try to append an "Integer" field into a "String" field, QGIS will usually convert it automatically. However, appending a "String" (like "Zone A") into an "Integer" field will result in NULL values because text cannot be converted to a number.

Can I copy polygons and keep the original FID?

Feature IDs (FID) are often automatically generated by the destination database (like GeoPackage). It is best practice to create a new field called "Original_ID" to store the source FID before copying, as the actual FID will likely change in the new layer.

How do I handle mismatched CRS?

The Append Features tool will reproject the geometry on-the-fly to match the destination layer's Coordinate Reference System. However, for best precision, ensure both layers are in the same CRS before you begin.

Disclaimer

Directly appending features modifies the target layer. If the target layer is a file on disk (like a Shapefile), this action cannot be undone unless you are in an active edit session. Always work on a backup copy of your destination layer. This tutorial is based on QGIS 3.x standards as of 2026. Different data formats (PostGIS vs. Flat Files) may have varying constraints on primary key uniqueness during the append process.

Tags: QGIS, VectorData, DataManagement, AttributeMapping

Profile: Tutorial on merging spatial data in QGIS by copying polygons between layers while maintaining only shared attribute fields. Learn to use the Append Features tool. - Indexof

About

Tutorial on merging spatial data in QGIS by copying polygons between layers while maintaining only shared attribute fields. Learn to use the Append Features tool. #geographic-information-systems #howtocopypolygonsbetweenlayers


Edited by: Zarin Mondal, Wayan Harahap & Margret Thorsson

Close [x]
Loading special offers...

Suggestion

Fix QGIS 3.40.5 Error: VRTBuilder Plugin Loading Failure (2026 Guide)

#fix-qgis-3405-error-vrtbuilder-plugin-loading-failure

ArcGIS Pro 3.6 Deep Learning on NVIDIA Blackwell GPUs: Resolving CUDA Mismatch

#arcgis-pro-36-deep-learning-on-nvidia-blackwell-gpus