Convert M-Value Units Of Measure (Roads and Highways)

许可等级:BasicStandardAdvanced

摘要

Converts the measure (m) values of a dataset from one unit to another. The m-values of the input dataset are modified upon executing this tool.

用法

语法

ConvertMValueUnitsOfMeasure_roads (in_network, in_source_unit_of_measure, in_target_unit_of_measure, in_precision)
参数说明数据类型
in_network

The source network feature.

Feature Layer
in_source_unit_of_measure

The unit of measure of the source network layer.

Linear unit
in_target_unit_of_measure

The unit of measure the source network layer values will convert to.

Linear unit
in_precision

The number of decimals for the target units.

Long

代码实例

ConvertMValueUnitsOfMeasure(in-line)

The following script demonstrates how to use the Convert M value Units of Measure function in immediate mode.

# tool variables
in_network="network_lyr"
in_source_unit_of_measure="feet"
in_target_unit_of_measure="miles"
in_precision="3"

# set current workspace
arcpy.env.workspace="C:/Data/NY_Data.gdb/LRSN_MilePoint"

# execute the tool
arcpy.ConvertMValueUnitsOfMeasure_roads("network_lyr", "Feet", "Miles", "3")
ConvertMValueUnitsOfMeasure(stand-alone Python script)

The following python script demonstrates how to use Conver M value Units of Measure in a stand alone python script.

# Name: ConvertM-ValueUnitsOfMeasure.py
# Description: Converts the measure (m) values of a dataset from one unit to another. The m-values of the input dataset are modified upon executing this tool.
# Requires: Esri Roads and Highways Solution

# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("Highways")

# Local variables:
network = r"C:/Data/NY_Data.gdb/LRSN_MilePoint"

# Make a feature layer for network
arcpy.MakeFeatureLayer_management(network, "network_lyr")

# Process: Convert M-value Units Of Measure
arcpy.ConvertMValueUnitsOfMeasure_roads("network_lyr", "Feet", "Miles", "3")

环境

此工具不使用任何地理处理环境

相关主题

许可信息

ArcGIS for Desktop Basic: 需要 Roads and Highways
ArcGIS for Desktop Standard: 需要 Roads and Highways
ArcGIS for Desktop Advanced: 需要 Roads and Highways
4/27/2014