Best way to get data from World Topo Map service

1696
14
Jump to solution
12-19-2013 07:23 AM
DougCollins
Occasional Contributor
I am trying to use the Elevation Layer (either m or ft) from the World Topo Map service (http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer) to get elevation values.  However, this is a Raster layer, and I don't see any way in the JavaScript API to get or query the values.  Maybe I have missed something, and sure would like to know about it.

Everything I have seen so far uses Feature Layers to query or retrieve data.  This is easy to do in ArcMap, but I can't see how to do it using the JavaScript API.

Does anyone have information that would help with this problem?

Thanks for your time!
Charlie
0 Kudos
1 Solution

Accepted Solutions
SteveCole
Frequent Contributor
I think you want to use the IdentifyTask to query the raster (your choice- either the feet or meters service) and retrieve your value that way. Have a map OnClick event and then pass the geometry of the clicked location (make sure they are in Web Mercator projection) to the geometry property of the IdentifyParameters. I think this will return what you're looking for.

Steve

View solution in original post

0 Kudos
14 Replies
JianHuang
Occasional Contributor III
topo map service is only for creating tiled map layer. What you are looking for is elevation profile service, which is a GP service.
This is an old sample service:
http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/P...
I'm not sure about the latest one. Please ask the question on AcGIS REST API forum.
0 Kudos
DougCollins
Occasional Contributor
Jian,
I am not trying to create an elevation profile.  All I want to do is click a point on the map and get the elevation of that point.  It seems like it should be as simple and basic as getting the latitude and longitude of a point on the map.

Layers 1 and 2 of the World Topo Map service indicate that they are Elevation (m) and Elevation (ft).  One would think that this service could be used for getting the elevation.  However, if that is not the case, and the elevation profile service is the answer then how does one get the elevation of a single point?  That service does not seem to provide that.

Thanks,
Charlie
0 Kudos
SteveCole
Frequent Contributor
I think you want to use the IdentifyTask to query the raster (your choice- either the feet or meters service) and retrieve your value that way. Have a map OnClick event and then pass the geometry of the clicked location (make sure they are in Web Mercator projection) to the geometry property of the IdentifyParameters. I think this will return what you're looking for.

Steve
0 Kudos
JianHuang
Occasional Contributor III
If you have an ArcGISImageServiceLayer, identifyTask (after JS API 3.5) can find the pixel value and other related info, which might be the elevation depending on the data. But topo map is a tiled map service.
0 Kudos
DougCollins
Occasional Contributor
Thanks for the info.  I will try the IdentifyTask to see what it provides.

Currently I am using version 3.2 so I won't be able to take advantage of the ArcGISImageServiceLayer yet.  I will need to upgrade other components of my site as well to move to the latest version of the JS API.

Thanks,
Charlie

P.S.  I tried to give both Steve and Jian credit for their answers but it only let's me select one. 😞
0 Kudos
JohnGravois
Frequent Contributor
just to clarify.  the World Topo Map is one of the few tiled map services that i know of that actually exposes a few underlying layers to operations like Identify:

http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/identify?geometryType...

[ATTACH=CONFIG]30076[/ATTACH]
0 Kudos
TammyBearly
New Contributor
As of February 24 when this service was updated, I can no longer identify the elevation.
I was using field name Pixel value for layers 1 and 2. What can I use instead?
0 Kudos
JohnGravois
Frequent Contributor
hi tammy,

it looks like this has been documented.  im not sure of the reason for the change.

i know we have more robust elevation services in beta, but that seems a bit overkill compared to what you were doing before.
0 Kudos
SteveCole
Frequent Contributor
The reason for the change seems quite clear to me- the free ride is over. Just like what happened with routing at the end of last year, ESRI wants to now lock you into paying for these services using ArcGIS Online accounts & credits.

ESRI still provides two elevation globeserver REST endpoints but probably not at the resolution you want:
http://services.arcgisonline.com/arcgis/rest/services/Elevation

Looks like you'll either have to a.) pay for credits & use ESRI's previously free service, b.) load up and serve your own elevation data, or c.) hope that the USGS or other fed agency is already serving up elevation data as a REST service someplace.
0 Kudos