{"version":"1.0","type":"rich","title":"Create a density grid from geometries. For use in CartoDB","description":"This example creates a density grid from point geometries using PostGIS and CartoDB, aggregating points into square cells via `ST_SnapToGrid` and returning cell envelopes with an associated value. It shows both a simple count of points per cell and a version that applies aggregation methods like MAX, MIN, SUM, or AVG to a specified numeric column, such as restaurant ratings or view counts. The functions generate a `CDB_DensityGridPair` type with geometry and float value, enabling thematic mapping of spatial density. An example query uses the grid to visualize cuisine ratings across New York restaurants.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-2115041?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}