Select to view content in your preferred language

Identify a raster layer not in geoview?

1138
6
06-07-2018 09:43 AM
Mike_Quetel
Frequent Contributor

I can't seem to find a way using the API to identify a layer that is not in a geoview. The specific use case is there is some calculation I need to perform based on a raster dem pixel value and some additional data in a polygon feature layer.  I capture user click location and can easily get the intersecting polygon from the feature layer using a query, but the raster seems like I need to perform an identify to get the pixel value.  The raster is NOT in the map, nor do I want it to be.  I guess my questions are:  If I need a pixel value from a raster... is identify the only way?  If identify is the mechanism... it seems like that is only a method on a geoview. I don't see a way to identify just the raster layer even though that is a capability of the image service itself.  Thanks in advance!

Tags (2)
0 Kudos
6 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Which ArcGIS Runtime .NET API(s) are you using? (UWP, WPF, Android, and/or iOS) 

Cheers

Mike

0 Kudos
Mike_Quetel
Frequent Contributor

Hi, 

I'm using 100.2.1 for WPF.

Thanks,

MQ

0 Kudos
dotMorten_esri
Esri Notable Contributor

Did you look at GetElevationAsync for the Surface class?

Surface.GetElevationAsync Method 

Mike_Quetel
Frequent Contributor

Nope, I was focused on RasterLayer since it seemed like the more generic route to getting a pixel value at an X,Y location.  I'll check this out.  Is there a corollary to GetElevationAsync if the raster I want to query isn't actually a DEM?  Just trying to understand the API a bit better....   Thanks in advance

0 Kudos
dotMorten_esri
Esri Notable Contributor

Not at this point no,

0 Kudos
Mike_Quetel
Frequent Contributor

I've attached code I'm using to get the pixel value from any image service, be it a DEM or other.  It's fairly quick and dirty, assumes the pixel value can be represented as a double and creates an external dependency on json.net.   Perhaps it will be useful to others.