线性参考(Linear Referencing), 以沿线要素曲线上的相对位置记录事件。如按公路上的车辆数据在地图上分段渲染表示交通的拥堵状况。
图解如下:
沿线测量值为 12 的位置。
沿线的测量标记 10 以东 4 个单位。
线从测量值 18 处开始,到测量值 26 处结束。
线从测量值 28 处开始并延伸 12 个单位。
常用于高速公路、城市街道的拥堵与事故点的表达,铁路、河流、以及地下的水管道和油气管道等位置的跟踪定位与监控等。
用Python实现线性参考
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from shapely.geometry import asShape
import json
import os
from pyproj import Proj, transform
# define the pyproj CRS
# our output CRS
wgs84 = Proj("+init=EPSG:4326")
# output CRS
pseudo_mercator = Proj("+init=EPSG:3857")
def transform_point(in_point, in_crs, out_crs):
"""
export a Shapely geom to GeoJSON Feature and
transform to a new coordinate system with pyproj
:param in_point: shapely g