怎样使用普通线要素获取带M值的线要素
怎样查看线要素各个折点上的M值,怎样导出为一张表
线性参照:http://resources.arcgis.com/zh-cn/help/main/10.2/index.html#/na/003900000001000000/
即,例如通常我们使用 xy 坐标系统,这个xy坐标来定位某点在某平面内(相对xy坐标的)位置。
那么如果需要定位的点都在某条线上,使用xy坐标系就有点麻烦了~,这里假设這条线从某一端开始为起点,M值为0,另一端为终点,M值为几何长度(或其他)。那么只要有一个M值,即可定位其在该线上的位置了~此所谓线性参考。
什么是M值:http://resources.arcgis.com/zh-cn/help/main/10.2/index.html#/na/003900000002000000/
测试脚本均由官方示例修改而来。对用户讲解了M值、线性参考等内容。
脚本1
# Name CreateRoutes_Example2.py
# Description: Create routes from lines. The lines are in a shapefile workspace.
# The LENGTH option will be used to set the measures, and a measure factor
# will be used to convert measure units from feet to miles.
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "E:/Test/CreateRoutes_lr/pitt.gdb"
# Set local variables
in_lines = "base_roads.shp"
rid = "route1"
out_routes = "create_output1"
# Execute CreateRoutes
arcpy.CreateRoutes_lr(in_lines, rid, out_routes, "LENGTH", "#", "#", "LOWER_LEFT", 0.00018939394)
脚本2
# Name CreateRoutes_Example3.py
# Description: Create routes from lines. The lines are in a file geodatabase.
# The ONE_FIELD option will be used to set the measures.
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "E:/Test/CreateRoutes_lr/pitt.gdb"
# Set local variables
in_lines = "roads/base_roads" # base_roads exists in the roads feature dataset
rid = "route1"
out_routes = "roads/out_routes" # write the result to the roads feature dataset
# Execute CreateRoutes
arcpy.CreateRoutes_lr(in_lines, rid, out_routes, "LENGTH", "#", "#", "LOWER_LEFT")
怎样查看M值
关于怎样获取保存M值的表
主要工具:http://resources.arcgis.com/zh-cn/help/main/10.2/index.html#//003m00000007000000
通过线要素生成带M值线要素类(路径) base_roads → out_routes
通过线要素获取线上的折点并生成点要素类 out_routes (或者base_road也行) 得到 out_routes_topoint
利用点要素类和带M值线要素类(路径)生成带各点M值的表
out_routes 和 out_routes_topoint 得到 table
可能会用到的工具 route editing
可以标记在路径上任意位置的M值 ,参见帮助文档http://resources.arcgis.com/zh-cn/help/main/10.2/index.html#/na/003900000018000000/