How can I find the points that are inside the drawed polygon or outside it?
Finding the points that are inside the drawed polygon or outside
Ayhan,
Thanks for your post!
Hopefully my following reference codes can give you some helps!
Get features inside a polygon, citisLayer contains all the Points data, the Ringshape can be a PolyonShape to query or any kinds of shape.
citiesLayer.Open();
//This is for intersectings
Collection<Feature> possibleFeatures = citiesLayer.QueryTools.GetFeaturesIntersecting(ringShape, ReturningColumnsType.AllColumns);
citiesLayer.Close();
Get features outside a polygon, citisLayer contains all the Points data, the Ringshape can be a PolyonShape to query or any kinds of shape.
citiesLayer.Open();
Collection<Feature> possibleFeatures = new Collection<Feature>();
Collection<Feature> possibleFeaturesInsideBoundingBox = citiesLayer.QueryTools.GetAllFeatures(ReturningColumnsType.AllColumns);
foreach (Feature feature in possibleFeaturesInsideBoundingBox)
{
if(ringShape.IsDisjointed(feature.GetShape()))
{
possibleFeatures.Add(feature);
}
}
citiesLayer.Close();
Any more questions just let me know.
Thanks
Yale
Thank you very much Yale
You are welcome, Ayhan!
Any more questions just let me know.
Yale