along
Takes a LineString and returns a Point at a specified distance along the line.
Arguments
Argument | Type | Description |
---|---|---|
line | Feature <LineString> | input line |
distance | number | distance along the line |
options | (Object) | Optional parameters: see below |
Options
Prop | Type | Default | Description |
---|---|---|---|
units | string | "kilometers" | can be degrees, radians, miles, or kilometers |
npm install @turf/along
Example
var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]]);
var options = {units: 'miles'};
var along = turf.along(line, 200, options);