#16084 closed defect (fixed)
WMTS does not support different tile sizes for layers using the same projection
Reported by: | StefanB | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 18.03 |
Component: | Core imagery | Version: | |
Keywords: | projection slovenia wmts | Cc: |
Description (last modified by )
In imagery for Slovenia we have a reference to WMTS service:
https://josm.openstreetmap.de/wiki/Maps/Slovenia#GURS:DTK5wmts
Which fetches capabilities from
http://prostor4.gov.si/ows2-gwc-pub/service/wmts?request=getCapabilities
Some of the layers there are in an older national projection EPSG:3912 (https://epsg.io/3912 = D48/GK), and those layers are not positioned correctly in JOSM (eg in lower zoom it is shifter 100km to the north). This old projection is being phased out, but some legacy data is still in it.
The layers in newer projection EPSG:3794 (https://epsg.io/3794 = D96/TM) are positioned much better
Whenever needed and possible, we use http://geocoordinateconverter.tk/ to convert data from the old projection to ETRS89 accurately, but int this case the layers are served via wmts service, giving us no influence.
Either
- EPSG:3912 projection should be better supported (probably not easy) to position the layer better or
- disable such layer selection in the "Select WMTS layer" dialog window
- add some additional warning that layer might not work at all
Attachments (1)
Change History (16)
comment:1 by , 6 years ago
Description: | modified (diff) |
---|
comment:2 by , 6 years ago
Description: | modified (diff) |
---|
comment:3 by , 6 years ago
Description: | modified (diff) |
---|
comment:4 by , 6 years ago
- At which zoom?
- At which position?
- What did you set as projection in JOSM?
- JOSM automatically reprojects, but using the "native" projection of the tiles might be better. At a quick test with JOSM reprojecting DTK5 EPSG:3912 to mercator I couldn't find misplaced tiles.
comment:5 by , 6 years ago
Keywords: | projection slovenia added |
---|
comment:6 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
I tried too and it seems to work fine (offset between Bing and DTK5 EPSG:3912 less than 5m).
comment:7 by , 6 years ago
Indeed, most of the problems encountered were with the layers starting with "table_gurs_pub...", eg the table_gurs_pub:SI.GURS.RPE.NA (Naselja, settlements) layer loads image:
http://prostor4.gov.si/ows2-gwc-pub/service/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=table_gurs_pub:SI.GURS.RPE.NA&STYLE=&FORMAT=image/png&tileMatrixSet=EPSG:3912_ALL_SCALES_512pxl&tileMatrix=EPSG:3912_ALL_SCALES_512pxl:5&tileRow=4&tileCol=4
which is 512x512 px (got hint from the matrix set name, but confirmed in the actual image), which might screw up the positioning, which then renders badly:
(cyan is the "GURS: Road lines" layer, which matches very well to OSM data; violet is the table_gurs_pub:SI.GURS.RPE.NA layer)
follow-up: 9 comment:8 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | needinfo → new |
Hmm, maybe for WMTS we need to auto-detect the size, as we can't provide it in the XML...
comment:9 by , 6 years ago
Replying to stoecker:
Hmm, maybe for WMTS we need to auto-detect the size, as we can't provide it in the XML...
It's provided in the capabilities:
<TileMatrix> <ows:Identifier>EPSG:3912_ALL_SCALES_512pxl:0</ows:Identifier> <ScaleDenominator>1250000.0</ScaleDenominator> <TopLeftCorner>370210.0 200055.0</TopLeftCorner> <TileWidth>512</TileWidth> <TileHeight>512</TileHeight> <MatrixWidth>2</MatrixWidth> <MatrixHeight>1</MatrixHeight> </TileMatrix>
comment:10 by , 6 years ago
Bug is in WMTSTileSource
:
if (tileProjection != null) { // no support for non-square tiles (tileHeight != tileWidth) // and for different tile sizes at different zoom levels Collection<Layer> projLayers = getLayers(null, tileProjection.toCode()); if (!projLayers.isEmpty()) { cachedTileSize = projLayers.iterator().next().tileMatrixSet.tileMatrix.get(0).tileHeight; return cachedTileSize; } }
We rely only on projection, and use the tile dimensions of the first layer matching the current projection, instead of using the actual size defined for the current tile matrix.
comment:11 by , 6 years ago
Keywords: | wmts added |
---|---|
Milestone: | → 18.03 |
Summary: | WMTS allows adding imagery with unsupported projections → WMTS does not support different tile sizes for layers using the same projection |
comment:13 by , 6 years ago
Wonderful!
I will try it as soon as the josm-latest.jar with this fix (version 13539 or higher) is available.
Thank you!!!