thomaslaue

Polygon - line intersection problem

Discussion created by thomaslaue on Jun 4, 2013
Latest reply on Jun 11, 2013 by whe-esristaff
Hello,

I am facing a problem when trying to find intersection points between a donut like polygon and a line using ITopologicalOperator.Intersect method:

   // The polygon has already been casted to ITopologicalOperator4 outside the method
   private static IPointCollection5 ComputeIntersectionPoints(ITopologicalOperator4 topologialOperator, ILine normalLine) {
            object obj = Type.Missing;

            ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;
            segCollection.AddSegment((ISegment)normalLine, ref obj, ref obj);
            IGeometry resultingGeometry = segCollection as IGeometry;

            topologialOperator.Simplify();
            var intersectionPoints = topologialOperator.Intersect(resultingGeometry, esriGeometryDimension.esriGeometry0Dimension);
            return intersectionPoints.IsEmpty ? new Point() as IPointCollection5 : (IPointCollection5)intersectionPoints;
   }


I am receiving a successful intersection (intersection point) on the other boundary of the polygon but I do not get a hit on the interior border (the result of topologialOperator.Intersect(...) is always null). I have attached a sketch showing the situation. The line starts within the polygon and crosses either the exterior or interior border.

Does anyone can tell me why I do not get the second intersection point. Any help would be very much appreciated! Thank you very much!

Outcomes