@turf/line-distance
@turf/line-distance
npm i @turf/line-distance
Deprecated!
Module deprecated in favor of @turf/length
@turf/line-distance

@turf/line-distance

A modular geospatial engine written in JavaScript

by Turfjs

4.7.3 (see all)License:MITTypeScript:Built-In
npm i @turf/line-distance
Readme

@turf/line-distance

lineDistance

Takes a GeoJSON and measures its length in the specified units, Point's distance are ignored.

Parameters

Examples

var line = turf.lineString([[115, -32], [131, -22], [143, -25], [150, -34]]);
var length = turf.lineDistance(line, 'miles');

//addToMap
var addToMap = [line];
line.properties.distance = length;

Returns number length of GeoJSON


This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.

Installation

Install this module individually:

$ npm install @turf/line-distance

Or install the Turf module that includes it as a function:

$ npm install @turf/turf
VersionTagPublished
4.7.3
latest
5yrs ago
4.7.1
lerna-temp
5yrs ago
3.5.2-alpha.d2c36ee7
canary
6yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate