Skip to content
MSP
Several map layers from different sources converging on one master copy, with one polygon marked in gold where a version diverged
  • Geospatial Data Engineering
  • problem-solving
  • solution-design
  • geo-tech

Reconciling Many Versions of the Truth in Geospatial Data

Mahardi Setyoso Pratomo7 min readEnglish

When community maps, POIs and geofences all have different owners, "which version is right" needs access tiers, a master copy and an edit log, not a debate.

Why does the same map data end up with many versions?

Because different people legitimately change it for different reasons, and nothing forces those changes to meet. In a map operations team, "the data" is never one dataset. It is a set of layers, each with its own editors and its own rhythm of change.

  • Points of interest (POIs) are edited periodically, and only the map operations team edits them.
  • Service geofences are updated periodically and adjusted whenever the business needs a different coverage. Many departments ask for these changes.
  • Road segmentation for routing is a separate layer, shaped by what routing needs rather than by what a map looks like.
  • OpenStreetMap (OSM) sits outside the company. It is a free, editable map built by volunteers, so its conventions come from a community, not from an internal SOP.

None of these is wrong on its own. The trouble starts where two of them describe the same place differently, or where two people edit the same object without knowing about each other.

Where do the versions actually collide?

In three places I saw repeatedly:

  1. Community convention versus internal SOP. The OSM community may prefer a different way of defining a road than the operations team's SOP does. Both are defensible; they produce different geometry.
  2. A polygon edited "for a trial" that is live in the service. A stakeholder team changes a polygon to test something, unaware that it is currently active in production.
  3. Two projects with different output scope touching the same data. Each project is correct for its own purpose, yet their outputs differ somewhat when someone compares them.
The main sources of geospatial data and the three points where their versions collide: community versus SOP, trial edits on live polygons, and projects with different scopeOpen full size
Figure 1. Each layer has its own owner; the conflicts sit where owners overlap.

What happened when a live geofence silently changed?

A campaign geofence, managed jointly by the map operations team and a stakeholder team, was reported by that team as not working in some target areas just before a launch. We checked and found that the area had been deleted from the live system.

The first useful fact was that it was recoverable: the master GeoJSON and SHP files kept locally still covered the area. Someone had deleted it, deliberately or not, and the live system had no memory of who.

We tried to trace it through the history log by asking an engineer for the record. The log only showed that the geofence had been edited. It did not show who had edited it. So the question "who did this?" had no answer, and the question "what do we do now?" had to be answered without it.

Timeline of the incident: launch preparation, a stakeholder team reports the geofence not working, the area found deleted, the edit log shows only an edit, the polygon restored from the master fileOpen full size
Figure 2. The log knew that something changed. It did not know who changed it.

What we did, in order:

  1. My team restored the polygon from the local master file on my instruction, which fixed the launch problem.
  2. Asked the engineers for a history log with username tracking, and they delivered it, so the next incident answers "who".
  3. Coordinated with the stakeholder team on an SOP for operating those geofences, and gave edit access only to specific users.

Why did a master copy outside the live system save the day?

Because the live system and the master copy fail differently. The live system is optimised for being edited quickly by many people. That is exactly why it can lose an area without anyone noticing. The master files were slow, boring and rarely touched, which made them a trustworthy reference.

The lesson I took is not "keep local files". It is that every live, shared layer needs a slower copy that only changes deliberately, and that someone must know how to restore from it. Without that, the live system is both the source of truth and the only witness to its own mistakes.

How do you decide which version wins?

Not by debate in the middle of an incident. You decide in advance, with three mechanisms that I would now treat as a minimum.

