Geocoding and Location Privacy
Geocoding converts descriptions such as addresses or place names into candidate locations; reverse geocoding does the reverse. A coordinate is not a harmless lookup result. It may identify a home, workplace, clinic visit, routine, or vulnerable person when linked with time and other data.
Prerequisites
Complete spatial indexes. You should understand that a candidate search and an exact or ranked resolution decision are separate steps.
Learning goals
- Define geocoding input, normalization, candidate ranking, confidence, provenance, and unmatched outcomes.
- Keep provider/network behavior outside deterministic local examples.
- Make purpose, consent, precision, retention, access, deletion, and sharing explicit data-contract fields.
- Explain why rounding, aggregation, and removing names do not guarantee anonymity.
Resolution is uncertain
Addresses are temporal and jurisdiction-specific. Abbreviations, unit numbers, transliteration, street renaming, duplicated place names, and incomplete reference data create ambiguity. A geocoder should return stable candidate identifiers, matched fields, match type, score semantics, reference-data version, and an unmatched or review state. A provider score is not a calibrated probability unless documented as one.
Hosted services add network, credentials, licensing, rate limits, retention, and jurisdictional questions. Batch uploads can disclose an entire customer or participant list. The example therefore resolves a tiny repository-owned gazetteer locally and makes no claim about a production provider.
Privacy is part of the schema
Before collection, record the purpose, legal/ethical basis, consent scope, required precision, access roles, retention period, deletion process, allowed joins, and safe sharing output. Collecting centimetre-level or continuous traces for a district-level question is data overcollection. Retention should be bounded by the task, not storage convenience, and withdrawal must propagate to derived tables where feasible.
Coarsening coordinates can reduce precision but does not eliminate reidentification. Repeated locations, rare routes, timestamps, auxiliary public data, and small groups can reveal identity. Safe sharing may require aggregation thresholds, time coarsening, suppression, access controls, query auditing, synthetic data, or not releasing the dataset. Evaluate utility and risk in the actual threat model.
Worked example
import json
import re
from pathlib import Path
fixture = Path("tests/fixtures/geospatial-data-science")
document = json.loads((fixture / "places.geojson").read_text(encoding="utf-8"))
def normalize(value):
return re.sub(r"[^a-z0-9]+", " ", value.lower()).strip()
gazetteer = {
normalize(feature["properties"]["place_id"].replace("-", " ")): feature
for feature in document["features"]
}
query = "West Library"
match = gazetteer.get(normalize(query))
policy = {
"purpose": "district-level service planning",
"consent": "purpose-bound",
"shared_precision": "district-only",
"retention_days": 7,
"raw_coordinates_released": False,
}
district = "west" if match and match["geometry"]["coordinates"][0] < 13.4 else "east"
print(f"query={query!r} match_id={match['properties']['place_id']} candidate_count={int(match is not None)}")
print(f"shared_precision={policy['shared_precision']} district={district} raw_coordinates_released={policy['raw_coordinates_released']}")
print(f"consent={policy['consent']} retention_days={policy['retention_days']} deletion=required safe_sharing=aggregate-only")
Expected output:
query='West Library' match_id=west-library candidate_count=1
shared_precision=district-only district=west raw_coordinates_released=False
consent=purpose-bound retention_days=7 deletion=required safe_sharing=aggregate-only
The lookup is exact after documented normalization. A real system must expose ambiguous and unmatched cases instead of silently choosing. The example releases a district label rather than the fixture coordinate, but that is only one control—not proof that the result cannot be linked back to a person.
Limitations and common mistakes
- Consent for one purpose is not blanket permission for secondary use or retransmission.
- Rounding can create edge artifacts and still reveal a residence or habitual stop.
- “Anonymous” identifiers can remain linkable across time and datasets.
- Deleting raw points while retaining identifiable derived trajectories does not satisfy the intended deletion outcome.
- Do not cache provider results unless licensing, retention, refresh, and user expectations permit it.
Practice
Draft a location-data contract for a walking-access study. Include purpose, minimum precision, sampling frequency, consent and revocation, access roles, retention, derived-data deletion, allowed joins, aggregation threshold, and a safe-sharing review owner.
Next steps
Next, model time, error, and gaps explicitly in GPS trajectories and movement data.
Primary sources
Checked 2026-10-18: W3C, Geolocation privacy considerations for consent, purpose, retention, access, deletion, and sharing; W3C/OGC, responsible use of spatial data; W3C, privacy principles; IETF, GeoJSON coordinate order and precision considerations.