open-index/open-npm huggingface dataset:
npm package: @spatial/isolines
Description: turf isolines module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/isolines

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## isolines

Takes a grid [FeatureCollection][1] of [Point][2] features with z-values and an array of
value breaks and generates [isolines][3].

### Parameters

-   `pointGrid` **[FeatureCollection][4]&lt;[Point][5]>** input points
-   `breaks` **[Array][6]&lt;[number][7]>** values of `zProperty` where to draw isolines
-   `options` **[Object][8]** Optional parameters (optional, default `{}`)
    -   `options.zProperty` **[string][9]** the property name in `points` from which z-values will be pulled (optional, default `'elevation'`)
    -   `options.commonProperties` **[Object][8]** GeoJSON properties passed to ALL isolines (optional, default `{}`)
    -   `options.breaksProperties` **[Array][6]&lt;[Object][8]>** GeoJSON properties passed, in order, to the correspondent isoline;
        the breaks array will define the order in which the isolines are created (optional, default `[]`)

### Examples

```javascript
// create a grid of points with random z-values in their properties
var extent = [0, 30, 20, 50];
var cellWidth = 100;
var pointGrid = turf.pointGrid(extent, cellWidth, {units: 'miles'});

for (var i = 0; i < pointGrid.features.length; i++) {
    pointGrid.features[i].properties.temperature = Math.random() * 10;
}
var breaks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

var lines = turf.isolines(pointGrid, breaks, {zProperty: 'temperature'});

//addToMap
var addToMap = [lines];
```

Returns **[FeatureCollection][4]&lt;[MultiLineString][10]>** a FeatureCollection of [MultiLineString][11] features representing isolines

[1]: https://tools.ietf.org/html/rfc7946#section-3.3

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[3]: http://en.wikipedia.org/wiki/Isoline

[4]: https://tools.ietf.org/html/rfc7946#section-3.3

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[10]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[11]: https://tools.ietf.org/html/rfc7946#section-3.1.5

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/isolines
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/kinks
Description: turf kinks module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/kinks

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## kinks

Takes a [linestring][1], [multi-linestring][2], [multi-polygon][3], or [polygon][4] and returns [points][5] at all self-intersections.

### Parameters

-   `featureIn` **[Feature][6]&lt;([LineString][7] \| [MultiLineString][8] \| [MultiPolygon][9] \| [Polygon][10])>** input feature

### Examples

```javascript
var poly = turf.polygon([[
  [-12.034835, 8.901183],
  [-12.060413, 8.899826],
  [-12.03638, 8.873199],
  [-12.059383, 8.871418],
  [-12.034835, 8.901183]
]]);

var kinks = turf.kinks(poly);

//addToMap
var addToMap = [poly, kinks]
```

Returns **[FeatureCollection][11]&lt;[Point][12]>** self-intersections

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[3]: https://tools.ietf.org/html/rfc7946#section-3.1.7

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[6]: https://tools.ietf.org/html/rfc7946#section-3.2

[7]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[8]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[9]: https://tools.ietf.org/html/rfc7946#section-3.1.7

[10]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[11]: https://tools.ietf.org/html/rfc7946#section-3.3

[12]: https://tools.ietf.org/html/rfc7946#section-3.1.2

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/kinks
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/length
Description: turf length module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/length

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## length

Takes a [GeoJSON][1] and measures its length in the specified units, [(Multi)Point][2]'s distance are ignored.

### Parameters

-   `geojson` **[GeoJSON][3]** GeoJSON to measure
-   `options` **[Object][4]** Optional parameters (optional, default `{}`)
    -   `options.units` **[string][5]** can be degrees, radians, miles, or kilometers (optional, default `kilometers`)

### Examples

```javascript
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][6]** length of GeoJSON

[1]: https://tools.ietf.org/html/rfc7946#section-3

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[3]: https://tools.ietf.org/html/rfc7946#section-3

[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/length
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-arc
Description: turf line-arc module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/line-arc

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineArc

Creates a circular arc, of a circle of the given radius and center point, between bearing1 and bearing2;
0 bearing is North of center point, positive clockwise.

### Parameters

-   `center` **[Coord][1]** center point
-   `radius` **[number][2]** radius of the circle
-   `bearing1` **[number][2]** angle, in decimal degrees, of the first radius of the arc
-   `bearing2` **[number][2]** angle, in decimal degrees, of the second radius of the arc
-   `options` **[Object][3]** Optional parameters (optional, default `{}`)
    -   `options.steps` **[number][2]** number of steps (optional, default `64`)
    -   `options.units` **[string][4]** miles, kilometers, degrees, or radians (optional, default `'kilometers'`)

### Examples

```javascript
var center = turf.point([-75, 40]);
var radius = 5;
var bearing1 = 25;
var bearing2 = 47;

