Modify

Opened 4 years ago

Closed 4 years ago

Last modified 12 months ago

#10623 closed enhancement (fixed)

support WMTS imagery services

Reported by: emmanuel.blassnig@… Owned by: team
Priority: normal Milestone: 15.09
Component: Core imagery Version:
Keywords: WMTS gsoc Cc: A_Pirard

Description

Hallo! Bitte um Hilfe!

Ist es möglich ein selbsterzeugtes WMTS-Service in JOSM einzubinden?

Danke für die Rückmeldungen.

Meine URL:

http://webgis.linz.at/WMTS/1.0.0/getCapabilities.xml

Attachments (0)

Change History (44)

comment:2 Changed 4 years ago by skyper

Component: CoreCore imagery
Keywords: WMTS added
Priority: majornormal
Summary: WMTS-Service in JOSM einbindensupport WMTS imagery services

comment:3 Changed 4 years ago by skyper

Type: defectenhancement

comment:4 Changed 4 years ago by stoecker

If I see it correctly WMTS does follow the same style like TMS, so you can specify an URL as given at Maps#TileMapServicesTMS. If you have trouble to specify the URL for JOSM, then please add a at least one working URL retrieving a PNG tile image.

I tried, but all I got were forbidden messages.

comment:5 Changed 4 years ago by stoecker

Owner: changed from team to emmanuel.blassnig@…
Status: newneedinfo

comment:6 Changed 4 years ago by stoecker

Please provide a working image URL or webservice, then we can tell you how a josm setup may look like.

comment:7 Changed 4 years ago by wiktorn

Owner: changed from emmanuel.blassnig@… to team
Status: needinfonew