Mechanism What it answers Example
SOP agreed by the teams involved "Whose convention applies when two sources disagree?" A written rule for how roads are defined and when the community version is adopted or overridden
Access tiers "Who may change this object?" Master access, edit access, view-only, set per geofence or service border
Versioning or edit history "Who changed what, and when?" A history table with the old geometry, the new geometry, the user and the time
Three mechanisms, each answering one question: an SOP for whose convention applies, access tiers for who may change an object, and edit history for who changed what and whenOpen full size
Figure 3. Three mechanisms, three different questions.
Three layers of control: an SOP that decides between versions, access tiers (master, edit, view) per object, and a history table recording who changed what, with the master copy as a restore pointOpen full size
Figure 4. The SOP decides, the tiers limit who can change, the history records what did.

The three work together. The SOP stops arguments from restarting each time. Access tiers shrink the number of people who can cause an incident. The history makes the remaining incidents answerable.

What would a minimal edit history look like?

The history log we had was the weak point, so this is the part I would design first. The sketch below is generic PostGIS and is not taken from any production system. It follows the audit pattern in the PostgreSQL trigger documentation: an AFTER row-level trigger can read both OLD and NEW, and records the change as a side effect.

CREATE TABLE geofence_history (
    history_id   bigserial PRIMARY KEY,
    geofence_id  bigint        NOT NULL,
    action       text          NOT NULL,   -- 'U' update, 'D' delete
    old_geom     geometry(MultiPolygon, 4326),
    new_geom     geometry(MultiPolygon, 4326),
    changed_by   text          NOT NULL DEFAULT current_user,
    changed_at   timestamptz   NOT NULL DEFAULT now()
);

CREATE FUNCTION log_geofence_change() RETURNS trigger AS $$
BEGIN
    IF TG_OP = 'UPDATE' THEN
        INSERT INTO geofence_history (geofence_id, action, old_geom, new_geom)
        VALUES (OLD.id, 'U', OLD.geom, NEW.geom);
    ELSIF TG_OP = 'DELETE' THEN
        INSERT INTO geofence_history (geofence_id, action, old_geom)
        VALUES (OLD.id, 'D', OLD.geom);
    END IF;
    RETURN NULL;  -- ignored for AFTER triggers
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER geofence_audit
AFTER UPDATE OR DELETE ON geofence
FOR EACH ROW EXECUTE FUNCTION log_geofence_change();
An update or delete on the geofence table fires an after-row trigger that writes one row to a history table with old and new geometry, user and time; restore is one query on the old geometryOpen full size
Figure 5. Every update or delete leaves a row behind. The old geometry is what makes a restore quick.

Two caveats matter more than the code. current_user records the database role, so it only identifies a person if each person (or each application session) connects as an identifiable role. And storing the old geometry is what makes a restore a one-line query instead of a search through local files.

What would I design from the start?

  • Give every layer a named owner and write down who may edit it.
  • Keep a slow master copy of every layer that is live and shared, and test restoring from it.
  • Log who, not only what. A log that says "edited" without a user answers the wrong question.
  • Write the SOP before the first dispute, so the argument happens once, calmly.
  • Treat "for a trial" as a production risk. Trials belong on a copy, never on a live polygon.
  • Decide when community data wins and when it does not, per layer, in writing.

This connects to two earlier posts: what a map migration exposes about hidden dependencies and how a polygon gap turned into a revenue gap. In both, the damage came from data whose owner and history nobody could state.

FAQ

Why is there no single source of truth for map data?

Because map data serves several purposes and has several editors. A single master only works if every purpose can live with the same geometry. Usually they cannot, so the realistic goal is one owner per layer and a clear rule for which version applies to which use.

Should a company trust OpenStreetMap or its own data?

Neither blindly. OSM is built by a volunteer community and its conventions can differ from an internal SOP. Decide per layer which source leads, write down the rule, and record when you override the other.

How do you stop teams from editing live geofences by accident?

Reduce who can edit (access tiers), move experiments to a copy, and keep a history that records the user. The first two prevent most incidents; the third makes the rest explainable.

Is a database audit trigger enough?

It is a good start, not a complete answer. It records changes at the database level, but it identifies a person only if connections are tied to individual identities, and it does not replace an SOP or a restorable master copy.

References

Last updated: 9 November 2026.