{"version":"1.0","type":"rich","title":"Rasters to polygons for CartoDB","description":"A PostGIS workflow converts nightly satellite raster data into vector polygons for display in CartoDB. The SQL first uses `ST_MapAlgebraExpr` to reclassify raster band values into discrete categories, then `ST_DumpAsPolygons` extracts each distinct value region as a geometry, wrapping results with `ST_MakeValid` and `ST_Multi`. The resulting polygons, along with their original raster values, are inserted into a new `light_polygons` table with a `band` column, enabling efficient cartographic rendering of classified light intensity zones.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-3701439?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}