I can provide WMTS service for Poland as an example (I couldn't get Linz to work).

GetCapabilities:
http://mapy.geoportal.gov.pl/wss/service/WMTS/guest/wmts/TOPO?SERVICE=WMTS&REQUEST=getcapabilities

And first tile for layer <ows:Title>MAPA TOPOGRAFICZNA</ows:Title>:
http://mapy.geoportal.gov.pl/wss/service/WMTS/guest/wmts/TOPO?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=MAPA%20TOPOGRAFICZNA&STYLE=default&TILEMATRIXSET=EPSG:2180&TILEMATRIX=EPSG:2180:0&TILEROW=0&TILECOL=0&FORMAT=image/png&rfh=1

The problem is, that scale of tiles is defined in WMTS service description, as well as what part of the world the tiles cover, where in TMS tiles uses predefined tile size and boundaries. Its also uses KVP encoding instead of URL substitution.

comment:8 Changed 4 years ago by Don-vip

Keywords: gsoc added

comment:9 in reply to:  8 Changed 4 years ago by simon04

An implementation could heavily use WMSImagery and AddWMSLayerPanel and alter the behaviour where needed (org.openstreetmap.josm.io.imagery.WMSImagery#attemptGetCapabilities, org.openstreetmap.josm.gui.preferences.imagery.AddWMSLayerPanel#getImageryInfo). In the end, a generated TMS URL could be returned …

Let's see what GSOC brings … :-)

Last edited 4 years ago by simon04 (previous) (diff)

comment:10 Changed 4 years ago by bastiK

Ticket #11425 has been marked as a duplicate of this ticket.

comment:11 Changed 4 years ago by A_Pirard

Cc: A_Pirard added

comment:12 Changed 4 years ago by A_Pirard

Here is a similar ArcGIS WMTS capability file that could hopefully be decoded by Imagery/Preferences Setup.
http://geoservices.wallonie.be/arcgis/rest/services/DONNEES_BASE/FOND_PLAN_ANNOTATIONS_2012_RW_NB/MapServer/WMTS/1.0.0/WMTSCapabilities.xml
Paramount server as you can see by navigating up and down the directory tree.
TIA !!!

comment:13 Changed 4 years ago by wiktorn

In 8568/josm:

Basic WMTS support.

  • added information about units and to_meter to EPSG projection definitions (needed for WMTS)
  • added WMTSTileSource and WMTSLayer classes
  • a bit of cleanup of AbstractTileSourceLayer and align so it will work properly with WMTS tile definitions
  • added Imagery Preferences panel for WMTS and icon for button
  • added removal of wms: / tms: / wmts: prefix, if user will paste them into the field
  • CachedFile - added possibility to send custom headers with request
  • added support for unit and to_meter in CustomProjection
  • AbstractTMSTileSource cleanups (change of Coordinate to ICoordinate)
  • moved JCSCachedTileLoaderJob.read() to Utils

Addresses: #10623

Tested with Polish WMTS service proivders, Walonnie needs still some debugging, as it is not working right now.

comment:14 Changed 4 years ago by bastiK

Great!

This should make Projection.getDefaultZoomInPPD() obsolete. At least in AbstractProjection.getDefaultZoomInPPD() it could be set to something like 10 / getMetersPerUnit().

comment:15 Changed 4 years ago by stoecker

If we obsolete that, can we also remove the bookmark for WMS zoom depths or fix it. There have some reports recently, which showed that actually nobody understands it and when I last looked at the code it also looked strange to me. In the past it was possible to use right click on WMS layer in layer list to make a bookmark at current zoom depths and add this to imagery list. I don't think current JOSM does that correctly anymore, at least as far as I remember I was able to create a zoom fixed menu entry without even touching the relevant function.

comment:16 Changed 4 years ago by Don-vip

Proj4J plugin needs to be updated to implement the new method getMetersPerUnit().

comment:17 Changed 4 years ago by Don-vip

Milestone: 15.07

comment:18 in reply to:  16 ; Changed 4 years ago by wiktorn

Replying to Don-vip:

Proj4J plugin needs to be updated to implement the new method getMetersPerUnit().

Problem with Proj4J is, that it doesn't have this information. As far as I've checked, there is internal field Unit which might be degrees or meters, but its not accessible, and there is getFromMeters() and getScaleFactor() but implementations do not return different values for them, as far as I've checked.

from_meters have also different problem, that it uses keyword fr_meters, that is unknown to proj.4...

comment:19 Changed 4 years ago by bastiK

Despite what they say in the doc, the default value for to_meters in proj.4 seems to be 1.0 (which makes sense).

Any small deviation in this factor will be very visible in WMTS: An error of 0.01% results in an offset of 10m if you look at a place 100km away from the origin. Therefore I'm not sure it is really helplful to support degrees as a length unit, unless there is a formal specification what this means (or we have a real word test case).

comment:20 in reply to:  18 Changed 4 years ago by bastiK

Replying to wiktorn:

Problem with Proj4J is, that it doesn't have this information. As far as I've checked, there is internal field Unit which might be degrees or meters, but its not accessible, and there is getFromMeters() and getScaleFactor() but implementations do not return different values for them, as far as I've checked.

It should suffice to use a default value of 1.0, which covers most (non-US) projections. I guess it could be fixed, but not sure if it's worth the trouble.

from_meters have also different problem, that it uses keyword fr_meters, that is unknown to proj.4...

fr_meters is used internally in proj.4 and is simply set to 1.0 / to_meters.

Last edited 4 years ago by bastiK (previous) (diff)

comment:21 Changed 4 years ago by A_Pirard

It's impressive to read your discussions about those internals.
THANKS !!!

comment:22 Changed 4 years ago by wiktorn

In 8584/josm:

  • added axis definition to ESPG projections definition, where it's not default (i.e. North/East)
  • added switchXY boolean in Projection interface
  • WMTS and WMS (1.3.0) uses now switchXY when doing requests against servers
  • better error reporting when there are problems with parsing the WMTS TileSource

Addresses: #10623

Now http://webgis.linz.at/WMTS/1.0.0/getCapabilities.xml should work.

Wallonie services still being debugged.

comment:23 Changed 4 years ago by wiktorn

Resolution: fixed
Status: newclosed

In 8586/josm:

  • (WMTS) Added Style support
  • (WMTS) Added MatrixHeight and MatrixWidth support
  • (WMTS) Corrected best zoom calcu

Closes: #10623 - Walonnie WMTS finally works.

comment:24 in reply to:  23 Changed 4 years ago by Don-vip

Replying to wiktorn:

Closes: #10623 - Walonnie WMTS finally works.

Unit tests are still failing: jenkins/job/JOSM/lastCompletedBuild/testReport/

comment:25 Changed 4 years ago by wiktorn

In 8596/josm:

Fix off by one error which breakes openeing local files on linux. Addresses: #10623

comment:26 in reply to:  25 Changed 4 years ago by Don-vip

Replying to wiktorn:

In 8596/josm:

Fix off by one error which breakes openeing local files on linux. Addresses: #10623

Please don't use System.out.println(). It should be either removed or replaced with Main.info/debug/trace if useful.

comment:27 Changed 4 years ago by A_Pirard

Hi,
I have had a look at these Wallonie WMTS results from a practical point of view.
The problem is that they serve only EPSG:31370, probably for all WMTS data as per their habit.
That brings us back to the 5 yo ticket about impossible reprojection and mix with usual layers.
In consequence a hacked Arcgis REST GET is more interesting as they're supposed to support all projections.
BTW, I did not know (couldn't see) that the display would be so dull.
http://geoservices.wallonie.be/arcgis/rest/services/DONNEES_BASE/FOND_PLAN_ANNOTATIONS_2012_RW_NB/MapServer/WMTS/1.0.0/
shows a ot of cheerful layers ;-)

comment:28 in reply to:  27 Changed 4 years ago by wiktorn

Replying to A_Pirard:

Hi,
I have had a look at these Wallonie WMTS results from a practical point of view.
The problem is that they serve only EPSG:31370, probably for all WMTS data as per their habit.
That brings us back to the 5 yo ticket about impossible reprojection and mix with usual layers.

The question is, to which CRS you would like to have this reprojected? If WMS layer support WGS84 imagery gets reprojected to current projection, though not always you get the proper result.

In consequence a hacked Arcgis REST GET is more interesting as they're supposed to support all projections.
BTW, I did not know (couldn't see) that the display would be so dull.
http://geoservices.wallonie.be/arcgis/rest/services/DONNEES_BASE/FOND_PLAN_ANNOTATIONS_2012_RW_NB/MapServer/WMTS/1.0.0/
shows a ot of cheerful layers ;-)

But that's exactly what I see also using different WMTS client, such as QGis. I do not see any other styles or layers advertised in their GetCapabilties document, so probably something went wrong, when tiles were generated.

comment:29 Changed 4 years ago by stoecker

Please don't forget to document new stuff on Maps.

comment:30 Changed 4 years ago by wiktorn

Thanks for reminder. done.

comment:31 Changed 4 years ago by stoecker

BTW, when you are working on that imagery stuff. There are WMS which use cookies to validate valid access. Bad news for this is, that the cookie comes from a web-page not directly related to the WMS. I'd like to use at least one of them for non-OpenStreetMap purposes, but was to lazy yet to implement the necessary infrastructure, something like a "cookie-url" parameter :-)

comment:32 Changed 4 years ago by Don-vip

Milestone: 15.0715.08

Milestone renamed

comment:33 Changed 3 years ago by carriere.denis@…

I'm having issues with loading imagery from a WMTS, I've added it to the entries using the WMTS, but afterwards it seems to be greyed out and I can't select it.

Here's the WMTS, could anyone test it to see if this works for them?

http://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_2014/MapServer/WMTS/1.0.0/WMTSCapabilities.xml

comment:34 Changed 3 years ago by wiktorn

It looks like the server is providing two tilesets for EPSG:3857 and one (GoogleMapsCompatibile) is missing tiles. I'll add support for such situation.

comment:35 Changed 3 years ago by carriere.denis@…

Perfect thanks! Those ArcGIS Server's can be tricky, but I've tested the WMTS with QGIS 2.10 and it seems to work fine.

Thanks again :)

comment:36 Changed 3 years ago by wiktorn

In 8752/josm:

Support situations, where WMTS service provides more than one tile set for one projection.

Closes: #10623

comment:37 Changed 3 years ago by wiktorn

Milestone: 15.0815.09

comment:38 Changed 3 years ago by carriere.denis@…

I've updated to the latest JOSM 8752, I'm still not having any luck adding this WMS/WMTS.

http://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_2014/MapServer

Could you let me know how you've fixed this issue because it still isn't work out.

If you've got it to work on your JOSM, please comment here explaining how you did it.

Thanks :)

