0

I have a raster hosted on GeoServer as a WMS that has 10 km resolution and is bilinearly interpolated to look smooth around the edges as such:

Raster image with smooth edges

I am using Leaflet to make a js map with this raster data in the following way.

var heatwave = L.tileLayer.wms(wms_url, {
  attribution: '',
    layers: "Heatwave",
    format: 'image/png',
    transparent: true,
    zIndex: 100,
    opacity: .8,
}).addTo(map);

I have changed the interpolation method to "bilinear" in both the layer configuration and the WMS settings on my GeoServer, but the leaflet map still shows the raster looking as if it's nearest neighbor.

I've checked the docs and cannot find an argument to change interpolation method. Does anyone know how to make the leaflet map look bilinearly interpolated?

enter image description here

UPDATE

I have found that upon zooming the leaflet map, the raster does appear to be bilinearly interpolated. This happens when zoomed into at least zoom level 8, zooms 0-7 still appear to be using Nearest Neighbor.

UPDATE 2

It's getting a little weirder. At certain zoom levels, the data appears to be half bilinear/half nearest neighbor. Maybe it's some sort of bug?

enter image description here

4
  • could be a browser cache issue – Ian Turton Jul 22 at 8:52
  • @IanTurton I have tried resetting the cache, as well as looking at the map in different browsers to no avail – JWB Jul 22 at 14:09
  • Are you using some kind of heatmap plugin on the Leaflet side? If not, I don't this is a Leaflet problem - it will simply display whatever images Geoserver serves up. Is there a tile cache on the server side that needs to be cleared out? Can you post a direct link to one or more of the tiles? – toms Jul 22 at 21:36
  • @toms that fixed it thank you! I went to the layer in geoserver and changed the Tile Caching setting to not be enabled for the layer. Thank you!! – JWB Jul 23 at 14:12

Your Answer

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

Browse other questions tagged or ask your own question.