Exporting data¶
Both exports are available from the dashboard's Export row and from the API directly. Both require a signed-in session.
CSV¶
GET /api/export/<wrua> returns every reallocation row for one WRUA, one row per
sub-watershed per month, as SWAG_DSS_<wrua>_data.csv. The source column names
are unchanged, 34 columns in all:
| Group | Columns |
|---|---|
| Identity | month, WRUA_NAME, band_id, hydro_uid, wrua_id, Subbasin, next_hydro_id |
| Terrain | elev_min, elev_max, elev_median, slope_median |
| Cropland area (ha) | area_deficit_ha, area_optimal_ha, area_surplus_ha |
| Volumes (Mm³) | vol_surplus_Mm3, vol_deficit_net_Mm3, vol_deficit_gross_Mm3 |
| Efficiencies | Ec, Ea, E |
| Reallocation flows (Mm³) | inflow_surplus_Mm3, total_available_Mm3, deficit_met_gross_Mm3, unmet_deficit_gross_Mm3, deficit_met_net_Mm3, unmet_deficit_net_Mm3, surplus_transferred_down_Mm3 |
| Reallocation outcome | local_realloc_ok, reallocation_efficiency, residual_dependence, reduction_Mm3, reallocation_score, realloc_class |
| Unused | wrua_set |
band_id is the sub-watershed polygon identifier and equals the source
GeoPackage's hydro_id. It is unique within a WRUA, not across the study area,
so join on the pair (WRUA_NAME, band_id).
Two column pairs are easy to confuse:
vol_deficit_net_Mm3is what the crop needs at the field gate.vol_deficit_gross_Mm3is what has to be abstracted at the intake, which is the net figure divided byE. The dashboard and the map use the gross figure.wrua_setcarries no meaning in the served model and can be ignored.
PDF report¶
GET /api/report/<wrua> renders a 10-page IWMI-branded PDF, a few megabytes,
most of it the rendered maps. The filename states the scope, for example
SWAG_DSS_Report_Burguret_annual_all_scenarios.pdf.
Sections:
- Cover: WRUA name, area, sub-watershed count, elevation range, sub-basin, and the scope the document actually covers
- Introduction
- Methodology, the three scenarios
- WRUA assessment, with two maps rendered for this selection
- Monthly water balance table, all twelve months, in m³
- Intervention requirements, including the priority sites table
- Scenario comparison
- Conclusions and recommendations
- Data sources
The Priority Sites table lists every sub-watershed that needs at least one pond, largest peak monthly deficit first, in six columns: Watershed (WS id), Elev (m), Deficit (m³), Ponds, Built, Priority. For a large WRUA the table runs over several pages, with the header repeated on each.
?band=<band_id> scopes every figure in the document to a single sub-watershed
of that WRUA, and the filename says so. ?scenario= and ?month= are accepted
and ignored: the document is inherently annual and compares all three scenarios,
so filtering to one month would empty the monthly table and filtering to one
scenario would gut the comparison. The cover states the real basis rather than
whatever was passed.
Every number in the PDF is computed by the same code that serves
/api/compare/<wrua>, so the report and the dashboard cannot disagree.