CesiumWMSRasterOverlay missing request parameters

Hi,

According to Table 8 in the OpenGIS® Web Map Server Implementation Specification, there are many request parameters of a GetMap request as follows.

However, as Cesium for Unreal: UCesiumWebMapServiceRasterOverlay Class Reference shows, users are only allowed to set the BaseUrl and Layers in CesiumWebMapServiceRasterOverlay, with no way to set other parameters, whether mandatory or optional, such as STYLES,CRS,BBOX,etc.

I tried adding some parameters to the BaseUrl, but it didn’t work.

For example, the URL to access an imagery is as follows:

https://data.nsmc.org.cn/NSMCAPI/v1/nsmc/image/wms/compose?layers=FY3D_MERSI&datetime=20251117&request=GetMap&bbox=50,20,80,44&width=1000&height=800&version=1.3.0&format=jpg

The imagery can be successfully accessed in a browser with the URL, but how can it be successfully accessed by CesiumWebMapServiceRasterOverlay?

Any help or explanation is appreciated.

Hi @pjiang9,

I would expect adding the extra parameters to the Base URL would work well. What happened when you tried that?

Hi, Kevin,

When I tried adding additional parameters to the Base URL using the example above, no matter how I added them, the output log of Unreal always said:[error] [RasterOverlay.cpp:127] Could not parse web map service XML.

Then I thought of using a simpler example for testing, where only one parameter, Styles, needed to be set. I used GeoServer for this. In GeoServer, I applied two Styles on the same layer, GEBCO:oceans and GEBCO:oceans2, the first one being the default style.

Accessing the layer with first Style,GEBCO:oceans, in a browser looks like this.

Accessing the layer with second Style ,GEBCO:oceans2,in a browser looks like this.

In Cesium for Unreal, I set CesiumWebMapServiceRasterOverlay this way and the access was successful. it was the default style.

On this basis, I only added one parameter to the Base URL, that is “styles=GEBCO:oceans2”.The base URL now was like this: http://localhost:8080/geoserver/GEBCO/wms?styles=GEBCO:oceans2

Access failed, the output log of Unreal as follows:

- Image not of any known type, or corrupt

- Image url: http://localhost:8080/geoserver/GEBCO/wms?styles=GEBCO:oceans2&request=GetMap&TRANSPARENT=TRUE&version=1.3.0&service=WMS&format=image%2Fpng&styles=&width=256&height=256&bbox=-90.000000,-180.000000,90.000000,0.000000&layers=ClippedtoOceans&crs=EPSG:4326

You can see that there are two styles appearing in the URL. The first one was added by me, which is styles=GEBCO: oceans2, but there is another style after it with empty value.

This simple situation makes me feel that CesiumWebMapServiceRasterOverlay does have some issue.

Yes, you’re right, that’s a bug. As you observed, it’s adding styles= even if that query parameter already exists in the URL. You should be able to add other query parameters using this technique, though. Just not the required ones that Cesium for Unreal adds itself.

I wrote an issue for the problem here:

I think the fix should be relatively straightforward. If you’re up for fixing it yourself, we would welcome a cesium-native pull request!

1 Like

Kevin,

Thank you for your reply and confirmation. I really wish I could bring up a Pull Request for it, yet I’m not familiar with the source code :sweat_smile: .

This should be a simple fix, I can take a crack at it later today. One note, though - bbox and crs parameters will have to continue to be overwritten. The bbox parameter is used by the raster overlay to define the area it’s requesting every time it loads a tile. So, if you’re trying to look for the region (50, 20) to (80, 44), you’d want to move your georeference to that position and it will automatically load the right tile. For crs, Cesium Native (which Cesium for Unreal uses behind the scenes) doesn’t currently have support for transforming between different coordinate systems, so we have to always request EPSG:4326 or we won’t be able to properly handle what it returns.

1 Like

Submitted a pull request with a fix: Don't overwrite `styles` parameter of `WebMapServiceRasterOverlay` by azrogers · Pull Request #1286 · CesiumGS/cesium-native · GitHub

1 Like

Ashley,

Thank you so much for your explanation and fix!