along
Description
Takes a LineString and returns a Point at a specified distance along the line.
Parameters
Name | Type | Description |
---|---|---|
line | Feature<LineString> | input line |
distance | number | distance along the line |
options? | Object | Optional parameters |
options.units? | string | can be degrees, radians, miles, or kilometers (default "kilometers") |
Returns
Examples
var line = turf.lineString([
[-83, 30],
[-84, 36],
[-78, 41],
]);
var options = { units: "miles" };
var along = turf.along(line, 200, options);
Installation
$ npm install @turf/along
import { along } from "@turf/along";
const result = along(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.along(...);