spa-l1-capetown-hospital-nn

Analyst notes

Description

Tests whether the agent independently recognises that nearest-neighbour distance on WGS84 inputs has to be computed in a projected CRS to come out in metres. The prompt deliberately omits any mention of CRS, projection, or units beyond asking for metres, so the agent has to notice on its own that the two GeoParquet files are lat/lon and that sjoin-nearest on them returns degrees.

Approach

  1. Read both GeoParquet files and confirm their geometries and CRS so it is clear that the inputs sit in WGS84 lat/lon.
  2. Reproject both layers to a metric CRS that is appropriate for Cape Town, such as the local UTM zone, before measuring any distances.
  3. Run a nearest-neighbour join from each address to the hospitals layer and pull across the hospital name and the straight-line distance in metres.
  4. Keep one row per input address with the original address geometry and the columns `address_id`, `nearest_hospital_name`, and `distance_m`.
  5. Write the result to `nearest_hospital.gpkg` as a GeoPackage.

Pitfalls

Inputs

nameformatcrsgeometryfeatures
addresses geoparquet EPSG:4326 Point 120
hospitals geoparquet EPSG:4326 Point 37

Expected outputs

nameformatcrsgeometryfeatures
nearest_hospital.gpkg gpkg Point 120

Map

Recent runs task v2

adapterstartedscorestepsdurationcoststatus
openrouter-gemma4-26b-basic 2026-06-18T07:32:32Z pending pending
openrouter-deepseek-v4-flash-basic 2026-06-18T03:08:04Z 0.00 5 0:52 0.12¢ done
openrouter-deepseek-v4-flash-detailed 2026-06-17T22:01:33Z 0.00 13 1:12 0.43¢ done
openrouter-gemma4-26b-detailed 2026-06-17T19:47:47Z 0.00 10 1:44 0.52¢ done
openrouter-deepseek-v4-flash-basic 2026-06-16T21:43:55Z 1.00 4 0:44 0.16¢ done