Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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 StefanB)

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

Current "Select WMTS layer" dialog:
https://i.imgur.com/D3TWN0d.png

Attachments (1)

Screen Shot 2018-03-18 at 12.42.28.png (400.3 KB ) - added by StefanB 6 years ago.
Misplaced rendering

Download all attachments as: .zip

Change History (16)

comment:1 by StefanB, 6 years ago

Description: modified (diff)

comment:2 by StefanB, 6 years ago

Description: modified (diff)

comment:3 by StefanB, 6 years ago

Description: modified (diff)

comment:4 by Klumbumbus, 6 years ago

and those layers are not positioned correctly in JOSM (eg in lower zoom it is shifter 100km to the north)

  • 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 Don-vip, 6 years ago

Keywords: projection slovenia added

comment:6 by Don-vip, 6 years ago

Owner: changed from team to StefanB
Status: newneedinfo

I tried too and it seems to work fine (offset between Bing and DTK5 EPSG:3912 less than 5m).

by StefanB, 6 years ago

Misplaced rendering

comment:7 by StefanB, 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:
Misplaced rendering
(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)

Last edited 6 years ago by StefanB (previous) (diff)

comment:8 by stoecker, 6 years ago

Owner: changed from StefanB to team
Status: needinfonew

Hmm, maybe for WMTS we need to auto-detect the size, as we can't provide it in the XML...

in reply to:  8 comment:9 by Don-vip, 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 Don-vip, 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 Don-vip, 6 years ago

Keywords: wmts added
Milestone: 18.03
Summary: WMTS allows adding imagery with unsupported projectionsWMTS does not support different tile sizes for layers using the same projection

comment:12 by Don-vip, 6 years ago

Resolution: fixed
Status: newclosed

In 13539/josm:

fix #16084 - WMTS: support different tile sizes for layers using the same projection

comment:13 by StefanB, 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!!!

comment:14 by Don-vip, 6 years ago

In 13542/josm:

see #16084 - remove unused code

comment:15 by StefanB, 6 years ago

Tested version 13544, and layers seem to be rendered perfectly!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.