var arc = turf.lineArc(center, radius, bearing1, bearing2);

//addToMap
var addToMap = [center, arc]
```

Returns **[Feature][5]&lt;[LineString][6]>** line arc

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.1

[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[5]: https://tools.ietf.org/html/rfc7946#section-3.2

[6]: https://tools.ietf.org/html/rfc7946#section-3.1.4

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-arc
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-chunk
Description: turf line-chunk module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/line-chunk

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineChunk

Divides a [LineString][1] into chunks of a specified length.
If the line is shorter than the segment length then the original line is returned.

### Parameters

-   `geojson` **([FeatureCollection][2] \| [Geometry][3] \| [Feature][4]&lt;([LineString][5] \| [MultiLineString][6])>)** the lines to split
-   `segmentLength` **[number][7]** how long to make each segment
-   `options` **[Object][8]** Optional parameters (optional, default `{}`)
    -   `options.units` **[string][9]** units can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
    -   `options.reverse` **[boolean][10]** reverses coordinates to start the first chunked segment at the end (optional, default `false`)

### Examples

```javascript
var line = turf.lineString([[-95, 40], [-93, 45], [-85, 50]]);

var chunk = turf.lineChunk(line, 15, {units: 'miles'});

//addToMap
var addToMap = [chunk];
```

Returns **[FeatureCollection][2]&lt;[LineString][5]>** collection of line segments

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[2]: https://tools.ietf.org/html/rfc7946#section-3.3

[3]: https://tools.ietf.org/html/rfc7946#section-3.1

[4]: https://tools.ietf.org/html/rfc7946#section-3.2

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[6]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-chunk
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-intersect
Description: turf line-intersect module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/line-intersect

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineIntersect

Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).

### Parameters

-   `line1` **([Geometry][1] \| [FeatureCollection][2] \| [Feature][3]&lt;([LineString][4] \| [MultiLineString][5] \| [Polygon][6] \| [MultiPolygon][7])>)** any LineString or Polygon
-   `line2` **([Geometry][1] \| [FeatureCollection][2] \| [Feature][3]&lt;([LineString][4] \| [MultiLineString][5] \| [Polygon][6] \| [MultiPolygon][7])>)** any LineString or Polygon

### Examples

```javascript
var line1 = turf.lineString([[126, -11], [129, -21]]);
var line2 = turf.lineString([[123, -18], [131, -14]]);
var intersects = turf.lineIntersect(line1, line2);

//addToMap
var addToMap = [line1, line2, intersects]
```

Returns **[FeatureCollection][2]&lt;[Point][8]>** point(s) that intersect both

[1]: https://tools.ietf.org/html/rfc7946#section-3.1

[2]: https://tools.ietf.org/html/rfc7946#section-3.3

[3]: https://tools.ietf.org/html/rfc7946#section-3.2

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7

[8]: https://tools.ietf.org/html/rfc7946#section-3.1.2

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-intersect
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-offset
Description: turf line-offset module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/line-offset

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineOffset

Takes a [line][1] and returns a [line][1] at offset by the specified distance.

### Parameters

-   `geojson` **([Geometry][2] \| [Feature][3]&lt;([LineString][4] \| [MultiLineString][5])>)** input GeoJSON
-   `distance` **[number][6]** distance to offset the line (can be of negative value)
-   `options` **[Object][7]** Optional parameters (optional, default `{}`)
    -   `options.units` **[string][8]** can be degrees, radians, miles, kilometers, inches, yards, meters (optional, default `'kilometers'`)

### Examples

```javascript
var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]], { "stroke": "#F00" });

var offsetLine = turf.lineOffset(line, 2, {units: 'miles'});

