2

We started to work with GeoServer a few months ago.

We encountered a problem that we cannot answer, linked to the interaction with GeoServer and SLD service plugin.

As follows a simplified architecture of our system:

enter image description here

As summarised in the previous figure, we created a mosaic image connected to a postgis database table. The table contains the list of the image paths. The images are saved in a file system folder and it is in geotiff format.

The choice of mosaic image input is due to having a parametric image and unique layer. The same reason find in this link:Using multiple tiff files as a data store in Geoserver After that we enabled wms API and with the sld service used to return legend and style (default style). The APIs ate called in the following order:

We start with a request of legend and style of an image (via sld service):

http://****/geoserver/rest/sldservice/farm:raster/classify.xml?
continuous=false&
endColor=0xff0000&
env=our_custom_param
&fullSLD=true
&intervals=6
&method=jenks
&midColor=0xffff00
&percentages=true
&ramp=custom
&reverse=false
&startColor=0x00ff00
&strokeWeight=-1
&viewparams=our_custom_param

After that we ask the image as follows (via wms):

https://***/geoserver/farm/wms?
service=WMS&
request=GetMap&
layers=our_layer_name
styles=&
format=image%2Fpng8&
transparent=true&
version=1.1.1&
env=our_custom_param
&sld=our_sdl_path
&timestamp=1658500340994
&id=id%3D379973%26colorRamp%3DgreenYellowRed%26invertedRamp%3Dtrue%26numberOfClasses%3D6
&width=1024
&height=1024
&srs=EPSG%3A3857
&bbox=980839.9469553819,5598859.447832593,982062.9394079447,5600082.440285156

The use case so described works as expected.

In particular kinds of use cases, we need that the image contains more precise information. For this reason, we introduced a feature that modifies the pixel size of the image saved on the file system, the same one accessed by the GeoServer a via WMS/layer.

We noticed that this approach produced the following problem, we have shown the image from the client but the same results are obtained via curl (to exclude problems in the FE):

enter image description here

We investigated what could be the source of the problem and if:

  • we remove the cache from Geoserver from client “About & Status” -> Server Status -> Resource Cache -> Clear the image returns from wms will be shown as expected. So we removed all cache levels to check who is responsible for this behaviour: GeoWebCache Style cache Browser cache But this didn’t resolve the problem.
  • We have created a new layer cloned from the existing and if we call via wms the new, it will return the correct image.

We suspicious could be about SLD service because if we remove the jar from GeoServer the image work properly as expected.

To summarize, the questions are: If it is feasible, what is the best way to manage the image mosaic when the features of image change? If the problem is a particular kind of cache is it possible to invalidate it?

Ian Turton
  • 81,417
  • 6
  • 84
  • 185
Jonathan
  • 21
  • 1

0 Answers0