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).
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.