空间连接 arcgis pro

spatial join arcgis pro

我得到了这个形状文件 Highway1、Highway2、Highway3 等...属性表是相同的,它们包含有关纬度、经度、方向、shape_length 和 speed_allowed 的信息。

我想在 python 中创建一个脚本,允许我在与其他 .例如,如果 Highway1 与 Highway2、Highway12 和 Highway22 相交,我想要 3 个空间连接,每个连接都应包含来自 Highway 1 的所有数据以及与另一条高速公路相交的位置,以便合并该信息,并且在不相交的位置为空值第二高速.

请帮我写一个脚本来自动查找 highway1 是否与其他 highway 相交以及是否相交以进行那种空间连接。

谢谢大家!

请分享可复制的代码示例并查看 https://whosebug.com/help/how-to-ask

但是,您应该在 ESRI Documentation and in the ArcPy Documentation 中找到您需要的内容。尝试他们的代码示例,根据您的需要进行调整,然后您就可以提出更具体的问题。

这里有一个 ESRI's Intersect Docs 的例子:

#Name: VegRoadIntersect.py
# Purpose: Determine the type of vegetation within 100 meters of all stream crossings

# Import system modules
import arcpy

# Set the workspace (to avoid having to type in the full path to the data every time)
arcpy.env.workspace = "c:/data/data.gdb"    

# Process: Find all stream crossings (points)
inFeatures = ["roads", "streams"]
intersectOutput = "stream_crossings"
clusterTolerance = 1.5    
arcpy.Intersect_analysis(inFeatures, intersectOutput, "", clusterTolerance, "point")

# Process: Buffer all stream crossings by 100 meters
bufferOutput = "stream_crossings_100m"
bufferDist = "100 meters"
arcpy.Buffer_analysis(intersectOutput, bufferOutput, bufferDist)

# Process: Clip the vegetation feature class to stream_crossing_100m
clipInput = "vegetation"
clipOutput = "veg_within_100m_of_crossings"
arcpy.Clip_analysis(clipInput, bufferOutput, clipOutput)

# Process: Summarize how much (area) of each type of vegetation is found
# within 100 meter of the stream crossings
statsOutput = "veg_within_100m_of_crossings_stats"
statsFields = [["shape_area", "sum"]]
caseField = "veg_type"
arcpy.Statistics_analysis(clipOutput, statsOutput, statsFields, caseField)