WMTS with interesting behaviour

43 views
Skip to first unread message

Nadja Bernhard

unread,
Aug 24, 2022, 10:03:34 AM8/24/22
to GeoAdminCh API
Hi everyone
We're developping an application where we use the WTMS of the national map (color) in EPSG 2056 as basemap (and several other WMTS too). Until recently we used "https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml" and it worked fine, it returned the correct coordinates, displayed the map and didn't throw any error. A while ago we got a 3xx error, which was now replaced by an error 404 for GET in the console. Event though we deleted the cache, the map and the coordinates were displayed correctly. That's strange for error 404...
Anyway, we then played around with the different WMTS-URLs and realised, that we probably would need to use "https://wmts.geo.admin.ch", which we now do. This doesn't throw an error, the map gets displayed correctly BUT the coordinates are now in EPSG 21781. According to this https://api3.geo.admin.ch/services/sdiservices.html?highlight=zoom#gettile, the TileMatrixSet is set to LV03/CH1903, but the example uses 2056. These two don't match.

We're still not sure, what to make of this. But we've got some questions:
1. does this mean, that EPSG 21781 is STILL the default CRS for the national WMTS?
2. what is the correct WMTS-URL if we want to use EPSG 2056?
3. do you have any idea why we get the WMTS from "https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml" and simultaneously getting an error 404 GET?

Thank you in advance for your reply.
Best,
Nadja Bernhard

Mario Keusen

unread,
Aug 25, 2022, 2:42:43 AM8/25/22
to GeoAdminCh API
Thanks for your request. We'll treat this in the technical group and come back to you with an answer soon.
Thanks for your patience and for using *geo.admin.ch
BR Team geo.admin.ch

Brice Schaffner

unread,
Aug 25, 2022, 5:09:41 AM8/25/22
to GeoAdminCh API
Hello Nadja

Could you provide more information on how you do the request ? All the examples you provided above seems to be working as expected and return a 200 OK. Note that 3xx are not error but mostly redirect and expected HTTP behavior. For example if you try to access any *.geo.admin.ch endpoint via HTTP you will always have a "301  Moved Permanently" with the "Location" header set to the correct url with HTTPS. Most of clients usually works out of the box with redirect, so you might check that your client does and/or is configured to follow redirect.

Best regards

Nadja Bernhard / Netzwerk Schweizer Pärke

unread,
Aug 25, 2022, 6:07:27 AM8/25/22
to geoadm...@googlegroups.com

Hi Brice

 

I’m using the ArcGIS API for Javascript 4.24 and the WMTSLayer-Constructor:

https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#version

 

wmts_url_bgdi = "https://wmts.geo.admin.ch/EPSG/2056";

wmts_constructor = function (wmts_url, wmts_id, wmts_title, wmts_copyright, wmts_visibility) {

    // creating wmts layer

    const wmts = new WMTSLayer({});

    // parameters as keys to this object 

    wmts.url = wmts_url;

    wmts.activeLayer = {id: wmts_id};

    wmts.title = wmts_title;

    wmts.copyright = wmts_copyright;

    wmts.visible = wmts_visibility;

 

    return wmts;

  };

  const LK_farbig = wmts_constructor_for_basemap(wmts_url_bgdi, "ch.swisstopo.pixelkarte-farbe", "PK farbig", "swisstopo", true);

 

The correct url seems to be: "https://wmts.geo.admin.ch/EPSG/2056". Not working urls are "https://wmts.geo.admin.ch" and "https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml".

 

A few weeks ago, "https://wmts.geo.admin.ch/EPSG/2056/1.0.0/WMTSCapabilities.xml" worked fine. I got this url from here: https://www.geo.admin.ch/de/geo-dienstleistungen/geodienste/darstellungsdienste-webmapping-webgis-anwendungen/web-map-tiling-services-wmts.html

 

When I’m using "https://wmts.geo.admin.ch" it now returns the coordinates in EPSG2056. (Yesterday, I really got EPSG21781)

 

Sooo, sorry for the inconvenience. You can consider this question as “answered”.

 

Best

Nadja

--
You received this message because you are subscribed to a topic in the Google Groups "GeoAdminCh API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geoadmin-api/_5RQkHhpjyw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/5f20b906-164a-485d-a6ae-f21cb08e82d0n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages