Files
geointel/docs/18-ultra-prep/GEOMETRY_CONTRACTS.md
T
Codex 6ea3586a3e
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled
Initial GeoIntel V1 foundation
2026-06-16 23:36:32 +02:00

30 lines
943 B
Markdown

# Geometry Contracts
## Internal Geometry Standard
- Database geometries are stored in PostGIS.
- Default storage CRS: EPSG:31370 for Belgian projected operations where appropriate, or EPSG:4326 for API interchange.
- API GeoJSON is always EPSG:4326 unless explicitly stated.
- Area calculations must use projected CRS, not raw WGS84 degrees.
## Accepted Area Input
- GeoJSON Polygon
- GeoJSON MultiPolygon
- drawn polygon from frontend
- future: municipality selection
## Validation Rules
- polygon must be closed;
- polygon must be valid;
- polygon must have non-zero area;
- self-intersections must be rejected or repaired explicitly;
- extremely large areas must require confirmation or be rejected by configured max area.
## Output Rules
- include `crs` metadata if transformed;
- include computed area in square meters;
- include bounds;
- include geometry validity status.
## Common Trap
Never compute area or distance in degrees.