Id: Custom Image Layer WMS does not resolve the {vars}

Created on 6 Oct 2020  Â·  7Comments  Â·  Source: openstreetmap/iD

Testcase:

  1. Open https://www.openstreetmap.org/edit#map=17/52.50676/13.42419
  2. Choose image layer "berlin areal images 2015" => it works – this is TMS
  3. Choose image layer "berlin areal images 2011" => it works – this is WMS, see https://github.com/osmlab/editor-layer-index/blob/master/sources/europe/de/Berlinaerialphotograph2011.geojson
  4. Chosse custom image layer with the wms-URL from the editor layer index
    https://fbinter.stadt-berlin.de/fb/wms/senstadt/k_luftbild2011_20?LAYERS=0&STYLES=default&FORMAT=image/png&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap
    => It does not work, the console shows

Request URL: https://fbinter.stadt-berlin.de/fb/wms/senstadt/k_luftbild2011_20?LAYERS=0&STYLES=default&FORMAT=image/png&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap
Request Method: GET
Status Code: 400

JS Error says:

k_luftbild2011_20:1 GET https://fbinter.stadt-berlin.de/fb/wms/senstadt/k_luftbild2011_20?LAYERS=0&STYLES=default&FORMAT=image/png&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap 400

Same for this URL https://isk.geobasis-bb.de/mapproxy/dgm/service/wms?FORMAT=image/jpeg&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=dgm&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}, but with an error 500.

It looks like, the variables are not replaced in the URL.

bug-cant-reproduce

All 7 comments

I looked into this some more. The error changed since I reported it. The {vars} are now replaced (again).

Nevertheless, there seems to be a problem with the projection. I will open another Issue for this, since its a different problem.

@tordans Did you test both times on osm.org? We haven't changed anything there within that time frame so I'm not sure why this wouldn't work sometimes.

I looked at it again @quincylvania and you are right, I might have been looking at the different versions.

This does work:
https://www.openstreetmap.org/edit#background=custom:https://isk.geobasis-bb.de/ows/dop20c_wms%3FFORMAT%3Dimage/png%26TRANSPARENT%3DTRUE%26VERSION%3D1.1.1%26SERVICE%3DWMS%26REQUEST%3DGetMap%26LAYERS%3Dbebb_dop20c%26STYLES%3D%26SRS%3D{proj}%26WIDTH%3D{width}%26HEIGHT%3D{height}%26BBOX%3D{bbox}&disable_features=boundaries&map=18.60/52.41051/12.54939

This does _not_ work:
https://ideditor.netlify.app/#background=custom:https://isk.geobasis-bb.de/ows/dop20c_wms%3FFORMAT%3Dimage/png%26TRANSPARENT%3DTRUE%26VERSION%3D1.1.1%26SERVICE%3DWMS%26REQUEST%3DGetMap%26LAYERS%3Dbebb_dop20c%26STYLES%3D%26SRS%3D{proj}%26WIDTH%3D{width}%26HEIGHT%3D{height}%26BBOX%3D{bbox}&disable_features=boundaries&map=18.60/52.41051/12.54939

Error:

GET https://isk.geobasis-bb.de/ows/dop20c_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=bebb_dop20c&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox} 500 (Internal Server Error)

@tordans I just checked both links and they appear to be working fine in Chrome, Firefox, and Safari, so I'm not sure what the issue is.

@quincylvania you are right, the error does not show up for anymore :-/. Will reopen once I have ne info …

I'm having something similar to this. I'm not sure if I should open this or open my own ticket, but I figured I'd try here first and see if it's the right place. I _think_ the problem is when I switch from a custom layer that uses {zoom}/{y}/{x} to one that uses {bbox} and or switch back. And then it works after a reload, so it feels inconsistent.

Browser: Vivaldi 3.5.2115.81 (based on Chromium 87) on Linux Lubuntu 20.04
Using openstreetmap.org default editor.

Here are steps that seem to consistently reproduce the problem for me:

  1. Go edit somewhere in Massachusetts USA (that's just where the imagery I'm using is from)
  2. In the background settings, go to Custom, and add this URL: https://tiles.arcgis.com/tiles/hGdibHYSPO59RG1h/arcgis/rest/services/MassGISBasemap/MapServer/tile/{zoom}/{y}/{x}
  3. Map renders fine with this Basemap background.
  4. In the background setting, go to Custom, and change this URL to this: https://gisprpxy.itd.state.ma.us/arcgisserver/rest/services/AGOL/Massachusetts_Water_Features/MapServer/export?bbox={bbox}&size={width},{height}&format=svg&f=image
  5. The background doesn't render and is just black. In the Developer Tools Network tab I can see that the URLs that it's requesting don't have the variables replaced.
  6. Refresh the page.
  7. In the background setting, go to Custom, and though the URL is the same one that didn't render before, it renders now (showing streams and lakes).
  8. Change the background back to the URL in step 2.
  9. Now this background doesn't render, and it's similarly trying to load the URL without replacing the variables.

Switching between different {zoom}/{y}/{x} based layers seems to work, and switching between different {bbox} based ones seems to work, but switching between the types seems to break the variable substitution until I refresh the page.

but switching between the types seems to break the variable substitution until I refresh the page.

That would actually explain why I could not figure out my issue above :-). Its even harder to debug / understand since https://github.com/openstreetmap/iD/issues/8114 prevents the preservation of the currently selected layer on relaod. So to make the description complete, I would add

but switching between the types seems to break the variable substitution until I refresh the page and re-select the custom background (which still holds the previous input).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bhousel picture bhousel  Â·  19Comments

ghost picture ghost  Â·  20Comments

bhousel picture bhousel  Â·  19Comments

skylerbunny picture skylerbunny  Â·  22Comments

oskarlin picture oskarlin  Â·  21Comments