itowns icon indicating copy to clipboard operation
itowns copied to clipboard

iTowns API with OpenElevation API

Open shrimpie1911 opened this issue 5 years ago • 12 comments

Does iTowns work with OpenElevation API? i need a replacement for ign.

Thank you in advance for the help and sorry for my bad english.

shrimpie1911 avatar Apr 18 '19 13:04 shrimpie1911

I'm not familiar with OpenElevation API, can you give us more context ? What does a request look like for example ?

zarov avatar Apr 18 '19 14:04 zarov

Thank your for the fast reply. The request example is curl https://api.open-elevation.com/api/v1/lookup\?locations\=10,10\|20,20\|41.161758,-8.583933 and the reponse is:

{
   "results":
   [
      {
         "longitude":10.0,
         "elevation":515,
         "latitude":10.0
      },
      {
         "longitude":20.0,
         "elevation":545,
         "latitude":20.0
      },
      {
         "latitude":41.161758,
         "elevation":117,
         "longitude":-8.583933
      }
   ]
}

I have another question too, does your api key on the json layer file usable outside localhost?

Thank you in advance for your help and sorry for my bad english

shrimpie1911 avatar Apr 18 '19 14:04 shrimpie1911

Concerning OpenElevation: it seems that it only returns the elevation of asked points, so you can't use it with an ElevationLayer in iTowns. But you should be able to code something to request some points as you move on your globe.

Concerning the API key, it isn't, it only works in localhost and for the itowns website. If you want to have your API key, you can find answer on the professionals website of IGN (in french only).

zarov avatar Apr 18 '19 14:04 zarov

Thank you for the fast reply. Concerning the IGN API Key, i have create an accout and have my key (free). But still the 403 forbidden error show up. I have verify that i have mark on the column of WMTS and on the ELEVATION.ELEVATIONGRIDCOVERAGE.SRTM3 but it doesn't seem to work. Do i need to "buy" a key to use iTowns?

Thank you in advance for your help and sorry for my bad english.

shrimpie1911 avatar Apr 18 '19 14:04 shrimpie1911

You don't need a key to use iTowns.

If you have only changed the API key in your code, it should works. I don't really know how those keys works, but one way to test it would be to insert your API key here: https://wxs.ign.fr/<your API key>/geoportail/wmts?LAYER=ORTHOIMAGERY.ORTHOPHOTOS&FORMAT=image/jpeg&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal&TILEMATRIXSET=PM&TILEMATRIX=2&TILEROW=1&TILECOL=2. If it doesn't work, I suggest that you get in touch with someone from the linked site above. The itowns community can't provide support for this product.

zarov avatar Apr 18 '19 15:04 zarov

Yep i have the error:

<ExceptionReport>
<Exception exceptionCode="MissingRights">
Wrong referer or wrong IP Adress or wrong User-Agent
</Exception>
</ExceptionReport>

I think i need to buy a "key" to operate outside localhost...

shrimpie1911 avatar Apr 18 '19 15:04 shrimpie1911

Is anyone here successfully using any alternative to ign for elevation data? I requested a key there but got no response.

nickredmark avatar Dec 22 '20 08:12 nickredmark

There is this alternative example, view_25d_map, it uses WMSSource and color texture elevation (see code).

I will inquire about IGN key.

gchoqueux avatar Jan 04 '21 14:01 gchoqueux

Thanks for your answer @gchoqueux - I forgot about that example because I am trying to create a tool with global elevation data and unfortunately that service only provides elevation data for the Lyon area.

nickredmark avatar Jan 05 '21 08:01 nickredmark

@gchoqueux I checked again and actually I received the IGN key in November, didn't notice. Unfortunately it doesn't work for elevation data. I sent an email.

nickredmark avatar Jan 05 '21 08:01 nickredmark

@gchoqueux Is there any way of obtaining the .tif file of this elevation layer - ELEVATION.ELEVATIONGRIDCOVERAGE.SRTM3 ? Here is the source of the layer: https://github.com/iTowns/itowns/tree/master/examples/layers/JSONLayers

prashantthapaliya8989 avatar Jun 01 '22 13:06 prashantthapaliya8989

you cloud use https://gdal.org/ to extract/convert data from WMTS

gchoqueux avatar Jun 01 '22 13:06 gchoqueux