//addToMap
var addToMap = [offsetLine, line]
offsetLine.properties.stroke = "#00F"
```

Returns **[Feature][3]&lt;([LineString][4] \| [MultiLineString][5])>** Line offset from the input line

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[2]: https://tools.ietf.org/html/rfc7946#section-3.1

[3]: https://tools.ietf.org/html/rfc7946#section-3.2

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-offset
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-overlap
Description: turf line-overlap module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/line-overlap

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineOverlap

Takes any LineString or Polygon and returns the overlapping lines between both features.

### Parameters

-   `line1` **([Geometry][1] \| [Feature][2]&lt;([LineString][3] \| [MultiLineString][4] \| [Polygon][5] \| [MultiPolygon][6])>)** any LineString or Polygon
-   `line2` **([Geometry][1] \| [Feature][2]&lt;([LineString][3] \| [MultiLineString][4] \| [Polygon][5] \| [MultiPolygon][6])>)** any LineString or Polygon
-   `options` **[Object][7]** Optional parameters (optional, default `{}`)
    -   `options.tolerance` **[number][8]** Tolerance distance to match overlapping line segments (in kilometers) (optional, default `0`)

### Examples

```javascript
var line1 = turf.lineString([[115, -35], [125, -30], [135, -30], [145, -35]]);
var line2 = turf.lineString([[115, -25], [125, -30], [135, -30], [145, -25]]);

var overlapping = turf.lineOverlap(line1, line2);

//addToMap
var addToMap = [line1, line2, overlapping]
```

Returns **[FeatureCollection][9]&lt;[LineString][3]>** lines(s) that are overlapping between both features

[1]: https://tools.ietf.org/html/rfc7946#section-3.1

[2]: https://tools.ietf.org/html/rfc7946#section-3.2

[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[6]: https://tools.ietf.org/html/rfc7946#section-3.1.7

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[9]: https://tools.ietf.org/html/rfc7946#section-3.3

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-overlap
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-segment
Description: turf line-segment module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/line-segment

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineSegment

Creates a [FeatureCollection][1] of 2-vertex [LineString][2] segments from a [(Multi)LineString][2] or [(Multi)Polygon][3].

### Parameters

-   `geojson` **([Geometry][4] \| [FeatureCollection][5] \| [Feature][6]&lt;([LineString][7] \| [MultiLineString][8] \| [MultiPolygon][9] \| [Polygon][10])>)** GeoJSON Polygon or LineString

### Examples

```javascript
var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);
var segments = turf.lineSegment(polygon);

