@turf/square-grid
Advanced tools
Comparing version 7.1.0-alpha.7 to 7.1.0-alpha.70
@@ -5,14 +5,16 @@ import { GeoJsonProperties, BBox, Feature, Polygon, MultiPolygon, FeatureCollection } from 'geojson'; | ||
/** | ||
* Creates a square grid from a bounding box. | ||
* Creates a grid of square polygons with cell length consistent in degrees | ||
* | ||
* @name squareGrid | ||
* @param {Array<number>} bbox extent in [minX, minY, maxX, maxY] order | ||
* @param {number} cellSide of each cell, in units | ||
* @param {BBox} bbox extent of grid in [minX, minY, maxX, maxY] order. If the grid does not fill the bbox perfectly, it is centered. | ||
* @param {number} cellSide length of each cell side. | ||
* @param {Object} [options={}] Optional parameters | ||
* @param {string} [options.units='kilometers'] used in calculating cellSide, can be degrees, | ||
* radians, miles, or kilometers | ||
* @param {Units} [options.units='kilometers'] the units of the cellSide value. | ||
* Supports all valid Turf {@link https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md Units}. | ||
* 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. | ||
* @param {Feature<Polygon|MultiPolygon>} [options.mask] if passed a Polygon or MultiPolygon, | ||
* the grid Points will be created only inside it | ||
* @param {Object} [options.properties={}] passed to each point of the grid | ||
* @returns {FeatureCollection<Polygon>} grid a grid of polygons | ||
* @returns {FeatureCollection<Polygon>} a grid of polygons with equal width and height in degrees. | ||
* @example | ||
@@ -19,0 +21,0 @@ * var bbox = [-95, 30 ,-85, 40]; |
{ | ||
"name": "@turf/square-grid", | ||
"version": "7.1.0-alpha.7+0ce6ecca0", | ||
"version": "7.1.0-alpha.70+948cdafaf", | ||
"description": "turf square-grid module", | ||
@@ -55,4 +55,4 @@ "author": "Turf Authors", | ||
"devDependencies": { | ||
"@turf/bbox-polygon": "^7.1.0-alpha.7+0ce6ecca0", | ||
"@turf/truncate": "^7.1.0-alpha.7+0ce6ecca0", | ||
"@turf/bbox-polygon": "^7.1.0-alpha.70+948cdafaf", | ||
"@turf/truncate": "^7.1.0-alpha.70+948cdafaf", | ||
"@types/benchmark": "^2.1.5", | ||
@@ -69,7 +69,8 @@ "@types/tape": "^4.2.32", | ||
"dependencies": { | ||
"@turf/helpers": "^7.1.0-alpha.7+0ce6ecca0", | ||
"@turf/rectangle-grid": "^7.1.0-alpha.7+0ce6ecca0", | ||
"@turf/helpers": "^7.1.0-alpha.70+948cdafaf", | ||
"@turf/rectangle-grid": "^7.1.0-alpha.70+948cdafaf", | ||
"@types/geojson": "^7946.0.10", | ||
"tslib": "^2.6.2" | ||
}, | ||
"gitHead": "0ce6ecca05829690270fec6d6bed2003495fe0ea" | ||
"gitHead": "948cdafaf70606d2e27fcc79973fa48ee1182067" | ||
} |
@@ -7,12 +7,14 @@ # @turf/square-grid | ||
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, | ||
@@ -35,5 +37,5 @@ the grid Points will be created only inside it | ||
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 | ||
@@ -44,3 +46,3 @@ [2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number | ||
[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 | ||
@@ -47,0 +49,0 @@ [5]: https://tools.ietf.org/html/rfc7946#section-3.2 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
14594
50
73
4