GIS Tools

Language

Made withfor the GIS community

Erase / Difference Tool

Remove parts of features that overlap with another layer

Geoprocessing

Input Layer (to be erased from)

Drop files here or click to browse

Supported formats: GeoJSON

GeoJSON

Erase Layer (areas to remove)

Drop files here or click to browse

Supported formats: GeoJSON

GeoJSON

About Erase

  • Erase removes areas where layers overlap
  • Also known as Difference operation (A - B)
  • Useful for excluding areas like water bodies
  • Properties from input layer are preserved
Input
Erase
Result

What Is the Erase / Difference Operation?

The Erase operation (also called Difference) removes portions of one vector layer that overlap with another. Given an input layer A and an erase layer B, the result contains everything in A that does not fall within B. It is the inverse of Clip: where Clip keeps the overlap, Erase discards it. Erase answers questions like "show me all the habitat outside the proposed roads", "which parcels are outside the flood zone", or "where does forest cover extend beyond the protected area boundaries?".

The Erase / Difference Tool on gis.tools performs vector difference entirely in your browser. Drop the input and erase layers in, click Erase, and get a clean result with the overlap carved out. There is no upload, no account, and no waiting on a cloud queue.

In set theory terms, Erase implements A βˆ’ B (the relative complement of B in A). Its formal SQL/PostGIS equivalent is ST_Difference(a.geom, b.geom), and it is called "Symmetric Difference" only when applied in both directions (A βˆ’ B) βˆͺ (B βˆ’ A).

How Erase Works

The algorithm walks through each feature in the input layer, unions the overlapping portion of the erase layer with it, and subtracts that union from the input geometry. The result is the geometric complement. Modern implementations delegate the actual difference computation to GEOS/JTS ST_Difference, which handles floating-point-robust polygon arithmetic.

Multiple Erase Polygons

If the erase layer contains multiple polygons, they are unioned internally before subtraction. A single input feature can end up being cut by many erase polygons in one pass.

Line and Point Inputs

Erase works for lines (output is segments outside the erase polygon) and points (output is points outside). Points inside the erase polygon are removed; lines that cross the boundary are truncated.

Attribute Handling

Erase preserves the input layer's attributes unchanged. The erase layer's attributes are not transferred. If a single input feature is split into multiple disjoint pieces by the erase, each piece inherits the original attributes.

Key Parameters and Options

Input Layer

The layer being reduced. Can be polygons, lines, or points.

Erase Layer

The layer whose footprint is subtracted. Must be polygon geometry.

Preserve Attributes

Default on β€” output keeps the input's attribute fields.

Practical Applications

Developable Land Analysis

Start with a parcel layer and erase wetlands, floodways, steep slopes, and conservation easements to identify the net developable area remaining in a jurisdiction.

Conservation Gap Analysis

Erase protected-area polygons from the total habitat layer to see how much habitat is unprotected β€” the basis of gap analysis in conservation biology.

Infrastructure Planning

Erase existing road rights-of-way from a proposed corridor to isolate the new acquisition footprint.

Deforestation Monitoring

Erase current forest cover from historical forest cover to map forest loss polygons. Combine with the Area Calculator to quantify hectares lost.

Insurance Underwriting

Erase covered zones from a total exposure layer to find uninsured or underserved areas.

Redistricting

Erase excluded census blocks from draft districts to remove ineligible areas before finalizing boundaries.

Land Reclamation

Erase disturbed-soil polygons from total mine footprints to track reclamation progress over time.

Step-by-Step Workflow in gis.tools

  1. Open the Erase / Difference Tool
  2. Drag the input layer onto the first drop zone
  3. Drag the erase layer (must be polygons) onto the second drop zone
  4. Preview both layers overlaid on the map
  5. Click "Erase" to compute the difference
  6. Inspect the output β€” features that were fully inside the erase layer will be missing
  7. Export as GeoJSON, KML, or Shapefile

Worked Example

A county planner needs to calculate the net buildable area for a new subdivision ordinance. She starts with a 200-hectare parcel layer and needs to exclude wetlands, floodplains, and existing road rights-of-way. She unions those three constraint layers into one using the Union Tool, then drops both the parcel layer and the union into the Erase Tool. The output shows the parcels reduced by all constraints, totaling 142 hectares of buildable ground. She runs the Area Calculator on the result to confirm the number for the staff report.

Common Pitfalls and Gotchas

  • CRS mismatch between input and erase layers produces garbage output. Check with CRS Metadata Inspector.
  • Empty geometries can result when an input feature is fully covered by the erase layer. Filter these out or handle them explicitly.
  • Invalid erase polygons cause the operation to fail or produce partial output. Fix with Geometry Repair.
  • Ring winding issues can flip inside/outside tests, producing the opposite of what you expect. Validate with GeoJSON Validator & Fixer.
  • Sliver artifacts along the erase boundary are a common annoyance. Filter by minimum area.
  • Performance degrades with very detailed erase layers; simplify the erase layer first if accuracy allows.
  • Multipart results: input features split by the erase polygon become MultiPolygons; be aware if downstream tools need singlepart.
  • Self-intersecting inputs lead to unpredictable results.

Tips for Best Results

Comparison with Other GIS Approaches

PostGIS exposes this as ST_Difference(a.geom, b.geom) in a spatial join. QGIS has a Difference tool under Vector > Geoprocessing Tools. ArcGIS Pro has the Erase tool in the Analysis toolbox (historically Advanced-license only, though newer versions expose it in Pairwise form for better performance). The browser-based Erase Tool on gis.tools is ideal for interactive one-off difference operations without the setup overhead of desktop GIS.

Performance Considerations

Erase cost scales roughly linearly with input feature count and is dominated by erase-layer complexity. Browser memory tolerates a few hundred thousand vertices comfortably. For very large jobs, split the input spatially and process in tiles.

Data Privacy and Browser-Based Processing

Everything runs locally. Your parcel data, your constraint layers, and your result never leave your machine.

Related GIS Concepts

Erase implements A βˆ’ B in set theory. Symmetric Difference is (A βˆ’ B) βˆͺ (B βˆ’ A) and can be computed by running Erase in both directions and unioning the results. Mask inverse is a raster synonym. Extract by Mask in ArcGIS raster terminology has an inverse flag that mirrors Erase behavior.

Frequently Asked Questions

What's the difference between Erase and Clip?

Clip keeps the overlap; Erase discards the overlap. Both keep only the input layer's attributes.

Can I erase points or lines?

Yes. Points inside the erase polygon are dropped; lines are truncated at the erase boundary.

What if a feature is entirely inside the erase polygon?

The feature becomes empty and is typically dropped from the output.

Does erase work on raster?

For raster, use Clip Raster by Polygon with an inverse mask instead.

Related Tools on gis.tools

100% client-side processing - your data stays private and never leaves your device