Skip to main content
Version: Next

along

Description

Takes a LineString and returns a Point at a specified distance along the line.

Parameters

NameTypeDescription
lineFeature<LineString>input line
distancenumberdistance along the line
options?ObjectOptional parameters
options.units?stringcan 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(...);