Union Tool
Combine geometries from two layers
What Is a GIS Union?
The Union operation combines two polygon layers into a single output that preserves every geometry from both inputs. Where the two layers overlap, the output is split into new features; where they don't overlap, the original geometries remain. Each output feature carries attributes from whichever input(s) contributed to it, making Union the most information-preserving of the three classic overlay operations (Union, Intersect, Erase). When you need to compute "everything that is in A or B, and know exactly which source each piece came from," Union is the tool.
The Union Tool on gis.tools computes polygon union for any two GeoJSON, KML, or Shapefile layers entirely in your browser. It follows the same semantics as QGIS's Union tool, ArcGIS Pro's Union in the Analysis toolbox, and PostGIS's ST_Union when applied across two tables with ST_Intersects joins. Because processing happens client-side, you can union proprietary data without any cloud upload.
Union is distinct from Dissolve and from the geometric ST_Union used for merging. Dissolve merges features within a single layer by attribute; the overlay Union combines features from two different layers while preserving provenance.
How Polygon Union Works
Polygon union processes both layers through a planar subdivision algorithm. The logic is:
- Overlay both layer's boundaries on a common plane
- Identify every distinct face (connected region) of the resulting arrangement
- For each face, record which input features it came from
- Emit each face as an output feature with attributes from all its source features
The computational geometry is non-trivial and robust implementations use arbitrary-precision arithmetic to avoid floating-point rounding errors that would create sliver polygons or topology breakage. GEOS, JTS, Boost.Polygon, and polyclip-ts all implement variants of this logic.
Output Feature Count
A union of an n-feature layer with an m-feature layer can produce anywhere from max(n, m) to n+m+k features where k is the number of new faces created by crossings. Expect the output to have more features than either input.
Attribute Handling
Faces from only Layer A carry Layer A's attributes with null values for Layer B's fields, and vice versa. Overlap faces carry the union of both attribute sets. Column name collisions are resolved with suffixes (e.g., name_1, name_2).
Key Parameters and Options
Input Layers
Both layers must contain polygon geometries for classical union. Mixed geometry inputs are sometimes supported but produce unclear semantics; split into single-type layers first.
Preserve Input Attributes
Default on β all attribute columns from both layers appear in the output. Disable if you only care about geometry.
Practical Applications
Cadastral and Parcel Management
Municipalities union new subdivision layers with existing cadastral base maps to produce updated parcel datasets that track both old and new ownership information in a single file.
Environmental Overlay Analysis
Conservation planners union protected areas with proposed conservation easements to see the total protected footprint while tracking which designation covers each piece of land.
Land Use Planning
Planners union existing zoning with proposed rezoning overlays to identify which parcels have changed, which haven't, and which fall in new overlay districts.
Utility Coverage Consolidation
Electric, gas, and water utilities union their respective service territories to build a joint infrastructure map showing which areas are covered by each utility.
Floodplain Mapping
Hydrologists union pre-storm and post-storm inundation polygons to identify newly flooded areas versus areas flooded in both events, while tracking total exposure.
Administrative Boundary Harmonization
Merge overlapping administrative hierarchies (e.g., a planning district that overlaps multiple counties) while preserving all jurisdictional tags.
Insurance Risk Consolidation
Insurers union wind, flood, and earthquake hazard zones to compute a composite peril map with separate hazard identifiers on each face.
Step-by-Step Workflow in gis.tools
- Open the Union Tool
- Drag the first polygon layer onto the drop zone
- Drag the second polygon layer onto the second drop zone
- Preview both layers overlaid on the map
- Click "Union" to compute the overlay
- Inspect the output feature count (expect it to exceed the larger input)
- Review attribute columns from both parents
- Export the result as GeoJSON, KML, or Shapefile
Worked Example
A city planner wants to map the combined footprint of two separate protection districts: a historic preservation overlay and a riparian protection overlay. Both are polygon layers with different attributes. She drops them into the Union Tool. The output has 412 polygons: 230 from the historic overlay alone, 156 from the riparian alone, and 26 where they overlap. Each overlap polygon carries both HISTORIC_CODE and RIPARIAN_CLASS attributes, letting her identify parcels subject to dual regulation. She styles the result with the Categorical Styling tool for a combined-protection map.
Common Pitfalls and Gotchas
- Sliver polygons from near-parallel boundaries are the #1 union artifact. Clean up with a minimum-area filter afterwards.
- Topology errors in either input cause exceptions. Run Geometry Repair first.
- CRS mismatch between inputs produces garbage. Verify with CRS Metadata Inspector.
- Column name collisions may unexpectedly rename or overwrite fields. Check output schema.
- Performance degrades quickly with very high vertex counts; simplify both inputs first if accuracy allows.
- Mixed geometry types produce undefined behavior β union is strictly a polygon operation.
- Disconnected multipart features may or may not be preserved depending on implementation; inspect carefully.
- Null attribute handling varies β some tools use empty strings, others use JSON null. Test downstream.
Tips for Best Results
- Reproject both layers to the same CRS first with the EPSG Reprojector & Coordinate Converter
- Run Geometry Repair on both inputs beforehand
- Filter sliver polygons (e.g., drop anything under 1 mΒ²) after union to clean the output
- Use GIS Dissolve Tool (Merge by Field) to post-process unions into meaningful groups
- Inspect the result visually with the Symbology Editor before exporting
Comparison with Other GIS Approaches
PostGIS supports overlay union via ST_Union combined with spatial joins, but pure overlay union is more elegantly expressed in QGIS or ArcGIS dedicated tools. ArcGIS Pro's Union is GUI-accessible and scales to large datasets; QGIS provides the same via the Union algorithm. Command-line GDAL can do limited overlay via ogr2ogr with SQL. The browser-based Union Tool on gis.tools is ideal for interactive overlay on mid-size layers where you want immediate visual feedback.
Performance Considerations
Union is more expensive than clip or intersect because it must compute the full planar subdivision, not just the overlap. Two layers of 10,000 polygons each typically union in 10-30 seconds in the browser. Hundreds of thousands of features or very detailed geometries may exceed browser memory. Simplify inputs with the GeoJSON Simplifier if tolerance permits.
Data Privacy and Browser-Based Processing
Both inputs stay in your browser throughout the union operation. No data is uploaded, no results are sent to a server. Sensitive property, financial, or regulatory data can be combined safely without triggering a cloud review process.
Related GIS Concepts
The overlay Union is distinct from the geometric union ST_Union which simply merges geometries without attribute preservation. Intersect (A β© B) keeps only the overlap; Erase (A β B) keeps only A outside B; Symmetric Difference keeps only non-overlapping parts. Identity is a rarely-used hybrid that keeps Layer A intact but tags pieces with Layer B's attributes where they overlap.
Frequently Asked Questions
How is this different from dissolve?
Dissolve merges features within a single layer by attribute; Union combines two layers and tracks source provenance on each output feature.
Can I union more than two layers?
Run Union twice: A union B, then the result union C.
Why did my output get so many more features than the input?
Union creates a new face for every distinct region formed by overlapping boundaries. Complex overlays can quadruple the feature count.
Does Union work on points or lines?
Overlay Union is strictly for polygons. For point or line merging, use the Merge Features tool.
Related Tools on gis.tools
Related Tools
View All ToolsHex Grid & Fishnet Grid Generator
Generate hexagonal or rectangular grid over an extent
GeoprocessingSnap Points to Line
Snap points to the nearest line or road
GeoprocessingLine Intersection Finder
Find all intersection points in line layers
GeoprocessingPoint in Polygon
Find which points fall inside polygon boundaries
GeoprocessingGIS Buffer Tool
Create buffers around features with customizable distance and join style
GeoprocessingRoute Along Network
Find shortest path through a user-provided network
Geoprocessing100% client-side processing - your data stays private and never leaves your device