itowns
itowns copied to clipboard
iTowns API with OpenElevation API
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.
I'm not familiar with OpenElevation API, can you give us more context ? What does a request look like for example ?
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
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).
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.
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.
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...
Is anyone here successfully using any alternative to ign for elevation data? I requested a key there but got no response.
There is this alternative example, view_25d_map, it uses WMSSource
and color texture elevation (see code).
I will inquire about IGN key.
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.
@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.
@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
you cloud use https://gdal.org/ to extract/convert data from WMTS