comment:39 in reply to:  38 Changed 3 years ago by wiktorn

Replying to carriere.denis@…:

I've updated to the latest JOSM 8752, I'm still not having any luck adding this WMS/WMTS.

http://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_2014/MapServer

Could you let me know how you've fixed this issue because it still isn't work out.

If you've got it to work on your JOSM, please comment here explaining how you did it.

Thanks :)

With this address:
http://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_2014/MapServer

I get SAX Exception as this is not getCapabilities document.

If I use address:
http://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_2014/MapServer/WMTS/1.0.0/WMTSCapabilities.xml

Then a dialog shows asking me, which layer to select. If I select the one, that uses default028mm, then I get imagery. For the GoogleMapsCompatibile the server lacks imagery and it doesn't work for me in QGis either.

comment:40 Changed 2 years ago by bastiK

In 11790/josm:

WMTS: fix case with multiple tilesets per projection and layer (regression from [11788]), see #7427, see #10623)

comment:41 Changed 2 years ago by bastiK

Regarding [8752], wouldn't it make sense to only show the entries that match the current projection? (And skip the dialog if there is only one layer with one matching tile matrix set, which is usually the case.)

comment:42 in reply to:  41 Changed 2 years ago by Klumbumbus

Replying to bastiK:

And skip the dialog if there is only one layer with one matching tile matrix set, which is usually the case.

That would be great. (Then we could e.g. interchange Maps/Germany#Saxonylatestaerialimagery with its mirror entry.)

comment:43 Changed 2 years ago by bastiK

In 11791/josm:

WMTS: don't show layer selection dialog if there is only one layer with one tile matrix set that matches the current projection (see #10623)

comment:44 Changed 12 months ago by jidanni

Here is another file to test with, http://landmaps.nlsc.gov.tw/S_Maps/wmts .

If JOSM can deal with it, let me know.

comment:45 in reply to:  44 Changed 12 months ago by wiktorn

Replying to jidanni:

Here is another file to test with, http://landmaps.nlsc.gov.tw/S_Maps/wmts .

If JOSM can deal with it, let me know.

Is there any program that can deal with it? I tried with QGis and it also asks to choose the layer, but the service doesn't provide any.

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.