AnsweredAssumed Answered

GeometryEngine.Intersection of Polyline and Polyline

Question asked by chazwr on Jun 23, 2016
Latest reply on Jun 23, 2016 by bixb0012

ArcGIS Runtime for .NET 10.2.7

I am using GeometryEngine.Intersect to find the intersection of two Polylines. The GeometryEngine.Intersects function returns the correct value, however, GeometryEngine.Intersection  returns only an empty geometry, not very useful. I expect a MapPoint.
How can I retrieve the intersection point?

 

Polyline p1 = new Polyline(new List<MapPoint>()

{

     new MapPoint(55.0, 25.0, SpatialReferences.Wgs84),

     new MapPoint(57.0, 25.0, SpatialReferences.Wgs84)

});

Polyline p2 = new Polyline(new List<MapPoint>()

{

     new MapPoint(56.0, 24.0, SpatialReferences.Wgs84),

     new MapPoint(56.0, 26.0, SpatialReferences.Wgs84)

});

if( GeometryEngine.Intersects(p1, p2))

{

    var intersection = GeometryEngine.Intersection(p1, p2);

     System.Diagnostics.Trace.WriteLine(intersection.IsEmpty);

}

Outcomes