Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Problems with ITopologicalOperator Cut

$
0
0
I'm thoroughly baffled! I'm using ITopologicalOperator.Cut to cut polyline road segments that cross polyline boundaries.

Code:

            While Not pFeature Is Nothing

                pCuttingPolygonBoundary = ConvertPolygonToPolyline(pFeature.Shape)

                If pCuttingPolygonBoundary.SpatialReference Is Nothing Then
                    pCuttingPolygonBoundary.SpatialReference = pPublicMap.SpatialReference
                End If

                pCuttingPolygonBoundary.SnapToSpatialReference()
                pTopoOp = pCuttingPolygonBoundary
                pTopoOp.IsKnownSimple_2 = False
                pTopoOp.Simplify()

                pSF = New SpatialFilter
                pSF.Geometry = pCuttingPolygonBoundary
                pSF.GeometryField = m_OutputFeatureClass.ShapeFieldName
                pSF.SpatialRel = esriSpatialRelEnum.esriSpatialRelCrosses

                pPolylineFeatureCursor = m_OutputFeatureClass.Search(pSF, False)
                pPolylineFeature = pPolylineFeatureCursor.NextFeature()
                sOIDList = ""

                While Not pPolylineFeature Is Nothing

                    pLeftPolyline = New Polyline
                    pRightPolyline = New Polyline

                    pPolyline = pPolylineFeature.ShapeCopy

                    If pPolyline.SpatialReference Is Nothing Then
                        pPolyline.SpatialReference = pPublicMap.SpatialReference
                    End If

                    pPolyline.Project(pCuttingPolygonBoundary.SpatialReference)
                    pPolyline.SnapToSpatialReference()

                    pTopoOp = pPolyline
                    pTopoOp.IsKnownSimple_2 = False
                    pTopoOp.Simplify()

                    pTopoOp.Cut(pCuttingPolygonBoundary, pLeftPolyline, pRightPolyline)

I then put the resulting left and right polylines into the featureclass and delete the original polyline. It seems to work however when I do a spatial selection using the crossed by the outline selection method some of the polylines are still selected. Its my understanding that the split lines no longer cross the boundary put simply touch it.

Is there something I'm missing?

Viewing all articles
Browse latest Browse all 1374

Trending Articles