CesiumGS / cesium-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WMS Raster Overlays missing from some tiles when zoomed out

corybarr opened this issue · comments

This issue can be reproduced in Omniverse or Unreal.

When zooming out, WmsRasterOverlay imagery disappears from tiles seemingly with an origin beyond some distance threshold.

Omniverse vid: https://github.com/CesiumGS/cesium-native/assets/1040194/5b35c90b-47aa-4458-8e9d-8bf671c9b29c

Screenshot of the same settings in Unreal: image

Here are the settings to reproduce in Unreal:

image

CesiumWebMapServiceRasterOverlay settings:

image

@kring mentioned "It's common for WMS servers to return blank tiles when zoomed out too far." The "bug" label might be incorrect. It would be a product decision to add support for UI notification via GetCapabilities (as @kring mentioned Terria does) or leave as is.

Yeah this is unfortunately intentional (if infuriating) behavior from the server. If you look at the server's GetCapabilities:
https://mapprod3.environment.nsw.gov.au/arcgis/services/Planning/EPI_Primary_Planning_Layers/MapServer/WMSServer?service=WMS&request=GetCapabilities
You'll see it has properties like this:

<MaxScaleDenominator>472470.238095</MaxScaleDenominator>

In the WMS 1.3.0 spec (https://www.ogc.org/standard/wms/) section 7.2.4.6.9, it says:

Upon receiving a request for a map that is not within the scale denominator range, the server may return a blank map, or may return a portrayal of the Layer that is crowded with features or otherwise poorly suited for display; the server shall not respond with a service exception.

So when the scale of the map is deemed to be more zoomed out than 1:472470.238095, it will return blank images. Annoying but true. People running servers configure them to do this for one of two reasons:

  1. Because this layer is meant to be shown alongside other layers, and they think it would add too much clutter when zoomed out, so they turn it off, or
  2. Rendering the large numberf of features when zoomed out would put a lot of load on the server, so they simply tell the server not to do it. Remember that most WMS servers render maps on demand by querying features from a geodatabase and rasterizing them according to styling rules. When zoomed out, there can be a huge number of features included in the tile.

Long story short, this is working as expected. Pretty much the best we can do is inform the user that it's happening so they're somewhat less likely to wonder why their map isn't showing up. But to do that, we'd have to know about the MaxScaleDenominator, which would require actually querying the GetCapabilities and doing the computation to turn that map scale into something meaningful in our raster-images-mapped-to-3D-Tiles world. Currently, like CesiumJS, cesium-native doesn't look at the GetCapabilities at all.