1

I have one closed Polyline: "rectangle" and an open Polyline: "line". Both Polylines may be Z aware. What is the best way to find if the "line" intersects the "rectangle" in the XY plane? That is I want a 2D (XY) test for intersection. I do not need the actual coordinates of any intersection(s).

1
  • You need to intersect then and check the output. If they intersect you will get some output, otherwise you will get a null geometry. Jan 24, 2014 at 15:42

1 Answer 1

2

Exemple in VB.NET:

Dim Rel As IRelationalOperator = CType(MyPolygon, IRelationalOperator)
Return Rel.Disjoint(MyPolyline)

I suggest not using ITopologicalOperator.Intersect, because as the ESRI doc says:

Since ArcGIS 9.2, Intersect has a larger cost - it takes longer to run the method. Therefore, it is a better approach to test if the two geometries are disjoint before calling Intersect.

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.