Hi,
I want the points on which two polygons are intersecting. As shown in image (circle with red color).
I have tried with GetCrossing() function. But I am getting more points and also not exact points. Please suggest how to get exact points.
Thanks,
Goral
How to get intersection points of two polygons
Hi Goral,
Here attached is the sample shows how to extract the intersecting points of two polygons.
Regards,
Peter
GetIntersectionPointsOfPolygons.zip (12.8 KB)
Hi,
I have gone through given simple. Its giving same problem as I written in previous post. Here with this I have attached my cs file. If you can run it and see it will be helpful.
Thank,
Goral
002_001_frmInstersection.cs (41.8 KB)
Hi Goral,
The reason why it can’t get the intersecting points correctly is that the shape is not projected, please try the following code to get the intersections:
var Points = proj4.ConvertToExternalProjection(f1.GetShape()).GetCrossing(proj4.ConvertToExternalProjection(f2.GetShape()));
foreach (var Points1 in Points.Points)
{
Feature fpoint = new Feature(proj4.ConvertToInternalProjection(Points1));
imCircle1.InternalFeatures.Add(fpoint);
}
Points = proj4.ConvertToExternalProjection(f2.GetShape()).GetCrossing(proj4.ConvertToExternalProjection(f3.GetShape()));
foreach (var Points1 in Points.Points)
{
Feature fpoint = new Feature(proj4.ConvertToInternalProjection(Points1));
imCircle1.InternalFeatures.Add(fpoint);
}
Thanks,
Peter
Hi,
Thanks for reply. As per suggestion its working fine.
Thanks,
Goral
Hi Goral,
Very glad to hear it worked.
Thanks,
Peter