TerriaJS / neii-viewer

Data viewer for National Environmental Information Infrastructure
http://neii.gov.au/viewer/
Apache License 2.0
8 stars 4 forks source link

WMS request: parameter name can be switched to upper case #143

Open martin-bom opened 4 years ago

martin-bom commented 4 years ago

Hi Ana,

https://github.com/TerriaJS/terriajs/issues/4223

Recently we tried to submit a WMS request to ALA Australia through Data Viewer but returned the following error: Missing valid BBOX parameter

The underlying request to ALA does have the parameter "bbox" but is in lowercase. May I know if there is a configuration in json which can convert the parameter name to uppercase? Thank you.

Regards, Martin

KeyboardSounds commented 4 years ago

Hi @martin-bom, Which WMS layer were you trying to access? Could you please give me the url?

martin-bom commented 4 years ago

Hi @KeyboardSounds Emma,

One of the URL I wanted to access was: https://biocache-ws.ala.org.au/ws/ogc/wms/reflect?srs=EPSG%3A3857&transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&styles=&tiled=true&feature_count=101&service=WMS&version=1.1.1&request=GetMap&layers=species%3AMacropus_rufogriseus&bbox=12523442.714243278%2C-5009377.085697312%2C15028131.257091936%2C-2504688.542848654&width=256&height=256

It returned with "Missing valid BBOX parameter" error.

But if I changed to: https://biocache-ws.ala.org.au/ws/ogc/wms/reflect?srs=EPSG%3A3857&transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&styles=&tiled=true&feature_count=101&service=WMS&version=1.1.1&request=GetMap&layers=species%3AMacropus_rufogriseus&BBOX=12523442.714243278%2C-5009377.085697312%2C15028131.257091936%2C-2504688.542848654&width=256&height=256

The image could be displayed successfully. Thank you.

Regards, Martin

nickdos commented 4 years ago

I'm not sure if this will help but I ran into this problem when I upgraded Leaflet to 1.4 (from 0.7.7) and the following code (from memory) was a work-around for the bug listed above.

https://github.com/AtlasOfLivingAustralia/regions/blob/master/grails-app/assets/javascripts/regions_page.js#L294-L313

Note the separation of params being sent via the URL (sldParam) and via Leaflet's params (layerParams) argument with the addition of Leaflet's uppercase: true option.

L.tileLayer.wms(config.spatialCacheUrl + sldParam, layerParams)

This will only help if TerriaJS is using LeafletJS code for WMS implementation...

KeyboardSounds commented 4 years ago

We do use Leaflet for 2D, but our primary renderer is Cesium. Super useful to know though!