open-index/open-npm huggingface dataset:
npm package: @spatial/transform-scale
Description: turf transform-scale module
Author: Turf Authors
Latest version: 1.0.5

# @spatial/transform-scale

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

## transformScale

Scale a GeoJSON from a given point by a factor of scaling (ex: factor=2 would make the GeoJSON 200% larger).
If a FeatureCollection is provided, the origin point will be calculated based on each individual Feature.

### Parameters

-   `geojson` **[GeoJSON][1]** GeoJSON to be scaled
-   `factor` **[number][2]** of scaling, positive or negative values greater than 0
-   `options` **[Object][3]** Optional parameters (optional, default `{}`)
    -   `options.origin` **([string][4] \| [Coord][5])** Point from which the scaling will occur (string options: sw/se/nw/ne/center/centroid) (optional, default `'centroid'`)
    -   `options.mutate` **[boolean][6]** allows GeoJSON input to be mutated (significant performance increase if true) (optional, default `false`)

### Examples

```javascript
var poly = turf.polygon([[[0,29],[3.5,29],[2.5,32],[0,29]]]);
var scaledPoly = turf.transformScale(poly, 3);

//addToMap
var addToMap = [poly, scaledPoly];
scaledPoly.properties = {stroke: '#F00', 'stroke-width': 4};
```

Returns **[GeoJSON][1]** scaled GeoJSON

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

