Is This Content Helpful?
We're glad to know this article was helpful.
When using ArcGIS 9.3 Service Pack 1, validating a geodatabase topology may incorrectly modify the shape of true curves in the data. This issue has been resolved with the ArcGIS 9.3 Service Pack 1 (Desktop, Engine, Server) Topology Validation Patch and an updated ArcGIS 9.3 Service Pack 1 (released on November 24, 2008).
This issue may be experienced if the following four conditions are met:
The following procedures provide code to determine if: 1) the polygon feature classes in the topology have true curves, and 2) there are topology errors containing true curves, which may indicate that the curves were incorrectly altered during the validate process.
Sub ReportCurvedSegmentCount() On Error GoTo EH Dim pTopology As ITopology Dim editor As IEditor Dim id As New UID Dim topologyExtension As ITopologyExtension Dim teID As New UID id = "esriEditor.editor" Set editor = Application.FindExtensionByCLSID(id) teID = "esriEditorExt.TopologyExtension" Set topologyExtension = Application.FindExtensionByCLSID(teID) If topologyExtension.CurrentTopology Is Nothing Then Exit Sub If TypeOf topologyExtension Is IMapTopology Then MsgBox "You must select a geodatabase topology" Exit Sub End If Dim featureClassContainer As IFeatureClassContainer Set featureClassContainer = topologyExtension.CurrentTopology Dim i As Integer For i = 0 To featureClassContainer.ClassCount - 1 Dim curveCount As Long curveCount = 0 Dim featureClass As IFeatureClass Set featureClass = featureClassContainer.Class(i) If featureClass.ShapeType = esriGeometryPolygon Then Dim featCursor As IFeatureCursor Set featCursor = featureClass.Search(Nothing, True) Dim feature As IFeature Set feature = featCursor.NextFeature Do While Not feature Is Nothing Dim segColl As ISegmentCollection Set segColl = feature.ShapeCopy Dim hasCurves As Boolean hasCurves = False segColl.HasNonLinearSegments hasCurves If hasCurves = True Then curveCount = curveCount + 1 End If Set feature = featCursor.NextFeature Loop Debug.Print "Feature class: " & featureClass.AliasName & ", CurveCount: " & curveCount End If Next i MsgBox "Analysis complete", vbOKOnly, "Report Curved Segment Count" Exit Sub EH: MsgBox "Unknown error", vbExclamation, "Report Curved Segment Count" End Sub
If the results indicate that there are true curves in the feature classes in the topology, perform the next steps to determine possible locations where curves may have been altered during validation. The following procedures require that topology rules are in place to find overlapping areas or areas where boundaries should be covered by other boundaries. Code is provided to help identify locations where a true curve is part of a topology error.
Public Sub TopoErrorWithCurve() 'Display topology errors that contain non linear features Dim pTopoUiD As New esriSystem.UID Dim pTopoExt As ITopologyExtension Dim pTopology As ITopology Dim pGeoDS As IGeoDataset Dim pErrorContainer As IErrorFeatureContainer Dim pErrorFeat As IEnumTopologyErrorFeature Dim pTopoErrFeature As ITopologyErrorFeature Dim bNonLinear As Boolean Dim pFeature As IFeature Dim pSc As ISegmentCollection 'get the topo extension pTopoUiD.Value = "esriEditorExt.TopologyExtension" Set pTopoExt = Application.FindExtensionByCLSID(pTopoUiD) 'get the topology Set pTopology = pTopoExt.CurrentTopology Set pGeoDS = pTopology 'get the errors Set pErrorContainer = pTopology Set pErrorFeat = pErrorContainer.ErrorFeaturesByRuleType(pGeoDS.SpatialReference, esriTopologyRuleType.esriTRTAny, Nothing, True, False) 'clear active errors pTopoExt.ClearActiveErrors esriTEEventHint.esriTENone pTopoExt.DelayEvents True bNonLinear = False Set pTopoErrFeature = pErrorFeat.Next 'loop through each error feature Do While Not pTopoErrFeature Is Nothing Set pFeature = pTopoErrFeature If (pFeature.Shape.GeometryType = esriGeometryType.esriGeometryPolyline) Or (pFeature.Shape.GeometryType = esriGeometryType.esriGeometryPolygon) Then Set pSc = pFeature.ShapeCopy pSc.HasNonLinearSegments bNonLinear If bNonLinear Then 'add the error to the inspector pTopoExt.AddActiveError pTopoErrFeature, esriTEEventHint.esriTENone End If End If Set pTopoErrFeature = pErrorFeat.Next Loop pTopoExt.TopologySelectionChanged pTopoExt.DelayEvents False End Sub