kalisio / kano

Map and weather forecast data explorer in 2D/3D
https://kalisio.github.io/kano/
MIT License
24 stars 7 forks source link

IGN layer load with referrer API key : 403 forbidden errors #209

Closed kazemar closed 3 years ago

kazemar commented 3 years ago

I try to load IGN layers from WMTS service with a referrer API key I created: https://wxs.ign.fr/key/geoportail/wmts?SERVICE=WMTS&REQUEST=GetCapabilities.

If I put it in Kano, it correctly gives me layers. However, when I display the layer, nothing appears. The network console shows 403 forbidden errors and the following response: <ExceptionReport><Exception exceptionCode="MissingParameter">Resource parameter not found</Exception></ExceptionReport>.

It could be a problem related to the permissions or the fact that the IGN WMTS service only supports the procedure oriented architectural style and not the resource oriented architectural style so that we need to use GetTile and not X/Y/Z based access.

claustres commented 3 years ago

According to the IGN documentation we should indeed use a GetTile request. Related to https://github.com/kalisio/kdk/issues/423.

robinbourianes-kalisio commented 3 years ago

I'm not sure adding WMTS GetTiles support will be enough, Geoportail securing mechanisms all require to add custom headers to the requests (referer, useragent or user/pass basicauth). Leaflet has no support to add custom headers when doing requests (https://github.com/Leaflet/Leaflet/issues/2091). I'll try but i'm a bit skeptical, even if the IGN doc doesn't mention http headers ...

claustres commented 3 years ago

Webservices have been updated recently by IGN and now uses generic keys (see https://geoservices.ign.fr/services-web-experts-cartes). For instance the following URL should work https://wxs.ign.fr/cartes/geoportail/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities. However, the following error is raised: _lodash2.default.get is not a function or its return value is not iterable.

It seems to be related to the fact that vector tiles are also exposed using WMTS but the layer does not provide a style.

claustres commented 3 years ago

Should be now fixed by https://github.com/kalisio/kdk/issues/423.