Select to view content in your preferred language

Query by Geometry

2150
2
Jump to solution
02-06-2013 07:52 AM
VIKRANTKRISHNA
Regular Contributor
I am setting up the query geometry as
AGSQuery = [AGSQuery query]; query.geometry = graphic.geometry; query.returnGeometry = TRUE; query.spatialRelationship = AGSGeometryRelationIntersection  [queryTask executeWithQuery:query]; 



If I draw a line, query is done by line envelop. Is it possible to query by exact shape?
0 Kudos
1 Solution

Accepted Solutions
DanaMaher
Regular Contributor
I am setting up the query geometry as
AGSQuery = [AGSQuery query]; query.geometry = graphic.geometry; query.returnGeometry = TRUE; query.spatialRelationship = AGSGeometryRelationIntersection  [queryTask executeWithQuery:query]; 



If I draw a line, query is done by line envelop. Is it possible to query by exact shape?


I think you are using the wrong typedef. AGSGeometryRelationIntersection is enumerated in the AGSGeometryParameters typedef. The spatialRelationship property of AGSQuery uses the AGSSpatialRelationship typepef. If AGSGeometryRelationIntersection and AGSSpatialRelationship are keyed to different integers, which is likely, you are not performing the query you think you are performing.

View solution in original post

0 Kudos
2 Replies
DanaMaher
Regular Contributor
I am setting up the query geometry as
AGSQuery = [AGSQuery query]; query.geometry = graphic.geometry; query.returnGeometry = TRUE; query.spatialRelationship = AGSGeometryRelationIntersection  [queryTask executeWithQuery:query]; 



If I draw a line, query is done by line envelop. Is it possible to query by exact shape?


I think you are using the wrong typedef. AGSGeometryRelationIntersection is enumerated in the AGSGeometryParameters typedef. The spatialRelationship property of AGSQuery uses the AGSSpatialRelationship typepef. If AGSGeometryRelationIntersection and AGSSpatialRelationship are keyed to different integers, which is likely, you are not performing the query you think you are performing.
0 Kudos
VIKRANTKRISHNA
Regular Contributor
Yes, that was it. Thanks!!
0 Kudos