Verify and repair a geometric network with Python

相关信息
Article ID: 46100
Software:
ArcGIS for Desktop Advanced 10.2.1, 10.3, 10.3.1, 10.2.2
ArcGIS for Desktop Standard 10.2.1, 10.3.1, 10.2.2, 10.3
Platforms: N/A

问题描述
This is a workflow for running the Verify and Repair Connectivity tool with the exhaustive check option in a Python script.
已邀请:

易智瑞技术支持

赞同来自:

解决方案

Please be aware that this process is very resource intensive and an exhaustive check of the geometric network at full extent can take hours. It is therefore recommended to run this overnight or on a weekend.

1. Create a fishnet using the extent of the geometric network. Depending on the size and concentration of the network, choose a number of rows and columns that minimize high concentrations of the network. Be sure to select Polygon as the output geometry. 
Using the fishnet decreases the load for this process because the script is run block-by-block rather than for the whole network all at once. One log file is created for each block in the fishnet.
 
2. From the fishnet, remove any cells where the geometric network does not have data.
3. Use the following sample Python script to loop through the extent of each of the cells to perform a verify and repair. 
import arcpy


grid = r'Database Connections\Connection to GIS_DB.sde\GIS_DB.SDE.Fishnet'

net = r'Database Connections\Connection to GIS_DB.sde\GIS_DB.SDE.NetworkFeatures\GIS_DB.SDE.Water_Net'


rows = arcpy.da.SearchCursor(grid,["OID@","SHAPE@"])


for row in rows:

try:

ext = row[1].extent

logfile = r"C:\TEMP\Water_Fishnet_Test_{0}.txt".format(str(row[0]))

arcpy.VerifyAndRepairGeometricNetworkConnectivity_management(net, logfile, "VERIFY_AND_REPAIR", "EXHAUSTIVE_CHECK", ext)

print str(row[0]) + " done"

except:

print str(row[0]) + " failed"

其它相关参考
  1. Verify and Repair Geometric Network Connectivity
  2. Creating a Fishnet in Desktop 10.3


创建及修改时间
Created: 12/30/2015 Last Modified: 1/5/2016
原文链接
http://support.esri.com/en/kno ... 46100

要回复问题请先登录注册