turf-line-distance

WebJar for turf-line-distance

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-line-distance
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-line-distance
WebJar for turf-line-distance
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/turf-junkyard/turf-line-distance

Download turf-line-distance

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/turf-line-distance/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>turf-line-distance</artifactId>
    <version>3.0.12</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/turf-line-distance/
implementation 'org.webjars.npm:turf-line-distance:3.0.12'
// https://jarcasting.com/artifacts/org.webjars.npm/turf-line-distance/
implementation ("org.webjars.npm:turf-line-distance:3.0.12")
'org.webjars.npm:turf-line-distance:jar:3.0.12'
<dependency org="org.webjars.npm" name="turf-line-distance" rev="3.0.12">
  <artifact name="turf-line-distance" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='turf-line-distance', version='3.0.12')
)
libraryDependencies += "org.webjars.npm" % "turf-line-distance" % "3.0.12"
[org.webjars.npm/turf-line-distance "3.0.12"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : turf-distance jar [3.0.12,4)
org.webjars.npm : turf-helpers jar [3.0.12,4)

Project Modules

There are no modules declared in this project.

turf-line-distance

build status

turf-line-distance ---

turf.line-distance(line, units)

Takes a LineString|line and measures its length in the specified units.

Parameters

parameter type description
line Feature.<LineString> line to measure
units String can be degrees, radians, miles, or kilometers

Example

var line = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [-77.031669, 38.878605],
      [-77.029609, 38.881946],
      [-77.020339, 38.884084],
      [-77.025661, 38.885821],
      [-77.021884, 38.889563],
      [-77.019824, 38.892368]
    ]
  }
};

var length = turf.lineDistance(line, 'miles');

//=line

//=length

Returns Number, length of the input line

Installation

Requires nodejs.

$ npm install turf-line-distance

Tests

$ npm test
org.webjars.npm

deprecated turf modules: do not use or reference, for redirects only

turf is now a monorepo: all turf modules are in Turfjs/turf

Versions

Version
3.0.12