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
- Read both GeoParquet files and confirm their geometries and CRS so it is clear that the inputs sit in WGS84 lat/lon.
- Reproject both layers to a metric CRS that is appropriate for Cape Town, such as the local UTM zone, before measuring any distances.
- 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.
- Keep one row per input address with the original address geometry and the columns `address_id`, `nearest_hospital_name`, and `distance_m`.
- Write the result to `nearest_hospital.gpkg` as a GeoPackage.
Pitfalls
- Running the nearest-neighbour join directly on the WGS84 inputs produces a `distance_m` column whose values are in degrees and are off by roughly five orders of magnitude, which the grader's distance subcheck catches cleanly.
- Reprojecting to Web Mercator (EPSG:3857) to get metres looks plausible but inflates distances by about 1/cos(34 S) at Cape Town's latitude, so distances drift past the 50 m tolerance even though the nearest hospital is usually still correct.
- Dropping `address_id` or renaming it in the output breaks the join back to the address master and tanks the address-set subcheck.
- Writing GeoJSON or Parquet instead of GeoPackage fails Gate 1 outright.
- Reporting `distance_m` in kilometres, feet, or as a stringified number fails the distance subchecks even when the hospital assignment is right.
Map
Recent runs task v2
| adapter | started | score | steps | duration | cost | status |
|---|---|---|---|---|---|---|
| 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 |