Select to view content in your preferred language

Find elevation at a given lat/long?

2781
1
06-10-2013 11:23 AM
BrianLonsdorf
New Contributor
Hi all,

I'm very new to this, but I've got it all working and it's looking great.

My question is that given a latitude/longitude can I get the elevation?

I found this post: http://blogs.esri.com/esri/arcgis/2009/09/25/finding-the-elevation-at-any-location/

I'm currently trying something like this:

    [map_view zoomToLevel:113 withLat:lat lon:lon animated:YES];
    elevation.text = [NSString stringWithFormat:@"%f", map_view.visibleAreaEnvelope.height];

But I'm worried that it's not giving me accurate information.

Any help would be greatly appreciated. Thanks!

-Brian
0 Kudos
1 Reply
PaulLohr
Frequent Contributor
I think the height value you are trying to call in the block of code below is the height of the map_view object (which inherits from AGSMapView). Pretty sure that's the height of the map's view frame - could be inches or pixels. This is not the same as surface elevation. Probably not what you want.
elevation.text = [NSString stringWithFormat:@"%f", map_view.visibleAreaEnvelope.height];


I looked for a sample that illustrates the use of AGSImageServiceIdentifyTask. I did not find a sample.

Pretty sure this class is the starting point for what you want to do. Check out the link below.
https://developers.arcgis.com/en/ios/api-reference/interface_a_g_s_image_service_identify_result.htm...

Also you will need to find an elevation layer that is appropriate to run the identify operation against.

Perhaps something like the link below. Hopefully the identify operation does not return a JPEG compressed cell value.
http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer

If someone knows of an easier way of getting elevation data I would like to hear your thoughts.

Paul Lohr
0 Kudos