Skip to end of metadata
Go to start of metadata

See Wikipedia heatmap definition

GeoServer uses SLD to invoke the heatmap rendering transformation on a featuretype with point geometries and an attribute population supplying the weight for the points.

The output is styled using a color ramp across the range or values in the output raster [0 .. 1].

SLD: - simply insert the attribute name to use for the values - here, POP2010. 

This style is named AFREEMAN.TOWNSSURVEY_CTR_PT::Heatmap_POP2010

Request:

 http://giswebservices.massgis.state.ma.us/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=massgis:GISDATA.TOWNSSURVEY_POLYM,massgis:AFREEMAN.TOWNSSURVEY_CTR_PT&styles=,AFREEMAN.TOWNSSURVEY_CTR_PT::Heatmap_POP2010&BBOX=-25257,736552,402626,995132&WIDTH=786&HEIGHT=475&srs=EPSG:26986&format=image/png

Response:

Towns with higher 2010 population have more red.

Adjustments can be made to parameters in the SLD.  If radiusPixels value of 10 instead of 100 is used the map changes:

Radius controls the “spread” of the heatmap around each point.

               <ogc:Function name="parameter">
                 <ogc:Literal>radiusPixels</ogc:Literal>
                 <ogc:Function name="env">
                   <ogc:Literal>radius</ogc:Literal>
                   <ogc:Literal>10</ogc:Literal>
                 </ogc:Function>

 

In the SLD the pixelsPerCell parameter controls the resolution at which the heatmap raster is computed.