ThinkGeo.com    |     Documentation    |     Premium Support

Functions to Detect Spatial Conflicts

Hi,


Does anybody know if we have any functions to detect spatial conflicts? For example, one area is overlapping another area.


Thanks,


Wilson Jiang



 


Hi Wison,
To check whether there are other shapes in the area of another shape, I think we can check the intersection between two shapes. Here as following is the demo code:
 

BaseShape shape1 = BaseShape.CreateShapeFromWellKnownData("POLYGON((10 60,40 70,30 85, 10 60))");
BaseShape shape2 = BaseShape.CreateShapeFromWellKnownData("LINESTRING(60 60, 70 70,75 60, 80 70, 85 60,95 80)");
// check the conflict between shapes
bool isIntersected = shape1.Intersects(shape2);


Also you can refer to the installation sample “Samples/ QueryingFeatureLayers/ SpatialQueryAFeatureLayer.aspx” for detail.
 
Thanks,
Johnny