Subscribe to this thread
Home - General / All posts - How to create Thunderforest WMS Data Source in M9?
steveFitz

340 post(s)
#14-Sep-20 04:20

I'm trying to get a data source to produce an OpenCycleMap base layer.

I have an API key and a resulting URL:

https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=c66...etc (replace the '

c66...etc' with an actual api key), but I can't get it to work.

I can't separate the API key into the appropriate box in the dialog because that is not activated.

The closest I can get is if I use the OpenStreetMaps image server dialog and replace the URL with my URL. The resulting map is not good (very, very bad to quote the POTUS).

It works fine when I paste it into a QGIS WMS dialog.

What could I be doing wrong?

steveFitz

340 post(s)
#14-Sep-20 04:48

Apologies for the codified text. I tried to edit it once I noticed but the forum editor reported that the text was too long to edit (?) and wouldn't let me change it. Maybe I shouldn't have pasted the image...

jsperr
143 post(s)
#14-Sep-20 12:36

I am not having any luck either. I registered and obtained an API key and tried many different things but nothing worked. QGIS brings it right in where I noted the zoom settings were in the source string. I'll play with it more after work.

rk
621 post(s)
#14-Sep-20 13:33

First, this service is definitely not a WMS.

It is kind of TMS, but it does not give TMS "resources" https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification that are rough equivalents of WMS "capabilities" doc.

Still in M9 you can use Type: 'imageserver' - 'Custom'

and replace {z} with {zoom}

This worked for me.

--SQL9

CREATE DATASOURCE [thunderforest cycle] (

  PROPERTY 'Source' '{ "Source": "https:\\/\\/tile.thunderforest.com\\/cycle\\/{zoom}\\/{x}\\/{y}.png?apikey=...", "SourceAgent": "Mozilla\\/5.0 Manifold\\/9.0", "SourceCache": true, "SourceCacheTemp": true, "SourceTileSizeSingle": 256, "SourceUuid": "1c3bd1ec-5da4-4114-9f7d-f5ce24294c4a", "SourceZooms": [ 0, 22 ] }',

  PROPERTY 'Type' 'imageserver'

);

jsperr
143 post(s)
#14-Sep-20 16:21

Thank you, that works for me.

I'm trying to learn here. I was trying different things in the custom imageserver configuration -- what clued you in to replace {z} with {zoom} in the connection string? Why does that make it work in favor of the published URL that works in QGIS for z/x/y tiled maps? I read the API page -- am I missing Leaflet or OpenLayers library components? Or is it just a Manifold SQL thing?

https://www.thunderforest.com/docs/map-tiles-api/

rk
621 post(s)
#14-Sep-20 16:35

{zoom} is Manifold thing:

http://www.georeference.org/forum/t139546#139548

[edit] Found documentation http://www.manifold.net/doc/mfd9/file_-_create_-_new_data_source.htm

rk
621 post(s)
#14-Sep-20 16:49

Better yet separate apikey from URL usnig {key}.

CREATE DATASOURCE [thunderforest cycle] (

  PROPERTY 'Source' '{ "Source": "https:\\/\\/tile.thunderforest.com\\/cycle\\/{zoom}\\/{x}\\/{y}.png?apikey={key}", "SourceAgent": "Mozilla\\/5.0 Manifold\\/9.0", "SourceApiKey": "PASTE-API-KEY-HERE", "SourceCache": true, "SourceCacheTemp": true, "SourceTileSizeSingle": 256, "SourceUuid": "6f2e78ab-bb92-44bb-99dc-66c975d549f4", "SourceZooms": [ 0, 22 ] }',

  PROPERTY 'Type' 'imageserver'

);

steveFitz

340 post(s)
#15-Sep-20 06:40

Thanks rk - that works perfect. Added to my 'Favorites'

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.