Maproom / qmapshack

Consumer grade GIS software
GNU General Public License v3.0
271 stars 63 forks source link

Documentation: Build TMS file for wmts file #671

Open arquox opened 3 months ago

arquox commented 3 months ago

Describe the bug

I created a .tms file for a WMTS server as shown in the documentation with the TMS RESTful style. The URL is correct, but no map tiles are shown.

Resource URL:

function convert(z1,x1,y1)
{ return "https://wmtsod1.bayernwolke.de/wmts/by_amtl_karte/default/smerc/"+z1+"/"+y1+"/"+x1 }

What have you done to circle down the problem?

I started QMS with the -f parameter. The logfile shows:

2024-03-20 8:48:05.337 [debug] TMS: try to open "/path/Bayern1.tms"
2024-03-20 8:48:05.338 [debug] Create projection: "EPSG:3857" -> "EPSG:4326"
2024-03-20 8:48:05.338 [debug] tms: "EPSG:3857"
2024-03-20 8:48:05.344 [debug] Create projection: "EPSG:4326" -> "EPSG:4326"
2024-03-20 8:48:05.487 [debug] Create projection: "EPSG:4326" -> "EPSG:32661"
2024-03-20 8:48:05.487 [debug] Sanity test passed.
2024-03-20 8:48:28.489 [warning] QWidget::setMinimumSize: (/QTextBrowser) Negative sizes (300,-140) are not possible
2024-03-20 8:48:28.489 [warning] QWidget::setMaximumSize: (/QTextBrowser) Negative sizes (16777215,-140) are not possible
2024-03-20 8:48:28.489 [warning] QWidget::setMinimumSize: (/QTextBrowser) Negative sizes (300,-140) are not possible
2024-03-20 8:48:28.489 [warning] QWidget::setMaximumSize: (/QTextBrowser) Negative sizes (16777215,-140) are not possible
2024-03-20 8:48:28.489 [warning] QWidget::setMinimumSize: (/QTextBrowser) Negative sizes (300,-140) are not possible
...

If I use a static server URL in the .tms file, everything works:

<ServerUrl>https://wmtsod1.bayernwolke.de/wmts/by_amtl_karte/smerc/%1/%2/%3</ServerUrl>

Then I changed the position of the x1 and y1 parameter in the resource URL in the .tms file, same order like in the static server URL:

function convert(z1,x1,y1)
{ return "https://wmtsod1.bayernwolke.de/wmts/by_amtl_karte/default/smerc/"+z1+"/"+x1+"/"+y1 }

After reload of the maps in QMS the map tiles showed up as expected.

To Reproduce

Expected behavior

This is not a bug in QMS, only the documentation should be updated.

Screenshots

Attachments

Tracebacks

Desktop

Additional context

wthaem commented 3 months ago
arquox commented 3 months ago

Yes, I tested it with this URL. The resource URL in the capabilities document is:

<ResourceURL format="image/png" resourceType="tile" template="https://wmtsod1.bayernwolke.de/wmts/by_amtl_karte/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}"/>
mitxel-m commented 3 months ago

As @wthaem says not always x and y parameters come in the same order. E.g. different order to @arquox template

template="https://idena.navarra.es/ogc/wmts/ortofoto2023/default/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg"/>

Maybe the point to add in documentation is that usually in such templates TileCol refers to x, TileRow to y, and TileMatrix to z, and not always in the same order.