#16330 closed defect (fixed)
Unable to define WMS endpoint with key
Reported by: | nkamapper | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 18.06 |
Component: | Core imagery | Version: | |
Keywords: | Cc: |
Description
What is the correct way of entering the WMS endpoint for the following service?
waapi.webatlas.no/wms-orto-hist?api_key=<key>
The <key> is the same as in Maps/Norway#NorwayOrthophoto (I am avoiding to write it here).
JOSM will prompt with the menu of layers but will not render the selected layer.
(If one layer is chosen instead of endpoint, the "?" and the key is missing from the generated wms url).
Here is a tested and functional example for one of the layers (Oslo area):
http://waapi.webatlas.no/wms-orto-hist?api_key=<key>&FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=Oslo-1937&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}
The wms service contains hundreds of historic orthophotos and maps for Norway. Oslo entries are found under "Historiske ortofoto"->"Eldre orto Akershus".
I have been told that the key could alternatively be given as either 1) a HTTP request header with the name "X-WAAPI-TOKEN", or 2) as password in a Basic authentication (random user name, for example "osm"). I have not been able to make them work - not sure how to do it.
Attachments (0)
Change History (8)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Thank you for this input.
I have made a new entry here using the custom-http-header: Maps/Norway#NorwayOrthophotohistoric
There are a couple of problems:
1) JOSM fails to load the layers (the menu window) with this method. Also in the "Add Imagery URL" window in JOSM, the "3. Get layers" button does not seem to use the custom headers information in section 5 of that window when loading the layers.
2) When expanding the "2. Enter GetCapabilitites URL" to include the api_key, the layers will get loaded, but after selecting a layer the generated URL contains a "/" instead of a "?", resulting in errors. This also happens when the wms endpoint has been ticked.
http://waapi.webatlas.no/wms-orto-hist/FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=Oslo-1937&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}
I have also tried basic authentication, however JOSM produces the same problems.
comment:4 by , 6 years ago
Milestone: | → 18.06 |
---|
comment:7 by , 6 years ago
Unfortunately, certain wms endpoints now get two question marks, for example:
https://wms.geonorge.no/skwms1/wms.friluftsruter2??FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=Fotrute&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}
comment:8 by , 6 years ago
Indeed, I introduced this regression. This was fixed yesterday in [13883]
URL's for downloading tiles are generated from get capabilities document and I guess that they do not contain api_key and that would bend the WMS standard a bit.
The easiest way, that's already supported is to use custom header X-WAAPI-TOKEN. In imagery definition provide:
And that should work. If you enable advanced mode in preferences you will also have ability to set this header when adding WMS layer, though then - it will work only for you.
You can also use HTTP basic authentication. You need to base64 encode following string
osm:<key>
(if you would like to set the user toosm
). You can use for example https://www.base64encode.org/ then you need to set custom HTTP header: