1

I have spent quite a while trying to get the ESRI API working. Basically we would like to pass a lat, long to a service and obtain the elevation back.

Our previous service stopped working - we were using: https://utility.arcgis.com/usrsvcs/servers/55efcc79e42941e8a98831f987ca67c0/rest/services/WorldElevation/TopoBathy/ImageServer/identify?f=json&geometry={x:20,y:20,spatialReference:{wkid:4326}}&geometryType=esriGeometryPoint&f=json&returnCatalogItems=false

this service now appears to have gone.

I have looked at the ESRI documentation but alas it is really poor https://developers.arcgis.com/rest/elevation/api-reference/summarize-elevation.htm should work but just submits a job Using https://elevation.arcgis.com/arcgis/rest/services/WorldElevation/TopoBathy/ImageServer Displays in ArcGIS Pro/ArcMap but you can only identify, looking at fiddler the response/request isn't easily reproducible.

Alternative options are Open Elevation which is the opposite of ESRI documentation it couldnt be simpler but alas the baseline dataset isnt high enough quality: https://api.open-elevation.com/api/v1/lookup?locations=41.161758,-8.583933

Does anyone have any working GET/POST requests to get Elevation details for point data from ESRI?

2 Answers 2

2

As always (and this is the hard part really) you need to know what you are looking for. What you want is to do a identify on an ImageService. In short, this is the link to the correct part of the documentation: https://developers.arcgis.com/rest/services-reference/identify-image-service-.htm

But the problem in this case is that the ImageService for WorldElevation is either not existing or not open anymore. You can check open services a couple levels up:

The url you posted and didn't work: https://elevation.arcgis.com/arcgis/rest/services/WorldElevation/TopoBathy/ImageServer

The url at service level: https://elevation.arcgis.com/arcgis/rest/services/WorldElevation

The only open service I see is a MapService called DataExtends.

If I Google for "topobathy arcgis rest" I get this page where it is explained you need an ArcGIS Online subscription to view the data... So you need to find out what the cost is and determine if this is worth it for your case.

An alternative might be open data but then you need to know what you need, what is out there and find a way to identify a coordinate like the rest API does.

2

Thank you @buddiebubba, you put me on the right track. Looks like ESRI now require a token for identify.

This makes it a little tricker as I now need to make a request for a token then use it against the identify. I also found the service, for reference the requests are:

POST to get token https://www.arcgis.com/sharing/rest/oauth2/token?client_id=kSnVxAAOxDJHJxxx&client_secret=8209eeea4955480f91a7cda31ad3fxxx&grant_type=client_credentials

Access token returned

GET https://elevation.arcgis.com/arcgis/rest/services/WorldElevation/TopoBathy/ImageServer/identify?geometry={"x":25,"y":20,"spatialReference":{"wkid":4326}}&geometryType=esriGeometryPoint&mosaicRule=&renderingRule=&pixelSize=&time=&returnGeometry=false&returnCatalogItems=false&f=pjson&token=uJcaxK-Kyaktiq5tMZCmi-9CA4Mcn5BK9_D8UGqSZj_6cvBJSLyuPra7Cs6UeccrtvTQxYK5NDhBbKEdomJ1213F07zeUmhp0FWGbDrBADYAkwhaI5YuTv_qpE1HH6JnWpeXM3yisfuYPjvA4SE6xx..

This returns back:

{

"objectId": 0, "name": "Pixel", "value": "646.8", "location": { "x": 2782987.269831839, "y": 2273030.926987689, "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, "properties": null, "catalogItems": null, "catalogItemVisibilities": [

] }

1
  • geometry request parameter was fiddly to get correct, one that works is geometry=x,y format.
    – Lydon Ch
    Jul 7 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.