I am iterating through a set of features returned from an intersecting spatial query along a line. I want to find out the point(s) along the line that all the features intersect (they definitely do intersect!). However when I call the intersect method on ITopologicalOperator, I get an empty geometry returned. Any idea how I can get the proper geometry returned?
Public Shared Function GetPointsOfIntersectingFeatureAlongRoute(routeGeometry As IPolyline, intersectingGeometry As IGeometry) As List(Of IPoint) Dim pnts As List(Of IPoint) = New List(Of IPoint) Dim newp As IPoint = Nothing Dim topoOp As ITopologicalOperator = Nothing Dim geo As IGeometry = Nothing ' intersectingGeometry.Project(routeGeometry.SpatialReference) topoOp = intersectingGeometry geo = topoOp.Intersect(intersectingGeometry, esriGeometryDimension.esriGeometry0Dimension) If geo Is Nothing Then Return pnts 'A Geometry is Returned here.... it's just empty 'geo might be a multi point, in which case the geometry intersects a route more than one. If TypeOf geo Is ESRI.ArcGIS.Geometry.IPointCollection Then Dim mp As IPointCollection = geo For i = 0 To mp.PointCount - 1 'does not enter this loop... because the point count = 0 newp = routeConversionTools.GetPointAlongRouteNearPoint(routeGeometry, mp.Point(i)) If Not newp Is Nothing Then pnts.Add(newp) End If Next i Else Dim p As IPoint = geo newp = routeConversionTools.GetPointAlongRouteNearPoint(routeGeometry, p) pnts.Add(newp) End If Return pnts End Function