要素转线 (数据管理)

许可等级:BasicStandardAdvanced

摘要

创建包含通过以下方式生成的线的要素类:将面边界转换为线,或者分割线、面或在两要素的相交处对两要素进行分割。

插图

Feature To Line illustration

用法

语法

FeatureToLine_management (in_features, out_feature_class, {cluster_tolerance}, {attributes})
参数说明数据类型
in_features
[in_features,...]

输入要素可以是线或面,或是两者兼而有之。

Feature Layer
out_feature_class

输出线要素类。

Feature Class
cluster_tolerance
(可选)

进行空间计算时所有要素坐标之间的最小距离以及坐标可以沿 X 和/或 Y 方向移动的距离。默认 XY 容差设定值为 0.001 米,或者为其等效值(以要素单位表示)。

Linear unit
attributes
(可选)

指定是在输出要素类中保留还是忽略输入属性。

  • ATTRIBUTES在输出要素中保留输入属性。这是默认设置。
  • NO_ATTRIBUTES在输出要素中忽略输入属性。
Boolean

代码实例

FeatureToLine 示例 1(Python 窗口)

下面的 Python 窗口脚本演示了如何在即时模式下使用 FeatureToLine 函数。

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.FeatureToLine_management(["majorrds.shp", "habitat_analysis.gdb/futrds"],
                               "c:/output/output.gdb/allroads",
                               "0.001 Meters", "ATTRIBUTES")
FeatureToLine 示例 2(独立脚本)

下面的独立脚本是如何在脚本环境中应用 FeatureToLine 函数的简单示例。

# Name: FeatureToLine_Example2.py
# Description: Use FeatureToLine function to combine features from two 
#                  street feature classes into a single feature class,
#                  then determine an area of impact around all streets
#                  by buffering

# import system modules 
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

#  Set local variables
oldStreets = "majorrds.shp"
newStreets = "habitat_analysis.gdb/futrds"
uptodateStreets = "c:/output/output.gdb/allroads"

# Use FeatureToLine function to combine features into single feature class
arcpy.FeatureToLine_management([oldStreets, newStreets], uptodateStreets,
                               "0.001 Meters", "ATTRIBUTES")

# Use Buffer function to determine area of impact around streets
roadsBuffer = "c:/output/output.gdb/buffer_output"
arcpy.Buffer_analysis(uptodateStreets, roadsBuffer, "50 Feet",
                      "FULL", "ROUND", "ALL")

环境

相关主题

许可信息

ArcGIS for Desktop Basic:否
ArcGIS for Desktop Standard:否
ArcGIS for Desktop Advanced:是
9/15/2013