提取中心线 (制图)

许可等级:BasicStandardAdvanced

摘要

基于指定的宽度容差从双线要素(如道路轮廓)提取中心线。

插图

Creating centerlines

用法

语法

CollapseDualLinesToCenterline_cartography (in_features, out_feature_class, maximum_width, {minimum_width})
参数说明数据类型
in_features

用于提取中心线的输入双线要素(如道路轮廓)。

Feature Layer
out_feature_class

要创建的输出要素类。

Feature Class
maximum_width

设置用来提取中心线的双线要素的最大宽度。必须指定一个值,且该值必须大于零。可以选择首选单位;默认为要素单位。

Linear unit
minimum_width
(可选)

设置用来提取中心线的双线要素的最小宽度。最小宽度必须大于或等于零,且必须小于最大宽度。默认值为零。可以指定首选单位;默认为要素单位。

Linear unit

代码实例

CollapseDualLinesToCenterline 示例(Python 窗口)

以下 Python 窗口脚本演示了如何在即时模式下使用 CollapseDualLinesToCenterline 工具。

import arcpy
from arcpy import env
import arcpy.cartography as CA
env.workspace = "C:/data"
CA.CollapseDualLinesToCenterline("dual_line_roads.shp", "C:/output/output.gdb/road_centerlines", 50)
CollapseDualLinesToCenterline 示例 2(独立脚本)

以下独立脚本演示了如何使用 CollapseDualLinesToCenterline 工具。

# Name: CollapseDualLinesToCenterline_Example2.py
# Description: Create road centerlines and find buildings within a given distance
# Author: ESRI
 
# Import system modules
import arcpy
from arcpy import env
import arcpy.cartography as CA
import arcpy.management as DM
import arcpy.analysis as AN
 
# Set environment settings
env.workspace = "C:/data/Portland.gdb"
 
# Set local variables
inRoadCasingsFeatures = "road_casings"
inHouseFeatures = "houses"

centerlineFeatures = "C:/data/PortlandOutput.gdb/road_centerlines"
bufferFeatures = "C:/data/PortlandOutput.gdb/road_buffers"

# Create centerlines for road casings.
CA.CollapseDualLinesToCenterline(inRoadCasingsFeatures, centerlineFeatures, 80)
 
# Create buffers 100 units from around centerlines.
AN.Buffer(centerlineFeatures, bufferFeatures, 100)

# Select houses by buffers.
DM.SelectLayerByLocation(inHouseFeatures, "intersect", bufferFeatures, 100)

环境

相关主题

许可信息

ArcGIS for Desktop Basic: 否
ArcGIS for Desktop Standard: 否
ArcGIS for Desktop Advanced: 是
5/10/2014