[postgis-users] spatial distribution maps (heat maps?)

Stephen Woodbridge woodbri at swoodbridge.com
Mon Dec 5 16:52:09 PST 2011


On 12/5/2011 6:45 PM, Puneet Kishor wrote:
> I am looking to create some heatmap-ish or DEM-ish spatial
> distribution visualizations. Any suggestions on how to go about doing
> so given a lon-lat containing geom column in PostGIS?

Puneet,

Here is the logic I would use, but I have not played with the raster 
code at all so I'm not sure how to put this into SQL terms for you.

The idea is to have a sample dot like a sphere bright in the center and 
decreasing intensity as you move outwards, play with the radius for best 
results. maybe start with 9, 15, or 19 to start with.

Create an empty raster. Then select your points and for each points and 
for each one "add" the sample dot centered on your location to to the 
raster. By "add", I mean you need to add the value of the pixels in the 
dot to the pixels in the raster. So raster=1 + dot=3 => raster=4 and 
limit it at maximum saturation. This should work for multiple channels 
also. This should give you a heat map.

-Steve



More information about the postgis-users mailing list