Checks and optionally repairs connectivity.
[Visual Basic .NET] Public Sub CheckAndRepairConnectivity ( _ ByVal checkOnly As Boolean, _ ByVal logFilePath As String, _ ByRef errorSelectionSets As ISet, _ ByRef hasInternalInconsistencies As Boolean, _ ByVal RepairConnectivityProgress As IRepairConnectivityProgress _ )
[C#] public void CheckAndRepairConnectivity ( bool checkOnly, string logFilePath, ref ISet errorSelectionSets, ref bool hasInternalInconsistencies, ref IRepairConnectivityProgress RepairConnectivityProgress );
[C++]
HRESULT CheckAndRepairConnectivity(
VARIANT_BOOL checkOnly,
BSTR logFilePath,
ISet** errorSelectionSets,
VARIANT_BOOL* hasInternalInconsistencies,
IRepairConnectivityProgress* RepairConnectivityProgress
);
[C++]Parameters
checkOnly [in] checkOnly is a parameter of type VARIANT_BOOL logFilePath [in] logFilePath is a parameter of type BSTR errorSelectionSets [out]errorSelectionSets is a parameter of type ISet
hasInternalInconsistencies [out] hasInternalInconsistencies is a parameter of type VARIANT_BOOL RepairConnectivityProgress [in]RepairConnectivityProgress is a parameter of type IRepairConnectivityProgress
Product Availability
Description
The CheckandRepairConnectivity method will check for and optionally repair an assortment of connectivity errors within a geometric network. In contrast to RebuildConnectivity2, CheckandRepairConnectivity will only repair those features who have been identified as having inconsistent connectivity.
For a geometric network in a Personal or File Geodatabase, CheckandRepairConnectivity will work against the entire geometric network. For geometric networks in an ArcSDE Geodatabase, CheckandRepairConnectivity will work against the geometric network connectivity within the version currently being edited. Types of network inconsistencies that CheckandRepairConnectivity will discover and repair include:
- network features missing element IDs
- network features with more than 1 element ID
- an element ID that references a deleted feature
- inconsistent connectivity
CheckandRepairConnectivity takes five mandatory arguments. The first, checkOnly is a boolean that specifies whether errors will be repaired or not. A value of False designates that errors are corrected. If True is specified CheckandRepairConnectivity will run in Check Only mode in which errors will be discovered but not repaired.
The second argument dictates whether CheckandRepairConnectivity will produce a log file listing the feature class and Object ID of all the network errors that were discovered and repaired. For a geometric network called, 'MyNetwork' and a supplied path of 'D:\Temp\Logifles\' the logfilePath arguement would appear as; "D:\Temp\Logifles\MyNetwork.txt". To run CheckandRepairConnectivity with no log file, specify an empty string for the logfilePath argument.
The third argument is a Set object that contains references to repaired features. errorSelectionSets can be used to determine if any features were found to have inconsistencies and repaired. The set object will contain a reference to each feature class which contains repaired features.
The fourth argument is a boolean which returns the state of the logical network. If the logical network contains internal inconsistencies, that is, inconsistencies which do not reference existing features within the geometric network, hasInternalInconsistencies will return True, otherwise, it will return False.
The fifth argumnt is an IRepairConnectivityProgress object that is used to retrieve any warnings generated by CheckandRepairConnectivity. During the process of repairing network connectivity, CheckandRepairConnectivity may perform actions that discover network features that require further review. If any warnings are encountered during repair of the network, they can be accessed using IRepairConnectivityProgress::Warnings. The type of warning, feature class and Object ID of the feature is included. Types of warnings include:
- creation of new orphan junctions
- invalid geometries
- coincident junctions
- coincident vertices