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> | LineStringinput line
distancenumberdistance along the line
options?ObjectOptional parameters (default {})
options.units?Unitscan be degrees, radians, miles, or kilometers (default "kilometers")

Returns

Feature<Point> Point distance units along the line

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(...);