This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Use a custom OGC WMTS as background imagery (on ID)

0

Hi,

I'd like to be able to use a custom WMTS (served through a dockerized QGIS server; https://hub.docker.com/r/camptocamp/qgis-server) as background aerial imagery on the ID editor.

When I try to set this up, the example given is like that:

Example : https://{switch:a,b,c}.tile.openstreetmap.org/{zoom}/{x}/{y}.png

But this doesn't look like a WMTS URL.

This is the plain http (no https) URL I actually have for a random tile:

http://baseurl/?SERVICE=WMTS&VERSION=1.3.0&REQUEST=GetTile&LAYER=my_custom_layer&STYLE=default&TileMatrixSet=EPSG:3857&TileMatrix=17&TileRow=45220&TileCol=65950&format=image/png

How can I use it?

I already tried to replace the values of TileMatrix, TileRow and TileCol by {z}, {y} and {x} but it doesn't work (I also cannot see any requests arriving on the tile server).

Notice;
the URL is working perfectly well in a web browser (Fig. 1) and in JOSM.

tile sample

Fig. 1: A tile sample when I browse the previous given URL using Firefox 78.0.1 (64-bit).

Thanks.

asked 03 Jul '20, 17:28

s-k's gravatar image

s-k
466710
accept rate: 0%

edited 05 Jul '20, 13:10

1

Do the values of "TileMatrix=", "TileCol=" and "TileRow=" correspond to {zoom},{x} and {y}?

(03 Jul '20, 18:47) InsertUser

Yes, I think it is standardized by the OGC; I've look at the tiles numbers for some regions and it's matching the OSM tiling scheme. I also tried to replace these values in my long WMTS URL but it doesn't work.

(04 Jul '20, 19:23) s-k

Indeed;

sample

In Firefox 78.0.1 (64-bit).

And I see the same when using JOSM. (But JOSM uses the GetCapabilities to let the user chose the layer before displaying it. Maybe ID should do the same?)

(05 Jul '20, 08:34) s-k
1

Do you use the WMTS host through SSL (https) or plain HTTP?

(05 Jul '20, 11:20) Spiekerooger

standard http, as in the URL given in the main post.

(05 Jul '20, 12:53) s-k
1

So your browser may not show the tiles as of a mixed content warning. See for any errors in the dev console of your browser.

(05 Jul '20, 14:30) Spiekerooger

Oh,..! Actually ID itself is trying, by default, to get the tile using https, that's why it doesn't work. Any idea if I can switch ID in a standard "http" mode for querying those background imagery tiles? Otherwise I will have to check for my server to use SSL I guess...

(05 Jul '20, 17:50) s-k

So I would recommend to add SSL to your server. You can use Let's Encrypt to do this without buying a certificate anywhere.

(05 Jul '20, 18:24) Spiekerooger
showing 5 of 9 show 4 more comments

Source code available on GitHub .