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
Solved! Go to Solution.
topoOp = intersectingGeometry geo = topoOp.Intersect(intersectingGeometry, esriGeometryDimension.esriGeometry0Dimension)
topoOp = intersectingGeometry geo = topoOp.Intersect(intersectingGeometry, esriGeometryDimension.esriGeometry0Dimension)