1.1.0 • Published 9 years ago

turf-point-along-line v1.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

turf-point-along-line

turf.line-slice (Point, Point, Line)

Slices a LineString at start and stop Points

Parameters

parametertypedescription
PointPointto start the slice
PointPointto stop the slice
LineLineStringto slice

Example

var line = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [
        -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 start = turf.point([-77.02033996582031, 38.88408470638821]);
var stop = turf.point([-77.02033996582031, 38.88408470638821]);

var sliced = turf.pointAlongLine(start, stop, line);
//=sliced

Installation

Requires nodejs.

$ npm install turf-point-along-line

Tests

$ npm test