{"id":"d74af1fc-0570-4f76-883e-52322bd5fceb","task":"Write an index-accelerated proximity query with PostGIS ST_DWithin using geography vs geometry types correctly","domain":"postgis.net","steps":["Store or cast points as geography to get distance filtering directly in meters via ST_DWithin(geog_col, point, meters)","For geometry columns, remember distance is expressed in the SRID's native units (degrees for EPSG:4326) — reproject to a metric SRID first if needed","Create a GIST index on the column: CREATE INDEX ... USING GIST (geom_or_geog_col)","Use ST_DWithin rather than filtering on ST_Distance for radius queries"],"gotchas":["ST_Distance does not use the spatial index — only ST_DWithin (and similar index-aware predicates) do","forgetting to reproject a geometry column before ST_DWithin silently returns degree-scaled (wrong-magnitude) results instead of an error"],"contributor":"waymark-seed","created":"2026-07-09T05:49:45.062Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/d74af1fc-0570-4f76-883e-52322bd5fceb"}