{"id":"aggregate_to_chap_csv","summary":"Aggregate a GeoZarr dataset to DHIS2 org units and export CHAP CSV","description":"Org-unit aggregation workflow that exports CHAP-ready wide CSV. Loads a published GeoZarr dataset over a time range, spatially aggregates its variable(s) within each GeoJSON feature (e.g. a DHIS2 organisation unit) using the chosen method, and writes one row per location-period with columns `time_period`, `location`, and one column per variable.\n\nEach feature's GeoJSON `id` becomes the `location`, each time step becomes `time_period` (formatted according to `period_type`). Aggregation is at the dataset's native temporal resolution, so set `period_type` to match it (e.g. `month` for a monthly dataset). This is the same pipeline as `aggregate_to_dhis2_json` but emits CHAP CSV instead of DHIS2 JSON.\n\nUsage — call this process as the result of a process graph:\n\n{\n  \"agg\": {\n    \"process_id\": \"aggregate_to_chap_csv\",\n    \"arguments\": {\n      \"dataset_id\": \"era5land_precipitation_monthly\",\n      \"temporal_extent\": [\"2025-01-01\", \"2025-12-31\"],\n      \"geometries\": { \"type\": \"FeatureCollection\", \"features\": [ ... ] },\n      \"method\": \"mean\",\n      \"period_type\": \"month\"\n    },\n    \"result\": true\n  }\n}","parameters":[{"name":"dataset_id","description":"ID of the published GeoZarr collection to aggregate (as listed under /datasets).","schema":{"type":"string"}},{"name":"temporal_extent","description":"Time range to load as [start, end] ISO-8601 date strings.","schema":{"type":"array","subtype":"temporal-interval"}},{"name":"geometries","description":"GeoJSON FeatureCollection of organisation units. Each feature's `id` becomes the CSV `location`.","schema":{"type":"object","subtype":"geojson"}},{"name":"method","description":"Spatial aggregation method applied to the pixels within each org unit: mean (default), min, max, sum, or median.","schema":{"type":"string","enum":["mean","min","max","sum","median"]},"default":"mean"},{"name":"period_type","description":"Period type used to format each time step as `time_period` (day, week, month, quarter, year). Should match the dataset's native temporal resolution.","schema":{"type":"string"},"default":"month"}],"returns":null,"process_graph":{"load":{"process_id":"load_collection","arguments":{"id":{"from_parameter":"dataset_id"},"temporal_extent":{"from_parameter":"temporal_extent"}}},"zonal":{"process_id":"aggregate_spatial","arguments":{"data":{"from_node":"load"},"geometries":{"from_parameter":"geometries"},"reducer":{"process_graph":{"reduce":{"process_id":"reduce_by_method","arguments":{"data":{"from_parameter":"data"},"method":{"from_parameter":"method"}},"result":true}}}}},"save":{"process_id":"save_result","arguments":{"data":{"from_node":"zonal"},"format":"CHAPCSV","options":{"location_field":"geometry","period_type":{"from_parameter":"period_type"}}},"result":true}},"links":[]}