iOS Buffer and Spatial Selection

2409
4
09-27-2011 04:59 PM
DarrenMackiewicz
Occasional Contributor
Can the #Esri iOS API do a buffer on a polygon feature or graphics point - and spatially select the polygon features that the buffer intersects? (Like a traditional Buffer in GIS).

So, not just return a graphic of a distance around a point - Can it actually do the spatial selection ?
0 Kudos
4 Replies
NimeshJarecha
Esri Regular Contributor
Use AGSGeometryEngine methods.

Regards,
Nimesh
0 Kudos
DarrenMackiewicz
Occasional Contributor
Thanks Nimesh

I tried that - I used -bufferGeometry:byDistance:

That still only returned a polygon.
I want to take that polygon and find the parcels below it that it intersects.
Am I on the right path?
0 Kudos
DarrenMackiewicz
Occasional Contributor
Answered my own question.

After getting the buffer geometry, run a spatial selection using a querytask :
mPolygon is the geometry of the buffer I already did.



        //set up query task against layer, specify the delegate
        self.queryTask = [AGSQueryTask queryTaskWithURL:[NSURL URLWithString:countiesLayerURL]];
        self.queryTask.delegate = self;
       
      
        self.query = [AGSQuery query];
        self.query.outFields = [NSArray arrayWithObjects:@"*", nil];
        self.query.returnGeometry = YES;
        self.query.geometry = mPolygon;
        self.query.spatialRelationship = AGSSpatialRelationshipIntersects;
        [self.queryTask executeWithQuery:self.query];
0 Kudos
NimeshJarecha
Esri Regular Contributor
Good to know 🙂
0 Kudos