# along

Takes a LineString and returns a Point at a specified distance along the line.
获取一个LineString并返回沿该线指定距离的点。

参数

参数 类型 描述
line Feature <LineString> input line
distance number distance along the line
options Object Optional parameters: see below

options选项

属性 类型 默认值 描述
units string kilometers can be degrees, radians, miles, or kilometers

返回

Feature <Point> - Point distance units along the line

示例

var line = turf.lineString([
        [109.502991, 29.68718],
        [108.837829, 32.969237],
        [113.567871, 37.200787]
      ]);
var options = {units: 'miles'};

var along = turf.along(line, 300, options);

npm install @turf/along

Last Updated: 1/19/2021, 10:59:20 AM