best365足球-365betvip-mobile365体育投注

简约 · 精致 · 专注内容

创建拓扑

创建拓扑

使用地理处理工具创建拓扑ArcToolbox 包含一系列用于拓扑的地理处理工具。 拓扑工具集位于“数据管理”工具箱中。

这些工具可用于编写脚本来创建和修改地理数据库拓扑。 脚本可用于自动执行一系列任务和构建可重复工作流。

要使用创建拓扑工具创建拓扑,请完成以下步骤:

选择将参与拓扑的要素类。 使用向拓扑中添加要素类地理处理工具将这些要素类添加到拓扑当中。多次运行此工具,直到添加了您希望参与拓扑的所有要素类为止。

现在,您已创建拓扑并向其中添加了一些要素类,随后可以使用向拓扑中添加规则地理处理工具添加一系列规则。 拓扑规则可帮助您构造要素间的空间关系以控制和验证要素共享几何的方式。您可能还需要多次运行此工具,直到向拓扑中添加完所有所需的拓扑规则为止。

现在,您已在要素数据集中设置一个新拓扑,其中包含参与的要素类和拓扑规则。 如果要素类中含有数据,则可以使用验证拓扑地理处理工具来验证拓扑。

以下为独立 Python 脚本示例,您可使用该脚本创建拓扑并向拓扑中添加多个要素类和规则:

可使用此独立 Python 脚本创建拓扑、添加多个要素类和规则以及验证拓扑。

import arcpy

import os

# Input variables

input_dataset = r"C:\MyProjects\MyProject.gdb\fds"

topo_name = "Topology"

cluster_tol = 0.001

input_fc = r"C:\MyProjects\MyProject.gdb\fds\fc1 1 1;C:\MyProjects\MyProject.gdb\fds\fc2 1 1"

rules = r"'Must Not Overlap (Area)' C:\MyProjects\MyProject.gdb\fds\fc1 # C:\MyProjects\MyProject.gdb\fds\fc1 #;'Must Be Covered By Feature Class Of (Area-Area)' C:\MyProjects\MyProject.gdb\fds\fc1 # C:\MyProjects\MyProject.gdb\fds\fc2 #"

validate = "true"

# Create the topology

out_topo = arcpy.CreateTopology_management(input_dataset, topo_name, cluster_tol)

print("Created topology.")

# Loop through the list of feature classes and add them to the topology

input_fcL = input_fc.split(";")

for fc in input_fcL:

param = fc.rsplit(" ", 2)

in_fc = param[0]

xy_rank = param[1]

z_rank = param[2]

arcpy.AddFeatureClassToTopology_management(out_topo, in_fc, xy_rank, z_rank)

print(arcpy.GetMessages())

# Loop through the list of rules and add rules to the topology

rulesL = rules.split(";")

for rule in rulesL:

r = rule.rsplit(" ", 4)

rule_type = r[0].replace("'","")

in_fc1 = r[1]

subtype1 = r[2]

in_fc2 = r[3]

subtype2 = r[4]

arcpy.AddRuleToTopology_management(out_topo, rule_type, in_fc1, subtype1, in_fc2, subtype2)

print(arcpy.GetMessages())

# Validate the topology

if validate == "true":

try:

arcpy.ValidateTopology_management(out_topo)

except:

print(arcpy.GetMessages())

print("Finished.")

相关推荐

剑圣新手出装顺序 最全面的剑圣装备推荐
全球学术快报首页

全球学术快报首页

365betvip 10-16
宽带ADSL猫指示灯含义及不亮问题解答
买电动车去哪个网站?网上买电动车,哪个平台好?
LOL职业选手的训练秘籍(从技能到心态,全方位解析)
联想A308T

联想A308T

best365足球 08-07