1

I try to generate a density heatmap to display my points density but I don't know what to write in the weightAttr area of the tamplate furnished in the doc because I just have plenty of points but they don't have weight attribute.

I can generate it with QGIS but the sld export isn't available for heatmap.

I can also generate it using openlayers from geojson file but I have more than 1.000.000 points and it crashes.

I think it's better to use postgis and geoserver to generate wms to display so many points.

9
  • Have you tried just to drop the weightAttr? Otherwise for fast experimenting, add a double type attribute "foo" to your data and fill it with "1.00" for all the features.
    – user30184
    Sep 28, 2016 at 9:25
  • I try but geoserver crashes when I publish Sep 28, 2016 at 9:46
  • I have this message in a xml file when I try to preview the layer 'java.lang.RuntimeException: Unable to find function gs:Heatmap Unable to find function gs:Heatmap' Sep 28, 2016 at 9:55
  • should I add a jar to my libraries? Sep 28, 2016 at 9:58
  • I would try to follow the document. Did you install WPS docs.geoserver.org/stable/en/user/services/wps/…?
    – user30184
    Sep 28, 2016 at 10:21

1 Answer 1

0

I found a way to display my heatmap without any lag!

1) Copy the project (index.html) in a new folder in geoserver directory to allow web browser to catch wfs from geoserver (if you dont do that you'll have a 'cross origin' error message in the console).

ex: /usr/share/geoserver/webapps/map/indexhtml

2) I used geojson wfs of geoserver in openlayers

var heatmap = new ol.layer.Heatmap({
        source: new ol.source.Vector({
             projection : 'EPSG:4326',
             url: 'http://localhost:8080/geoserver/robot/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=YOUR_WORKSPACE:YOUR_LAYER&maxFeatures=NUMBER OF FEATURE YOU WANT TO LOAD&outputFormat=application%2Fjson',
             format: new ol.format.GeoJSON()
          }),
                         opacity: 0.6,
                 radius: 15,
             });

It works but I'm not sure of the reliability of the heatmap because I don't know how geoserver selects points.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.