Select to view content in your preferred language

How to access elevation values? (Urgent)

3167
4
09-20-2011 07:12 AM
DerekGray
Emerging Contributor
Hi,

I need to access the elevation values from a layer in my map package. What is the recommended way of doing this in the Runtime?

With ArcObjects we used a MosaicRaster class:
1) added in the rasters one at a time, then used a RasterGeometerProc to resample and clip.
2) Then we read it into an IPixelBlock
3) Manipulate the pixel data with regular Java rasters and buffered images.

If the API is not available, is it supported if I connect to the embedded REST server directly?

Thank you,

Derek
0 Kudos
4 Replies
GayleYoung
Esri Contributor
Hi Derek,
it sounds like the basic workflow would be to manipulate your images using Geoprocessing tools. With ArcMap/ArcCatalog you can publish and share tools/models as a Geoprocessing service which returns a MapService result.
The Geoprocessing service is shared to either ArcGIS Runtime (via a geprocessing package .gpk) and/or as an ArcGIS Server GP service. In both cases the Runtime for Java SDK would execute the tool from the service and display the result image from the resulting Map Service.

At Beta 1, the ArcGIS Runtime SDKs do not support raster files as an input to a GP tool/model; but this is something we are looking at providing in a future release.

Can the current GP tools provided with ArcMap/ArcCatalog manipulate the rasters in the way you require?
Take a look at Data Management->Raster tools. In particular Raster Processing. I believe there are clip and resample tools. These could be run sequentially in a GP model.

Currently, you can use the Image Service directly via REST to download raster files.
Thanks for your question,
Gayle.
0 Kudos
DerekGray
Emerging Contributor
Hi Gayle,

1) Can you please clarify what you mean by "in a future release"? Do you mean that GP will be able to accept rasters as input at 10.1 release? or Beta 2?

2) Getting a MapService back from the geoprocessor is no good because I need an ImageService to get the result, right? I need something that retains the elevation values, not RGB values.

3) I could not figure out how to invoke the Image Service. From the runtime I can easily get the MapServer url using LocalMapService. There are also LocalFeatureService and LocalGeoprocessingService classes, but no "LocalImageService" class. If I hand-craft the url to try a ".../ImageServer/exportImage..." request, the browser just returns 400, "unknown operation".

I also see an "ImageServer" class, but its Javadoc is empty and I'm not sure what URL to pass into the constructor...

Or did you mean the image service & url of an existing ArcGIS server? That's not an option for me. I need to get the rasters from the map package.

How should I proceed?

Thanks for your help,

Derek
0 Kudos
GayleYoung
Esri Contributor
Hi Derek,
1) we don't have any definate release planned for that, but it will potentially be included in 10.1.
2) yes if you need the get the elevation values in the client, you will need an ImageService (unless you just need them in a local file without drawing an image, see idea below.)
3) at the moment the Runtime for Java SDK doesn't support ImageService (either from a package or ArcGIS Server service). This is not currently planned for the 10.1 release.

Here's an idea we haven't tried yet. How about writing a GP model which takes the input and output paths of the rasters as a strings (rather than urls to images).
The model could contain python script to do any extra steps you need.

Gayle
0 Kudos
DerekGray
Emerging Contributor
Thank you very much for the clarifications.

I will definitely explore your suggestion. Can the runtime support returning a raster result, even if it doesn't yet support it as an input parameter?

Thanks!
0 Kudos