Vector Change Detector
Compare two GeoJSON layers to find differences
What Is Vector Change Detection?
Vector change detection is the process of comparing two vector layers that represent the same area at two different moments in time β or two different versions of the same dataset β to identify what has been added, what has been removed, what has moved and what has changed attributes. Where raster change detection compares pixels and returns a difference raster, vector change detection compares features and returns four categories: added, deleted, modified geometry and modified attributes. The output is a labelled feature layer that highlights every change between the two inputs.
The Vector Change Detector tool on gis.tools loads two GeoJSON layers (or any format the gis.tools loader supports), compares them feature-by-feature by ID and geometry, and produces a change report with colour-coded features. People search for "vector change detection", "compare geojson layers", "gis diff layers", "detect feature changes", "qgis table compare" and "polygon compare tool" because change detection is an everyday need in data maintenance, cadastre updates, OpenStreetMap editing, quality assurance and monitoring workflows.
Vector change detection is conceptually similar to a git diff for spatial data: it answers "what is different between these two versions?" with specific, actionable output.
How Vector Change Detection Works
The algorithm runs in two phases: feature matching and change classification.
Phase 1: Feature Matching
Every feature in the "before" layer must be matched to zero or one feature in the "after" layer. Matching strategies include:
- ID-based: Match features whose unique ID attribute is identical. The fastest and most reliable strategy when both layers carry stable IDs.
- Geometry-based: Match features with identical or nearly-identical geometries (allowing for small floating-point differences).
- Spatial-nearest: Match each feature to its nearest neighbour in the other layer within a distance threshold. Useful when IDs are missing but geometries have moved slightly.
- Attribute-based: Match on a composite key (e.g. street name plus house number) when IDs are not available.
Phase 2: Change Classification
Once features are matched, each pair is classified:
- Added: Features in "after" with no match in "before".
- Deleted: Features in "before" with no match in "after".
- Unchanged: Matched features with identical geometry and identical attributes.
- Geometry changed: Matched features with different geometries (vertex moved, boundary shifted, ring added).
- Attribute changed: Matched features with identical geometry but different attributes (name change, status update, value correction).
- Both changed: Matched features where both geometry and attributes differ.
Tolerance and Fuzziness
Floating-point coordinates rarely match exactly, so a coordinate tolerance is applied (e.g. 1e-7 degrees). Attribute comparison can be strict (exact equality) or fuzzy (ignoring whitespace, case or numerical noise).
Output Structure
The output is typically one or more layers: an "added" layer, a "deleted" layer, a "modified" layer and (optionally) an "unchanged" layer. Each modified feature carries a before/after attribute diff so you can see exactly what changed.
Key Parameters and Options
Matching Strategy
ID-based, geometry-based, spatial-nearest or composite-key matching. ID-based is preferred when available; spatial-nearest is a fallback when IDs are missing.
Coordinate Tolerance
The maximum acceptable coordinate difference for two geometries to be considered identical. Values around 1e-7 degrees (~1 cm) are typical for projected data; larger for geographic coordinates.
Attribute Comparison Mode
Strict (exact equality), case-insensitive, whitespace-trimmed or numerical-tolerance. Each catches different classes of false positives.
Ignored Attributes
Some attributes (timestamps, version numbers, generated IDs) change with every update and should be ignored during comparison.
Include Unchanged Features
Output all features including unchanged ones (useful for full audit trails) or only changed features (more compact).
Output Format
Separate GeoJSON layers per category, a combined layer with a change_type attribute, or a JSON change report.
Practical Applications
Cadastral Update Audit
A land records office receives a monthly update from a surveying contractor and needs to verify which parcel boundaries have changed. Vector change detection against the previous version highlights added subdivisions, merged parcels and corrected boundaries, feeding a manual QA workflow.
OpenStreetMap Edit Review
OpenStreetMap editors download a regional extract before and after a weekly editing session to see exactly what changed. The change report feeds a peer review process that catches vandalism, accidental deletions and attribute regressions.
Building Footprint Change Detection
A municipality receives an annual building footprint update from a commercial provider and uses vector change detection to identify new construction, demolitions and extensions. The output drives property tax reassessment and permit compliance checks.
Protected Area Boundary Audit
A conservation agency compares a newly-gazetted protected area polygon layer against the previous version to detect boundary adjustments. Added and removed areas are flagged for stakeholder review.
Data Quality Assurance Pipeline
An ETL pipeline ingests a weekly GIS dataset and runs vector change detection against the previous week to catch unexpected changes β a deleted feature class, a mass attribute update or an accidental coordinate shift. The report is reviewed before the update is promoted to production.
Road Network Maintenance
A transportation agency compares an OpenStreetMap extract from last month to this month to identify new roads, reclassified highways, deleted segments and corrected geometries. The change report feeds the road asset management database.
Election District Redistricting Audit
A voter registration office compares the old and new district polygons after redistricting to identify every moved boundary and every address affected. The change report supports court challenges and public transparency.
OSM Vandalism Detection
A data quality analyst compares nightly OSM dumps to flag suspicious deletions or mass attribute changes that may indicate vandalism or bot errors. The change report feeds a manual review queue.
Step-by-Step Workflow in gis.tools
- Open the Vector Change Detector page on gis.tools.
- Drag the "before" layer (old version) into the first slot. Supported formats: GeoJSON, KML, Shapefile, GPKG.
- Drag the "after" layer (new version) into the second slot.
- The tool detects common attributes and offers a list of candidate ID fields. Pick the unique identifier if one exists.
- Choose the matching strategy (ID-based, geometry-based, spatial-nearest).
- Set the coordinate tolerance and attribute comparison mode.
- Optionally select attributes to ignore (timestamps, version columns).
- Click Compare. The tool matches features, classifies changes and produces colour-coded outputs.
- Preview the result on the map: added features in green, deleted in red, modified in yellow, unchanged in grey.
- Inspect individual modified features to see the before/after attribute diff in a side panel.
- Export the change report as separate GeoJSON layers or as a combined layer with a
change_typeattribute.
Worked Example: Weekly OpenStreetMap Road Network Changes
You maintain a regional road network dataset derived from OpenStreetMap. Each Monday you download a fresh Overpass extract covering your metro area and want to know what edits OSM contributors made over the weekend. You drop last week's extract into the "before" slot and this morning's into the "after" slot. You pick @id as the matching field (OSM ID). The tool matches about 45000 roads, classifies 42 additions (new residential streets in a subdivision), 8 deletions (two duplicate ways and six segments reclassified as footways), 180 geometry modifications (vertex adjustments after a satellite imagery refresh) and 62 attribute changes (speed limits, surface types and name corrections). You review the additions and confirm they match a new development visible in a recent aerial, approve the attribute changes and push the consolidated update into your production database.
Common Pitfalls and Gotchas
- Missing or unstable IDs force spatial-nearest matching, which is less reliable and produces false positives when features move significantly.
- Coordinate precision differences between exports (6 vs 7 decimal places) produce "geometry changed" false positives. Set an appropriate tolerance.
- Different attribute orders in the same feature read as identical content but different schemas; normalise before comparing.
- Timestamps, version numbers and generated IDs change with every export and must be ignored.
- Features split into parts (a single polygon becoming two parts) look like a deletion plus two additions; handle multipart changes explicitly if this is a concern.
- Features in different CRSes silently produce wrong results β reproject both to a common CRS first.
- Very large layers (hundreds of thousands of features) strain browser memory.
- Spatial-nearest matching with a threshold too small misses moved features; too large incorrectly matches distinct features.
Tips for Best Results
- Use stable unique IDs whenever available β they make change detection deterministic.
- Set a coordinate tolerance that matches the precision of your data (1e-7 degrees or equivalent metric value).
- Ignore volatile attributes (timestamps, version numbers) to focus on meaningful changes.
- Validate the comparison against a known-change subset before running on the full dataset.
- Use separate output layers per change type for easier styling and review.
- For version-controlled datasets, embed the commit hash or timestamp in the change report metadata.
- Combine change detection with Time Slider Animator to visualise changes across multiple time steps.
- Document matching and comparison parameters in a sidecar file so reviewers can reproduce the analysis.
Comparison with Other GIS Approaches
QGIS has several change detection plugins including Table Compare, Geometry Comparator and LayerDiffViewer, plus a built-in "Detect Dataset Changes" tool in Processing Toolbox since QGIS 3.12. ArcGIS Data Management provides the Feature Compare tool. PostGIS can diff tables with EXCEPT and geometry-aware comparisons. Python with GeoPandas offers programmatic change detection via compare and set operations. The Vector Change Detector on gis.tools delivers the full workflow in a browser tab, producing colour-coded outputs and attribute diffs without needing any installation or database setup.
Performance Considerations
ID-based matching is O(n + m) with hash-based lookups β essentially instant for layers up to hundreds of thousands of features. Spatial-nearest matching requires a spatial index (R-tree) for each layer and scales O((n + m) log(n + m)). Geometry comparison per feature is O(v) where v is the vertex count. For very large layers, clip to the area of interest first or simplify with GeoJSON Simplifier.
Data Privacy and Browser-Based Processing
Both the "before" and "after" layers stay in the browser. The matching, comparison and output generation all run client-side. No data is uploaded, no telemetry is collected and the change report is saved via a local download blob. This matters for sensitive datasets, pre-release updates and proprietary data comparisons subject to strict data residency rules.
Related GIS Concepts
Feature Matching: The fundamental problem of linking a feature in one layer to its counterpart in another. Can be ID-based, geometry-based, attribute-based or spatial.
Attribute Diff: A key-by-key comparison of two feature attribute tables showing which values changed.
Geometry Difference: The geometric operation that returns the symmetric difference between two geometries, useful for visualising boundary shifts.
Temporal Data Management: A broader discipline covering bi-temporal databases, valid-time and transaction-time tracking, and change data capture.
Git-Style Diffing: The source-control pattern of comparing two versions and highlighting additions, deletions and modifications, now adopted by spatial data tools.
Frequently Asked Questions
Can I compare two Shapefiles?
Yes β drag Shapefile bundles (.shp, .dbf, .prj) into both slots.
What if my features don't have stable IDs?
Use geometry-based or spatial-nearest matching. Results are less reliable but still useful.
How do I handle attribute-only changes?
The tool classifies them as "attribute changed" and includes a side-by-side diff of the changed fields.
Can I ignore specific attributes like timestamps?
Yes β select the fields to ignore before running the comparison.
Does the tool compare CRSes?
The tool reprojects both layers to a common CRS if needed, then compares. Original CRS is preserved in the output.
Can I export just the added and deleted features?
Yes β the output can be filtered to any combination of change types before export.
Related Tools on gis.tools
Related Tools
View All ToolsTime Slider Animator
Animate temporal data with playback controls
AnalysisCatchment Analysis
Analyze service areas with buffers or isochrones
AnalysisStory Map Generator
Create narrative maps with slides and notes
AnalysisThematic Dashboard
Build interactive dashboards with maps and charts
AnalysisCoverage Gap Finder
Identify areas not covered by service radii
AnalysisGIS Notebook
Save your project state to a single JSON file
Analysis100% client-side processing - your data stays private and never leaves your device