Following https://docs.geoserver.org/latest/en/user/styling/sld/reference/rules.html I have been trying to tighten up our Geoserver by adding some MaxScaleDenominators such that fine detail isn’t rendered when viewing the whole country. I promptly realised it was working in QGIS but not in the web browser.
As best I can tell Cesium doesn’t support such for reasons outlined here - WMS layergroup issue
Does anyone have advice on softening the giant crippling query which may result from a user who might not realise the impact of their actions? I expect to be directed back toward Geoserver control flow. I see there is minimumLevel but I am not sure I would be using it as intended.
@Russell_Grew yes, the problem here is that, unless the camera is pointed straight down, there’s never going to be one single zoom level the map tiles should be loaded at.
If you pass maximumLevel: 5 and zoom in you can see the imagery stops resolving much earlier than omitting that. I’m not familiar with how GeoServer’s “MaxScaleDenominators” work though.Does using these min/max options not provide the expected behavior?
Following your helpful sandcastle example the goal is for the points to vanish when looking at the whole country, and only appear if one is sufficiently zoomed in. I don’t think I can accomplish this with maximum or minimum levels.
The motivation is to avoid rendering “heaps of points” as the process for this is likely resource intensive.
I did find some information about how different 2D software uses different conventions for zoom and scale. eg: https://youtu.be/jwMNKPUL2iw?t=1616 and the joys of going between them.
Using the link from the video the OSM WMS has features which are zoom dependent (roads, place names, etc). So I think my work needs to happen on the Geoserver side. I will explore this.
// Add a WMS imagery layer
var imageryLayers = viewer.imageryLayers;
imageryLayers.addImageryProvider(
new Cesium.WebMapServiceImageryProvider({
url:
"https://maps.geo-solutions.it/geoserver/osm/wms",
layers: "osm:osm",
parameters: {
transparent: true,
format: "image/png"
},
})
);
It turns out I can use MaxScaleDenominator as intended, with Cesium.
I inherited some layer styles and made some assumptions about when the layer visibility would trigger. These turned out to be false. The tip is to check the Scale in QGIS or similar to get a feel for when it should be activated.