Select to view content in your preferred language

Elevation of latitude/longitude through REST API

1693
7
Jump to solution
09-14-2023 04:05 AM
bmccoy
by
Emerging Contributor

Is it possible to get the elevation (approximate is fine) of a specific latitude & longitude through the REST API?

0 Kudos
1 Solution

Accepted Solutions
EarlMedina
Esri Regular Contributor

You might consider other options. EPQS (nationalmap.gov) comes to mind. If you are working with Image Services, then you might be able to use one of those endpoints. I think Identify and Get Samples could work for this use case.

 

View solution in original post

7 Replies
AyanPalit
Esri Regular Contributor

@bmccoy I believe this is possible, the REST API doc states:

  • Find elevation values along input lines and return a profile feature

Reference: Elevation analysis service

Ayan Palit | Principal Consultant Esri
0 Kudos
bmccoy
by
Emerging Contributor

Thank you for the reply @AyanPalit , but this is not what we need for our application.  I believe the the profile feature would allow us to submit a job and it would return us an analysis along a line.  We just simply need to get the elevation of a specific lat/lon within the US.  So as the user clicks a point on a map, we would be able to retrieve the elevation of that specific map point and display it.

0 Kudos
bmccoy
by
Emerging Contributor

To clarify, I found this endpoint...https://elevation.arcgis.com/arcgis/rest/services/WorldElevation/TopoBathy/ImageServer/identify?geom...

 

But that returns...

{
 "objectId": 0,
 "name": "Pixel",
 "value": "-2317",
 "location": {
  "x": -99.447299999999998,
  "y": 41.2057,
  "spatialReference": {
   "wkid": 102100,
   "latestWkid": 3857
  }
 },
 "properties": null,
 "catalogItems": null,
 "catalogItemVisibilities": [
  
 ]
}

I believe this is close to what we need, but the value returned is obviously not correct.
0 Kudos
EarlMedina
Esri Regular Contributor

You might consider other options. EPQS (nationalmap.gov) comes to mind. If you are working with Image Services, then you might be able to use one of those endpoints. I think Identify and Get Samples could work for this use case.

 

bmccoy
by
Emerging Contributor

Thank you Earl.  I happened to find that endpoint with the nationalmap.gov site that you mentioned yesterday after some searching.  They have exactly what we need for our use case.  Thank you.

SHMAGIC
New Contributor

not for nothing since this post was from September but the call you are making on esri's elevation service is returning the depth/elev value in Web Mercator (the uom is meters not degrees) out in the polar regions along the Greenwich line. 

 

Try this...

 

{
 "objectId": 0,
 "name": "Pixel",
 "value": "730.826",
 "location": {
  "x": -1.107384508E7,
  "y": 5054889.08,
  "spatialReference": {
   "wkid": 102100,
   "latestWkid": 3857
  }
 },
 "properties": null,
 "catalogItems": null,
 "catalogItemVisibilities": []
}

Identify: (WorldElevation/TopoBathy) (arcgis.com)

0 Kudos
Jay_Gregory
Frequent Contributor

@SHMAGIC This is a great solution thank you.  My question is if you are doing this in vanilla Python, I'm curious how this works since you need a token.  I can generate an API key, but elevation is not technically in the "location services" available to your API tokens.  So is it possible to generate an token for API requests based on an API token without specifying your username and password (we log in via SAML)

0 Kudos