iOS Runtime SDK: read raster data like "pixel inspector" in ArcMap

4035
2
07-28-2014 08:55 AM
MaxFelinger
New Contributor

Hello together,

I searched now for a day and have tried a bunch of things. I have got a tiled map service that provides raster data. Every pixel has a value between 0 and 10. Example url: http://server/arcgis/rest/services/serviceName/MapServer

 

I want to read pixel values of a given circle/polygon.

For example:

- define a polygon

- send request to server

- server return pixel values (that are inside the given polygon)

 

ArcMap has an pixel inspector. Is this possible by using the iOS runtime SDK?

0 Kudos
2 Replies
DiveshGoyal
Esri Regular Contributor

Sounds like you need to publish that raster data as an Image Service (not Map Service). You can display it in your ios app using AGSImageServiceLayer. To get pixel values at a particular location, you'll need to perform an identify operation (using AGSImageServiceIdentifyTask)

0 Kudos
MaxFelinger
New Contributor

I have got created a Mosaic Dataset from raster and published it as an ImageService. I can query points by using AGSImageServiceIdentifyTask ("imageServiceIdentifyTask:operation:didIdentifyWithResult:" get called and I am able to read pixel data by using "result.encodeToJSON").

If I use polygon instead of point (to query pixel values of an area): still getting results for one point (center of given polygon).

Bildschirmfoto 2014-08-04 um 20.14.25.png

The result seems being designed for one point. I want the values from all pixel of an given polygon (just the value ([2]) from all pixel). Is that possible? 

My request parameter:

AGSMutablePolygon *polygon = [[AGSMutablePolygon alloc] initWithSpatialReference:[AGSSpatialReference spatialReferenceWithWKID:3857]];

    [polygon addRingToPolygon];

    [polygon addPointToRing:[AGSPoint pointWithX:895985.419244 y:6847963.511739 spatialReference:[AGSSpatialReference webMercatorSpatialReference]]];

    [polygon addPointToRing:[AGSPoint pointWithX:896887.495854 y:6847963.511739 spatialReference:[AGSSpatialReference webMercatorSpatialReference]]];

    [polygon addPointToRing:[AGSPoint pointWithX:896887.495854 y:6849508.317933 spatialReference:[AGSSpatialReference webMercatorSpatialReference]]];

    [polygon addPointToRing:[AGSPoint pointWithX:895985.419244 y:6849508.317933 spatialReference:[AGSSpatialReference webMercatorSpatialReference]]];

    [polygon addPointToRing:[AGSPoint pointWithX:895985.419244 y:6847963.511739 spatialReference:[AGSSpatialReference webMercatorSpatialReference]]];

AGSPoint *point = [AGSPoint pointWithX:895985.419244 y:6847963.511739 spatialReference:[AGSSpatialReference webMercatorSpatialReference]];

  

AGSImageServiceIdentifyParameters *identifyParams = [[AGSImageServiceIdentifyParameters alloc] init];

identifyParams.geometry = polygon;

  

[self.identifyTask identifyWithParameters:identifyParams];

Did I miss something?

0 Kudos