Select to view content in your preferred language

Issues with Spatial Query

439
1
05-20-2010 08:21 AM
AndresOsorio
Deactivated User
Hi

I´m having a problem now with the spatial query. When i select the point or Polyline tool to make a selection on my dynamiclayers, those only work with dynamiclayers that have a Polygon geometry. If you try layers with point or line geometry it doesn´t seems to work.


If anybody knows the way to fix this problem, solve it, deal with it...

Thanks.

Andres Osorio
0 Kudos
1 Reply
BedaKuster
Deactivated User
if you make a spatial query with a MapPoint, this MapPoint must be in the Geometry you want to query. So you can try very long until you reach the correct location to query another MapPoint in your service 😉

1:
You could use a IdentifyTask. There you can specify a tolerance for your MapPoint. But you can't specify a definitionquery, so sometimes you can't use this.

2:
You can make an Envelope out of your MapPoint,

Envelope e  = new Envelope();
e.XMax = mappoint.x + 100;
e.XMin = mappoint.x -100;
e.YMax = mappoint.y + 100;
e.YMin = mappoint.y - 100;

and then specify this new envelope as querygeometry.

not very nice, but works for points.

3:
for polylines, try to set the spatialRelationship to Crosses or something other than Contains. I didn't try it but it should work on this way.

hope it works
0 Kudos