3

I just try to visualize some points using GeoServer to publish them as WMS and bind this WMS to my Openlayers website using the GeoServer internal Heatmap process to visualize it. I don't want to use the Openlayers Heatmap function.

But there seem to be some problems, look here:

enter image description here

I'm using this Openlayers implementation to bind my WMS URL:

https://openlayers.org/en/latest/examples/wms-tiled.html

Changing the params to:

params: {'LAYERS': 'test:points','TILED': true,'STYLES': 'heatmap'},

And using this as SLD to define the Heatmap:

http://docs.geoserver.org/stable/en/user/styling/sld/extensions/rendering-transform.html

Any ideas why this happens?

2

When you make a tiled WMS request each request is a completely separate request, GeoServer has no idea of the others (in fact with a load balancer they could go to different machines). So when you ask for a tiled heat map it takes just the points in the area of the tile and makes a heat map of them. Obviously this doesn't work.

TL;DR; Solution: don't use tiles for heatmaps.

  • While it is possible to load single tiles with Openlayers, by default this is not possible using Leaflet. But I found an implementation to do this: github.com/ptv-logistics/Leaflet.NonTiledLayer . Just in case somebody needs to know. Thanks for clarifying. – Andrej Jun 21 '17 at 9:20
0

If you can pass Date.now() as a WMS parameter, you can avoid this as none of the tiles will be cached - it will generate a new tile request every time.

Example below is for Leaflet - i'm not sure if it can be done in Openlayers.

var wms = L.tileLayer.wms("http://server:8080/geoserver/wms", 
{
    layers: layer,
    format: 'image/png',
    transparent: true,
    no_cache_plz: Date.now()

}).addTo(map);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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