[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.1.1

[6]: 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/transform-scale
```

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

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

# @spatial/transform-translate

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

## transformTranslate

Moves any geojson Feature or Geometry of a specified distance along a Rhumb Line
on the provided direction angle.

### Parameters

-   `geojson` **[GeoJSON][1]** object to be translated
-   `distance` **[number][2]** length of the motion; negative values determine motion in opposite direction
-   `direction` **[number][2]** of the motion; angle from North in decimal degrees, positive clockwise
-   `options` **[Object][3]** Optional parameters (optional, default `{}`)
    -   `options.units` **[string][4]** in which `distance` will be express; miles, kilometers, degrees, or radians (optional, default `'kilometers'`)
    -   `options.zTranslation` **[number][2]** length of the vertical motion, same unit of distance (optional, default `0`)
    -   `options.mutate` **[boolean][5]** allows GeoJSON input to be mutated (significant performance increase if true) (optional, default `false`)

### Examples

```javascript
var poly = turf.polygon([[[0,29],[3.5,29],[2.5,32],[0,29]]]);
var translatedPoly = turf.transformTranslate(poly, 100, 35);

//addToMap
var addToMap = [poly, translatedPoly];
translatedPoly.properties = {stroke: '#F00', 'stroke-width': 4};
```

Returns **[GeoJSON][1]** the translated GeoJSON object

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

[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://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/transform-translate
```

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

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

# @spatial/triangle-grid

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

## triangleGrid

Takes a bounding box and a cell depth and returns a set of triangular [polygons][1] in a grid.

### Parameters

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

### Examples

```javascript
var bbox = [-95, 30 ,-85, 40];
var cellSide = 50;
var options = {units: 'miles'};

var triangleGrid = turf.triangleGrid(bbox, cellSide, options);

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

Returns **[FeatureCollection][9]&lt;[Polygon][7]>** grid of polygons

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

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

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

[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://tools.ietf.org/html/rfc7946#section-3.2

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

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

[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/triangle-grid
```

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

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

# @spatial/truncate

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

## truncate

Takes a GeoJSON Feature or FeatureCollection and truncates the precision of the geometry.

### Parameters

-   `geojson` **[GeoJSON][1]** any GeoJSON Feature, FeatureCollection, Geometry or GeometryCollection.
-   `options` **[Object][2]** Optional parameters (optional, default `{}`)
    -   `options.precision` **[number][3]** coordinate decimal precision (optional, default `6`)
    -   `options.coordinates` **[number][3]** maximum number of coordinates (primarly used to remove z coordinates) (optional, default `3`)
    -   `options.mutate` **[boolean][4]** allows GeoJSON input to be mutated (significant performance increase if true) (optional, default `false`)

### Examples

```javascript
var point = turf.point([
    70.46923055566859,
    58.11088890802906,
    1508
]);
var options = {precision: 3, coordinates: 2};
var truncated = turf.truncate(point, options);
//=truncated.geometry.coordinates => [70.469, 58.111]

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

Returns **[GeoJSON][1]** layer with truncated geometry

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

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

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

[4]: 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/truncate
```

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

```sh
$ npm install @turf/turf
```
npm package: @spatial/turf
Description: a JavaScript library for performing geospatial operations with GeoJSON
Author: Turf Authors
Latest version: 1.0.5

# @spatial/turf

# turf

Turf is a modular geospatial analysis engine written in JavaScript. It performs geospatial
processing tasks with GeoJSON data and can be run on a server or in a browser.

<!-- 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/turf
```

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

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

# @spatial/union

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

## union

Takes two or more [polygons][1] and returns a combined polygon. If the input polygons are not contiguous, this function returns a [MultiPolygon][2] feature.

### Parameters

-   `A` **...[Feature][3]&lt;[Polygon][4]>** polygon to combine

### Examples

```javascript
var poly1 = turf.polygon([[
    [-82.574787, 35.594087],
    [-82.574787, 35.615581],
    [-82.545261, 35.615581],
    [-82.545261, 35.594087],
    [-82.574787, 35.594087]
]], {"fill": "#0f0"});
var poly2 = turf.polygon([[
    [-82.560024, 35.585153],
    [-82.560024, 35.602602],
    [-82.52964, 35.602602],
    [-82.52964, 35.585153],
    [-82.560024, 35.585153]
]], {"fill": "#00f"});

var union = turf.union(poly1, poly2);

//addToMap
var addToMap = [poly1, poly2, union];
```

Returns **[Feature][3]&lt;([Polygon][4] \| [MultiPolygon][5])>** a combined [Polygon][1] or [MultiPolygon][2] feature

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

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

[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/union
```

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

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

# @spatial/unkink-polygon

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

## unkinkPolygon

Takes a kinked polygon and returns a feature collection of polygons that have no kinks.
Uses [simplepolygon][1] internally.

### Parameters

-   `geojson` **([FeatureCollection][2] \| [Feature][3]&lt;([Polygon][4] \| [MultiPolygon][5])>)** GeoJSON Polygon or MultiPolygon

### Examples

```javascript
var poly = turf.polygon([[[0, 0], [2, 0], [0, 2], [2, 2], [0, 0]]]);

var result = turf.unkinkPolygon(poly);

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

Returns **[FeatureCollection][2]&lt;[Polygon][4]>** Unkinked polygons

[1]: https://github.com/mclaeysb/simplepolygon

[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/unkink-polygon
```

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

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

# @spatial/voronoi

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

## voronoi

Takes a FeatureCollection of points, and a bounding box, and returns a FeatureCollection
of Voronoi polygons.

The Voronoi algorithim used comes from the d3-voronoi package.

### Parameters

-   `points` **[FeatureCollection][1]&lt;[Point][2]>** to find the Voronoi polygons around.
-   `options` **[Object][3]** Optional parameters (optional, default `{}`)
    -   `options.bbox` **[Array][4]&lt;[number][5]>** clipping rectangle, in [minX, minY, maxX, MaxY] order. (optional, default `[-180,-85,180,-85]`)

### Examples

```javascript
var options = {
  bbox: [-70, 40, -60, 60]
};
var points = turf.randomPoint(100, options);
var voronoiPolygons = turf.voronoi(points, options);

//addToMap
var addToMap = [voronoiPolygons, points];
```

Returns **[FeatureCollection][1]&lt;[Polygon][6]>** a set of polygons, one per input point.

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

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

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

[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://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/voronoi
```

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

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