turf-point-on-line

WebJar for turf-point-on-line

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-point-on-line
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-point-on-line
WebJar for turf-point-on-line
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/turf-junkyard/turf-point-on-line

Download turf-point-on-line

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : turf-bearing jar [3.0.12,4)
org.webjars.npm : turf-destination jar [3.0.12,4)
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-point-on-line

build status

turf.point-on-line (Line, Point)

Takes a Point and a LineString and calculates the closest Point on the LineString

Parameters

parameter type description
Line LineString to snap to
Point Point to snap from

Example

var line = turf.linestring([
      [
        -77.0316696166992,
        38.878605901789236
      ],
      [
        -77.02960968017578,
        38.88194668656296
      ],
      [
        -77.02033996582031,
        38.88408470638821
      ],
      [
        -77.02566146850586,
        38.885821800123196
      ],
      [
        -77.02188491821289,
        38.88956308852534
      ],
      [
        -77.01982498168944,
        38.89236892551996
      ]
    ]);
var pt = turf.point([-77.02544689178467,38.88689075977245]);

var snapped = turf.pointOnLine(line, pt);
//=snapped

Installation

Requires nodejs.

$ npm install turf-point-on-line

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