fastest query for admin content
✓ Published0🌍 Public
Aandrewxhill
Last edited Feb 3, 2012
Created on Feb 3, 2012
This example maps administrative regions in Indonesia, showing the total incremental value per region as a ranked bar chart ordered from highest to lowest. It first computes each region’s centroid and bounding box from the `admin1_attributes_live` table using PostGIS functions like `ST_Centroid`, `ST_Envelope`, and `ST_AsGeoJSON`. It then joins these geometries with the `global_4x_grid` table on matching region IDs, summing `total_incr` for each province. The final output pairs each region’s name and ID with its aggregated total, ready for geographic or tabular visualization.
AI-generated description