1

I am using ArcGIS SDK for .NET and have a graphic overlay defined on my mapview. I added two circles to the map (made with polylines) which overlap. I now need to determine the points at which the two polylines cross.

The GeometryEngine.Intersection() method returns an empty geometry. The GeometryEngine.Crosses() method returns true.

How can I get the points at which the two polylines cross?

Edit: Here is some code that I was trying:

' Get reference to overlay for add operation  
Dim overlay As GraphicsOverlay = Me.ehMapControl.MapView.GraphicsOverlays.Item("NewLocation")  
' Create a graphic object  
Dim myGraphic as Graphic = New Graphic  
' Create a polyline that is a 15 foot circle around "point"  
Dim myEllipseParams As New GeodesicEllipseParameters(point, 15,  LinearUnits.Feet)
myEllipseParams.OutGeometryType = GeometryType.Polyline  
myGraphic.Geometry = GeometryEngine.GeodesicEllipse(myEllipseParams)  
' Add polyline to graphics overlay  
overlay.Graphics.Add(myGraphic)  
' Create a second polyline  
Dim myGraphic2 as graphic = new Graphic  
...  
' Perform an intersection  
Dim intsersect = GeometryEngine.Intersection(myGraphic, myGraphic2)
' Doesn't work (returns an empty geometry)
Dim isCrossing = GeometryEngine.Crosses(myGraphic, myGraphic2)
' Returns true, so the engine knows the two polylines cross
  • Welcome to GIS SE! As a new user be sure to take the Tour. If you include a code snippet (there is a {} button that you can use to format it) you are much more likely to attract potential answerers. – PolyGeo Nov 3 '15 at 1:59
1

I've not used ArcGIS Runtime .NET SDK yet but looking at the Help Crosses tests for a spatial relationship and Intersection creates the geometries. In your code snippet you don't show what you did with myGraphic2, so may be the root of the problem is there?

But looking at the VB code sample for the Intersection method it shows geometry objects being supplied as input parameters, you input Graphic objects. May be their code is failing because of that? Try inputting Geometry objects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.