Skip to content

Commit

Permalink
update all readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
twelch committed Aug 9, 2024
1 parent 52fb34b commit a91a0cf
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 57 deletions.
34 changes: 17 additions & 17 deletions packages/turf-point-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

## pointGrid

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

### Parameters

* `bbox` **[Array][4]<[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 `{}`)
* `bbox` **[BBox][1]** extent of grid in \[minX, minY, maxX, maxY] order
* `cellSide` **[number][2]** the distance between points
* `options` **[Object][3]** 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][3]<([Polygon][8] | [MultiPolygon][9])>?** 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 `{}`)
* `options.units` **Units** the units of the cellSide value. Supports all valid Turf [Units][4] (optional, default `'kilometers'`)
* `options.mask` **[Feature][5]<([Polygon][6] | [MultiPolygon][7])>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
* `options.properties` **[Object][3]** passed to each point of the grid (optional, default `{}`)

### Examples

Expand All @@ -29,25 +29,25 @@ var grid = turf.pointGrid(extent, cellSide, options);
var addToMap = [grid];
```

Returns **[FeatureCollection][2]<[Point][1]>** grid of points
Returns **[FeatureCollection][8]<[Point][9]>** grid of points

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

[2]: https://tools.ietf.org/html/rfc7946#section-3.3
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[3]: https://tools.ietf.org/html/rfc7946#section-3.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
[4]: https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[5]: https://tools.ietf.org/html/rfc7946#section-3.2

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7

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

[9]: https://tools.ietf.org/html/rfc7946#section-3.1.7
[9]: 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 of the module in question (likely index.js or index.ts), and re-run "yarn docs" from the root of the turf project. -->

Expand Down
38 changes: 20 additions & 18 deletions packages/turf-rectangle-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@

## rectangleGrid

Creates a grid of rectangles from a bounding box, [Feature][1] or [FeatureCollection][2].
Creates a grid of rectangular polygons with width and height consistent in degrees

### Parameters

* `bbox` **[Array][3]<[number][4]>** extent in \[minX, minY, maxX, maxY] order
* `cellWidth` **[number][4]** of each cell, in units
* `cellHeight` **[number][4]** of each cell, in units
* `options` **[Object][5]** Optional parameters (optional, default `{}`)
* `bbox` **[BBox][1]** extent of grid in \[minX, minY, maxX, maxY] order. If the grid does not fill the bbox perfectly, it is centered.
* `cellWidth` **[number][2]** width of each cell, in units
* `cellHeight` **[number][2]** height of each cell, in units
* `options` **[Object][3]** Optional parameters (optional, default `{}`)

* `options.units` **[string][6]** units ("degrees", "radians", "miles", "kilometers") that the given cellWidth
and cellHeight are expressed in. Converted at the southern border. (optional, default `'kilometers'`)
* `options.mask` **[Feature][1]<([Polygon][7] | [MultiPolygon][8])>?** if passed a Polygon or MultiPolygon,
* `options.units` **Units** the units of the cell width and height value.
Supports all valid Turf [Units][4].
If you are looking for rectangles with equal width and height in linear units (e.g. kilometers) this is not the module for you.
The cellWidth and cellHeight is converted from units provided to degrees internally, so the width and height of resulting polygons will be consistent only in degrees. (optional, default `'kilometers'`)
* `options.mask` **[Feature][5]<([Polygon][6] | [MultiPolygon][7])>?** if passed a Polygon or MultiPolygon,
the grid Points will be created only inside it
* `options.properties` **[Object][5]** passed to each point of the grid (optional, default `{}`)
* `options.properties` **[Object][3]** passed to each point of the grid (optional, default `{}`)

### Examples

Expand All @@ -33,23 +35,23 @@ var rectangleGrid = turf.rectangleGrid(bbox, cellWidth, cellHeight, options);
var addToMap = [rectangleGrid]
```

Returns **[FeatureCollection][2]<[Polygon][7]>** a grid of polygons
Returns **[FeatureCollection][8]<[Polygon][6]>** a grid of polygons

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

[2]: https://tools.ietf.org/html/rfc7946#section-3.3
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

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

[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[4]: https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md

[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[5]: https://tools.ietf.org/html/rfc7946#section-3.2

[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6

[7]: 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.7
[8]: 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 of the module in question (likely index.js or index.ts), and re-run "yarn docs" from the root of the turf project. -->

Expand Down
18 changes: 10 additions & 8 deletions packages/turf-square-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@

## squareGrid

Creates a square grid from a bounding box.
Creates a grid of square polygons with cell length consistent in degrees

### Parameters

* `bbox` **[Array][1]<[number][2]>** extent in \[minX, minY, maxX, maxY] order
* `cellSide` **[number][2]** of each cell, in units
* `bbox` **[BBox][1]** extent of grid in \[minX, minY, maxX, maxY] order. If the grid does not fill the bbox perfectly, it is centered.
* `cellSide` **[number][2]** length of each cell side.
* `options` **[Object][3]** Optional parameters (optional, default `{}`)

* `options.units` **[string][4]** used in calculating cellSide, can be degrees,
radians, miles, or kilometers (optional, default `'kilometers'`)
* `options.units` **Units** the units of the cellSide value.
Supports all valid Turf [Units][4].
If you are looking for squares with sides of equal lengths in linear units (e.g. kilometers) this is not the module for you.
The cellSide is converted from units provided to degrees internally, so the width and height of resulting polygons will be consistent only in degrees. (optional, default `'kilometers'`)
* `options.mask` **[Feature][5]<([Polygon][6] | [MultiPolygon][7])>?** if passed a Polygon or MultiPolygon,
the grid Points will be created only inside it
* `options.properties` **[Object][3]** passed to each point of the grid (optional, default `{}`)
Expand All @@ -31,15 +33,15 @@ var squareGrid = turf.squareGrid(bbox, cellSide, options);
var addToMap = [squareGrid]
```

Returns **[FeatureCollection][8]<[Polygon][6]>** grid a grid of polygons
Returns **[FeatureCollection][8]<[Polygon][6]>** a grid of polygons with equal width and height in degrees.

[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
[1]: https://tools.ietf.org/html/rfc7946#section-5

[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
[4]: https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md

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

Expand Down
28 changes: 14 additions & 14 deletions packages/turf-triangle-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

## triangleGrid

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

### Parameters

* `bbox` **[Array][2]<[number][3]>** extent in \[minX, minY, maxX, maxY] order
* `cellSide` **[number][3]** dimension of each cell
* `options` **[Object][4]** Optional parameters (optional, default `{}`)
* `bbox` **[BBox][1]** extent of grid in \[minX, minY, maxX, maxY] order
* `cellSide` **[number][2]** dimension of each grid cell. Two triangles are created in each cell.
* `options` **[Object][3]** 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]<[Polygon][1]>?** 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 `{}`)
* `options.units` **Units** used in calculating cellSide. Supports all valid Turf [Units][4] (optional, default `'kilometers'`)
* `options.mask` **[Feature][5]<[Polygon][6]>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
* `options.properties` **[Object][3]** passed to each point of the grid (optional, default `{}`)

### Examples

Expand All @@ -29,19 +29,19 @@ var triangleGrid = turf.triangleGrid(bbox, cellSide, options);
var addToMap = [triangleGrid];
```

Returns **[FeatureCollection][7]<[Polygon][1]>** grid of polygons
Returns **[FeatureCollection][7]<[Polygon][6]>** grid of polygons

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

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

[3]: 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/Object
[4]: https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md

[5]: 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.2
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6

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

Expand Down

0 comments on commit a91a0cf

Please sign in to comment.