Modify

Opened 10 years ago

Closed 9 years ago

Last modified 6 years 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 by skyper, 10 years ago

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

comment:3 by skyper, 10 years ago

Type: defectenhancement

comment:4 by stoecker, 10 years ago

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 by stoecker, 9 years ago

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

comment:6 by stoecker, 9 years ago

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

comment:7 by wiktorn, 9 years ago

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 by Don-vip, 9 years ago

Keywords: gsoc added

in reply to:  8 comment:9 by simon04, 9 years ago

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 9 years ago by simon04 (previous) (diff)

comment:10 by bastiK, 9 years ago

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

comment:11 by A_Pirard, 9 years ago

Cc: A_Pirard added

comment:12 by A_Pirard, 9 years ago

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 by wiktorn, 9 years ago

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 by bastiK, 9 years ago

Great!

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

comment:15 by stoecker, 9 years ago

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 by Don-vip, 9 years ago

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

comment:17 by Don-vip, 9 years ago

Milestone: 15.07

in reply to:  16 ; comment:18 by wiktorn, 9 years ago

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 by bastiK, 9 years ago

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).

in reply to:  18 comment:20 by bastiK, 9 years ago

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 9 years ago by bastiK (previous) (diff)

comment:21 by A_Pirard, 9 years ago

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

comment:22 by wiktorn, 9 years ago

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 by wiktorn, 9 years ago

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.

in reply to:  23 comment:24 by Don-vip, 9 years ago

Replying to wiktorn:

Closes: #10623 - Walonnie WMTS finally works.

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

comment:25 by wiktorn, 9 years ago

In 8596/josm:

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

in reply to:  25 comment:26 by Don-vip, 9 years ago

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 by A_Pirard, 9 years ago

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 ;-)

in reply to:  27 comment:28 by wiktorn, 9 years ago

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 by stoecker, 9 years ago

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

comment:30 by wiktorn, 9 years ago

Thanks for reminder. done.

comment:31 by stoecker, 9 years ago

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 by Don-vip, 9 years ago

Milestone: 15.0715.08

Milestone renamed

comment:33 by carriere.denis@…, 9 years ago

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 by wiktorn, 9 years ago

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 by carriere.denis@…, 9 years ago

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 by wiktorn, 9 years ago

In 8752/josm:

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

Closes: #10623

comment:37 by wiktorn, 9 years ago

Milestone: 15.0815.09

comment:38 by carriere.denis@…, 9 years ago

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 :)

in reply to:  38 comment:39 by wiktorn, 9 years ago

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 by bastiK, 7 years ago

In 11790/josm:

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

comment:41 by bastiK, 7 years ago

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.)

in reply to:  41 comment:42 by Klumbumbus, 7 years ago

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 by bastiK, 7 years ago

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 by jidanni, 6 years ago

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

If JOSM can deal with it, let me know.

in reply to:  44 comment:45 by wiktorn, 6 years ago

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. 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.