6.5.0 • Published 16 days ago
@turf/length v6.5.0
@turf/length
length
Takes a GeoJSON and measures its length in the specified units, (Multi)Point's distance are ignored.
Parameters
geojson
Feature<(LineString | MultiLineString)> GeoJSON to measureoptions
Object Optional parameters (optional, default{}
)options.units
string can be degrees, radians, miles, or kilometers (optional, defaultkilometers
)
Examples
var line = turf.lineString([[115, -32], [131, -22], [143, -25], [150, -34]]);
var length = turf.length(line, {units: '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/length
Or install the Turf module that includes it as a function:
$ npm install @turf/turf
7.0.0-alpha.114
16 days ago
7.0.0-alpha.113
2 months ago
7.0.0-alpha.111
2 months ago
7.0.0-alpha.110
3 months ago
7.0.0-alpha.1
6 months ago
7.0.0-alpha.2
6 months ago
7.0.0-alpha.0
1 year ago
6.5.0
3 years ago
6.4.0
3 years ago
6.3.0
3 years ago
6.2.0
3 years ago
6.2.0-alpha.3
3 years ago
6.2.0-alpha.2
4 years ago
6.2.0-alpha.1
4 years ago
6.2.0-alpha.0
4 years ago
6.0.2
6 years ago
6.0.1
6 years ago
6.0.0
6 years ago
5.1.5
6 years ago
5.1.0
6 years ago
5.0.4
6 years ago
5.0.0
6 years ago