Coordinates stored with six or more decimal places of precision
Why it matters
Storing latitude and longitude with fewer than 6 decimal places introduces systematic positional error. At 4 decimal places the precision is approximately 11 meters — enough to place a marker across the street or in an adjacent building. At 2 decimal places it is roughly 1.1 kilometers, which can misplace a marker in the wrong neighborhood entirely. CWE-681 (Incorrect Conversion between Numeric Types) applies when floating-point coordinates are truncated into low-precision columns. ISO 25010:2011 functional-suitability is violated because the directory cannot reliably represent the physical location of a listing. For delivery, navigation, and accessibility use cases, 11-meter error is operationally significant.
Severity rationale
Medium because coordinate precision loss silently corrupts marker placement across all listings, undermining the directory's core function without an obvious error signal.
Remediation
Define latitude and longitude columns with at least 8 decimal places, or use a PostGIS geography type which stores full double-precision coordinates internally.
-- Option 1: explicit decimal columns
ALTER TABLE listings
ADD COLUMN latitude DECIMAL(10, 8),
ADD COLUMN longitude DECIMAL(11, 8);
-- Option 2: PostGIS geography (preferred for spatial queries)
ALTER TABLE listings
ADD COLUMN location GEOGRAPHY(POINT, 4326);
DECIMAL(10, 8) gives 8 decimal places (approximately 1.1mm accuracy). If columns already exist with low precision, migrate the type: ALTER TABLE listings ALTER COLUMN latitude TYPE DECIMAL(10, 8). Verify existing data after migration — low-precision values will not gain precision retroactively and may need re-geocoding.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Map & Location Integration Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-681 — Incorrect Conversion Between Numeric Types — precision loss on coordinate truncation
- iso-25010:2011 · functional-suitability — Functional Correctness — coordinate precision adequate for sub-metre accuracy
Taxons
History
- 2026-04-18·v1.0.0·Initial import from directory-map-location·automated