dc-l1-bangkok-attribute-coercion
Analyst notes
Description
Tests whether the agent recognises an attribute-type problem in a malformed vendor GeoJSON: every numeric column arrives as a JSON string, so client-side parseFloat in the dashboard silently returns NaN. The prompt deliberately names the symptom (NaN averages) instead of the operation (type coercion), the affected columns, or the int-versus-float split, so the agent has to inspect the file and work out what the defect is on its own.
Approach
- Open the input GeoJSON and inspect a few features to see how each property is encoded.
- Notice that every numeric column is serialised as a JSON string and that the dashboard's parseFloat fails on those.
- Decide which fields are integer identifiers and which are floating-point measurements based on what the values look like.
- Rewrite every numeric property as a proper JSON number, keeping the station_id as an integer and the measurement columns as floats.
- Leave the Thai-script name field, any other string columns, and the point geometry untouched, and write the result back as GeoJSON.
Pitfalls
- Reading the file with GeoPandas and writing it straight back does not fix the defect, because the GeoJSON driver re-emits the object-typed columns as strings and the dashboard keeps producing NaN.
- Coercing the three measurement columns to float but leaving station_id alone is the most common partial fix, and it leaves the identifier column as a string which the grader treats as a clear miss.
- Casting station_id through float on the way to int turns the identifiers into 1.0, 2.0, ... and the JSON type subcheck for integers fails.
- Round-tripping the file through a non-UTF-8 stage like Shapefile or KML corrupts the Thai name_th values into question marks or mojibake.
- Reprojecting the points to a metric CRS to clean them up shifts every coordinate and changes the output CRS away from WGS84, even though the task is purely about attribute types.
- Dropping one of the required columns (station_id, name_th, sensor_value, pm25_ug_m3, elevation_m) on the way out fails Gate 1 outright.
Map
Recent runs task v3
| 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:42 | 0.62¢ | done |
| openrouter-deepseek-v4-flash-detailed | 2026-06-17T22:01:33Z | 0.00 | 7 | 0:50 | 0.22¢ | done |
| openrouter-gemma4-26b-detailed | 2026-06-17T19:47:47Z | 0.00 | 13 | 0:38 | 0.55¢ | done |
| openrouter-deepseek-v4-flash-basic | 2026-06-16T21:43:55Z | 0.84 | 7 | 1:17 | 0.55¢ | done |