ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

Convert M-Value Units Of Measure

  • 描述
  • 使用方法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

描述

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.

使用方法

  • This tool is used for the HPMS 2012 models.

    注:

    Any uncalibrated routes in the network receive an m-value of zero (0) after executing this tool; therefore, you should calibrate all the routes in the network before running this tool.

    Learn more about route calibration

语法

arcpy.locref.ConvertMValueUnitsOfMeasure(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.

String
in_target_unit_of_measure

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

String
in_precision

The number of decimals for the target units.

Long

代码示例

ConvertMValueUnitsOfMeasure example 1 (Python window)

The following script demonstrates how to use the ConvertMValueUnitsOfMeasure function in immediate mode.

# Name: ConvertM-ValueUnitsOfMeasure_arcmap.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.

# Import arcpy module
import arcpy

# 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_locref(in_network, in_source_unit_of_measure, in_target_unit_of_measure, in_precision)
ConvertMValueUnitsOfMeasure example 2 (stand-alone script)

The following script demonstrates how to use ConvertMValueUnitsOfMeasure 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.

# 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_locref("network_lyr", "Feet", "Miles", "3")

环境

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

许可信息

  • Basic: 需要 Roads and Highways
  • Standard: 需要 Roads and Highways
  • Advanced: 需要 Roads and Highways

相关主题

  • An overview of the Location Referencing toolbox

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明