//addToMap
var addToMap = [polygon, segments]
```

Returns **[FeatureCollection][5]&lt;[LineString][7]>** 2-vertex line segments

[1]: https://tools.ietf.org/html/rfc7946#section-3.3

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[3]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[4]: https://tools.ietf.org/html/rfc7946#section-3.1

[5]: https://tools.ietf.org/html/rfc7946#section-3.3

[6]: https://tools.ietf.org/html/rfc7946#section-3.2

[7]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[8]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[9]: https://tools.ietf.org/html/rfc7946#section-3.1.7

[10]: https://tools.ietf.org/html/rfc7946#section-3.1.6

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-segment
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-slice
Description: turf line-slice module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/line-slice

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineSlice

Takes a [line][1], a start [Point][2], and a stop point
and returns a subsection of the line in-between those points.
The start & stop points don't need to fall exactly on the line.

This can be useful for extracting only the part of a route between waypoints.

### Parameters

-   `startPt` **[Coord][3]** starting point
-   `stopPt` **[Coord][3]** stopping point
-   `line` **([Feature][4]&lt;[LineString][5]> | [LineString][5])** line to slice

### Examples

```javascript
var line = turf.lineString([
    [-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 start = turf.point([-77.029609, 38.881946]);
var stop = turf.point([-77.021884, 38.889563]);

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

//addToMap
var addToMap = [start, stop, line]
```

Returns **[Feature][4]&lt;[LineString][5]>** sliced line

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[3]: https://tools.ietf.org/html/rfc7946#section-3.1.1

[4]: https://tools.ietf.org/html/rfc7946#section-3.2

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.4

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-slice
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-slice-along
Description: turf line-slice-along module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/line-slice-along

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineSliceAlong

Takes a [line][1], a specified distance along the line to a start [Point][2],
and a specified  distance along the line to a stop point
and returns a subsection of the line in-between those points.

This can be useful for extracting only the part of a route between two distances.

### Parameters

-   `line` **([Feature][3]&lt;[LineString][4]> | [LineString][4])** input line
-   `startDist` **[number][5]** distance along the line to starting point
-   `stopDist` **[number][5]** distance along the line to ending point
-   `options` **[Object][6]** Optional parameters (optional, default `{}`)
    -   `options.units` **[string][7]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)

### Examples

```javascript
var line = turf.lineString([[7, 45], [9, 45], [14, 40], [14, 41]]);
var start = 12.5;
var stop = 25;
var sliced = turf.lineSliceAlong(line, start, stop, {units: 'miles'});

//addToMap
var addToMap = [line, start, stop, sliced]
```

Returns **[Feature][3]&lt;[LineString][4]>** sliced line

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[3]: https://tools.ietf.org/html/rfc7946#section-3.2

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-slice-along
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-split
Description: turf line-split module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/line-split

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineSplit

Split a LineString by another GeoJSON Feature.

### Parameters

-   `line` **[Feature][1]&lt;[LineString][2]>** LineString Feature to split
-   `splitter` **[Feature][1]&lt;any>** Feature used to split line

### Examples

```javascript
var line = turf.lineString([[120, -25], [145, -25]]);
var splitter = turf.lineString([[130, -15], [130, -35]]);

var split = turf.lineSplit(line, splitter);

//addToMap
var addToMap = [line, splitter]
```

Returns **[FeatureCollection][3]&lt;[LineString][2]>** Split LineStrings

[1]: https://tools.ietf.org/html/rfc7946#section-3.2

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[3]: https://tools.ietf.org/html/rfc7946#section-3.3

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-split
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/line-to-polygon
Description: turf line-to-polygon module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/line-to-polygon

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## lineToPolygon

Converts (Multi)LineString(s) to Polygon(s).

### Parameters

-   `lines` **([FeatureCollection][1] \| [Feature][2]&lt;([LineString][3] \| [MultiLineString][4])>)** Features to convert
-   `options` **[Object][5]** Optional parameters (optional, default `{}`)
    -   `options.properties` **[Object][5]** translates GeoJSON properties to Feature (optional, default `{}`)
    -   `options.autoComplete` **[boolean][6]** auto complete linestrings (matches first & last coordinates) (optional, default `true`)
    -   `options.orderCoords` **[boolean][6]** sorts linestrings to place outer ring at the first position of the coordinates (optional, default `true`)

### Examples

```javascript
var line = turf.lineString([[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]);

var polygon = turf.lineToPolygon(line);

//addToMap
var addToMap = [polygon];
```

Returns **[Feature][2]&lt;([Polygon][7] \| [MultiPolygon][8])>** converted to Polygons

[1]: https://tools.ietf.org/html/rfc7946#section-3.3

[2]: https://tools.ietf.org/html/rfc7946#section-3.2

[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[8]: https://tools.ietf.org/html/rfc7946#section-3.1.7

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/line-to-polygon
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/mask
Description: turf mask module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/mask

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## mask

Takes any type of [polygon][1] and an optional mask and returns a [polygon][1] exterior ring with holes.

### Parameters

-   `polygon` **([FeatureCollection][2] \| [Feature][3]&lt;([Polygon][4] \| [MultiPolygon][5])>)** GeoJSON Polygon used as interior rings or holes.
-   `mask` **[Feature][3]&lt;[Polygon][4]>?** GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used)

### Examples

```javascript
var polygon = turf.polygon([[[112, -21], [116, -36], [146, -39], [153, -24], [133, -10], [112, -21]]]);
var mask = turf.polygon([[[90, -55], [170, -55], [170, 10], [90, 10], [90, -55]]]);

var masked = turf.mask(polygon, mask);

//addToMap
var addToMap = [masked]
```

Returns **[Feature][3]&lt;[Polygon][4]>** Masked Polygon (exterior ring with holes).

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[2]: https://tools.ietf.org/html/rfc7946#section-3.3

[3]: https://tools.ietf.org/html/rfc7946#section-3.2

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.7

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/mask
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/midpoint
Description: turf midpoint module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/midpoint

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## midpoint

Takes two [points][1] and returns a point midway between them.
The midpoint is calculated geodesically, meaning the curvature of the earth is taken into account.

### Parameters

-   `point1` **[Coord][2]** first point
-   `point2` **[Coord][2]** second point

### Examples

```javascript
var point1 = turf.point([144.834823, -37.771257]);
var point2 = turf.point([145.14244, -37.830937]);

var midpoint = turf.midpoint(point1, point2);

//addToMap
var addToMap = [point1, point2, midpoint];
midpoint.properties['marker-color'] = '#f00';
```

Returns **[Feature][3]&lt;[Point][4]>** a point midway between `pt1` and `pt2`

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.1

[3]: https://tools.ietf.org/html/rfc7946#section-3.2

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/midpoint
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/nearest-point
Description: turf nearest-point module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/nearest-point

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## nearestPoint

Takes a reference [point][1] and a FeatureCollection of Features
with Point geometries and returns the
point from the FeatureCollection closest to the reference. This calculation
is geodesic.

### Parameters

-   `targetPoint` **[Coord][2]** the reference point
-   `points` **[FeatureCollection][3]&lt;[Point][4]>** against input point set

### Examples

```javascript
var targetPoint = turf.point([28.965797, 41.010086], {"marker-color": "#0F0"});
var points = turf.featureCollection([
    turf.point([28.973865, 41.011122]),
    turf.point([28.948459, 41.024204]),
    turf.point([28.938674, 41.013324])
]);

var nearest = turf.nearestPoint(targetPoint, points);

//addToMap
var addToMap = [targetPoint, points, nearest];
nearest.properties['marker-color'] = '#F00';
```

Returns **[Feature][5]&lt;[Point][4]>** the closest point in the set to the reference point

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.1

[3]: https://tools.ietf.org/html/rfc7946#section-3.3

[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[5]: https://tools.ietf.org/html/rfc7946#section-3.2

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/nearest-point
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/nearest-point-on-line
Description: turf nearest-point-on-line module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/nearest-point-on-line

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## nearestPointOnLine

Takes a [Point][1] and a [LineString][2] and calculates the closest Point on the (Multi)LineString.

### Parameters

-   `lines` **([Geometry][3] \| [Feature][4]&lt;([LineString][5] \| [MultiLineString][6])>)** lines to snap to
-   `pt` **([Geometry][3] \| [Feature][4]&lt;[Point][7]> | [Array][8]&lt;[number][9]>)** point to snap from
-   `options` **[Object][10]** Optional parameters (optional, default `{}`)
    -   `options.units` **[string][11]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)

### Examples

```javascript
var line = turf.lineString([
    [-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 pt = turf.point([-77.037076, 38.884017]);

var snapped = turf.nearestPointOnLine(line, pt, {units: 'miles'});

//addToMap
var addToMap = [line, pt, snapped];
snapped.properties['marker-color'] = '#00f';
```

Returns **[Feature][4]&lt;[Point][7]>** closest point on the `line` to `point`. The properties object will contain three values: `index`: closest point was found on nth line part, `dist`: distance between pt and the closest point, `location`: distance along the line between start and the closest point.

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[3]: https://tools.ietf.org/html/rfc7946#section-3.1

[4]: https://tools.ietf.org/html/rfc7946#section-3.2

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[6]: https://tools.ietf.org/html/rfc7946#section-3.1.5

[7]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/nearest-point-on-line
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/nearest-point-to-line
Description: turf nearest-point-to-line module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/nearest-point-to-line

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## nearestPointToLine

Returns the closest [point][1], of a [collection][2] of points, to a [line][3].
The returned point has a `dist` property indicating its distance to the line.

### Parameters

-   `points` **([FeatureCollection][4] \| [GeometryCollection][5]&lt;[Point][6]>)** Point Collection
-   `line` **([Feature][7] \| [Geometry][8]&lt;[LineString][9]>)** Line Feature
-   `options` **[Object][10]?** Optional parameters
    -   `options.units` **[string][11]** unit of the output distance property, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
    -   `options.properties` **[Object][10]** Translate Properties to Point (optional, default `{}`)

### Examples

```javascript
var pt1 = turf.point([0, 0]);
var pt2 = turf.point([0.5, 0.5]);
var points = turf.featureCollection([pt1, pt2]);
var line = turf.lineString([[1,1], [-1,1]]);

var nearest = turf.nearestPointToLine(points, line);

//addToMap
var addToMap = [nearest, line];
```

Returns **[Feature][7]&lt;[Point][6]>** the closest point

## pt

Translate Properties to final Point, priorities:
1\. options.properties
2\. inherent Point properties
3\. dist custom properties created by NearestPointToLine

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[2]: https://tools.ietf.org/html/rfc7946#section-3.3

[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[4]: https://tools.ietf.org/html/rfc7946#section-3.3

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.8

[6]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[7]: https://tools.ietf.org/html/rfc7946#section-3.2

[8]: https://tools.ietf.org/html/rfc7946#section-3.1

[9]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/nearest-point-to-line
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/planepoint
Description: turf planepoint module
Author: Turf Authors
Latest version: 2.0.0

# @spatial/planepoint

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## planepoint

Takes a triangular plane as a [Polygon][1]
and a [Point][2] within that triangle and returns the z-value
at that point. The Polygon should have properties `a`, `b`, and `c`
that define the values at its three corners. Alternatively, the z-values
of each triangle point can be provided by their respective 3rd coordinate
if their values are not provided as properties.

### Parameters

-   `point` **[Coord][3]** the Point for which a z-value will be calculated
-   `triangle` **[Feature][4]&lt;[Polygon][5]>** a Polygon feature with three vertices

### Examples

```javascript
var point = turf.point([-75.3221, 39.529]);
// "a", "b", and "c" values represent the values of the coordinates in order.
var triangle = turf.polygon([[
  [-75.1221, 39.57],
  [-75.58, 39.18],
  [-75.97, 39.86],
  [-75.1221, 39.57]
]], {
  "a": 11,
  "b": 122,
  "c": 44
});

var zValue = turf.planepoint(point, triangle);
point.properties.zValue = zValue;

//addToMap
var addToMap = [triangle, point];
```

Returns **[number][6]** the z-value for `interpolatedPoint`

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[3]: https://tools.ietf.org/html/rfc7946#section-3.1.1

[4]: https://tools.ietf.org/html/rfc7946#section-3.2

[5]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/planepoint
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/point-grid
Description: turf point-grid module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/point-grid

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## pointGrid

Creates a [Point][1] grid from a bounding box, [FeatureCollection][2] or [Feature][3].

### Parameters

-   `bbox` **[Array][4]&lt;[number][5]>** extent in [minX, minY, maxX, maxY] order
-   `cellSide` **[number][5]** the distance between points, in units
-   `options` **[Object][6]** Optional parameters (optional, default `{}`)
    -   `options.units` **[string][7]** used in calculating cellSide, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
    -   `options.mask` **[Feature][8]&lt;([Polygon][9] \| [MultiPolygon][10])>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
    -   `options.properties` **[Object][6]** passed to each point of the grid (optional, default `{}`)

### Examples

```javascript
var extent = [-70.823364, -33.553984, -70.473175, -33.302986];
var cellSide = 3;
var options = {units: 'miles'};

var grid = turf.pointGrid(extent, cellSide, options);

//addToMap
var addToMap = [grid];
```

Returns **[FeatureCollection][11]&lt;[Point][12]>** grid of points

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[2]: https://tools.ietf.org/html/rfc7946#section-3.3

[3]: https://tools.ietf.org/html/rfc7946#section-3.2

[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[8]: https://tools.ietf.org/html/rfc7946#section-3.2

[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[10]: https://tools.ietf.org/html/rfc7946#section-3.1.7

[11]: https://tools.ietf.org/html/rfc7946#section-3.3

[12]: https://tools.ietf.org/html/rfc7946#section-3.1.2

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/point-grid
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/point-on-feature
Description: turf point-on-feature module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/point-on-feature

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## pointOnFeature

Takes a Feature or FeatureCollection and returns a [Point][1] guaranteed to be on the surface of the feature.

-   Given a [Polygon][2], the point will be in the area of the polygon
-   Given a [LineString][3], the point will be along the string
-   Given a [Point][1], the point will the same as the input

### Parameters

-   `geojson` **[GeoJSON][4]** any Feature or FeatureCollection

### Examples

```javascript
var polygon = turf.polygon([[
  [116, -36],
  [131, -32],
  [146, -43],
  [155, -25],
  [133, -9],
  [111, -22],
  [116, -36]
]]);

var pointOnPolygon = turf.pointOnFeature(polygon);

//addToMap
var addToMap = [polygon, pointOnPolygon];
```

Returns **[Feature][5]&lt;[Point][6]>** a point on the surface of `input`

[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2

[2]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4

[4]: https://tools.ietf.org/html/rfc7946#section-3

[5]: https://tools.ietf.org/html/rfc7946#section-3.2

[6]: https://tools.ietf.org/html/rfc7946#section-3.1.2

<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install @spatial/point-on-feature
```

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

```sh
$ npm install @turf/turf
```