Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/rectangle-grid

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/rectangle-grid - npm Package Compare versions

Comparing version 7.1.0-alpha.7 to 7.1.0-alpha.70

14

dist/esm/index.d.ts

@@ -5,11 +5,13 @@ import { GeoJsonProperties, BBox, Feature, Polygon, MultiPolygon, FeatureCollection } from 'geojson';

/**
* Creates a grid of rectangles from a bounding box, {@link Feature} or {@link FeatureCollection}.
* Creates a grid of rectangular polygons with width and height consistent in degrees
*
* @name rectangleGrid
* @param {Array<number>} bbox extent in [minX, minY, maxX, maxY] order
* @param {number} cellWidth of each cell, in units
* @param {number} cellHeight 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} cellWidth width of each cell, in units
* @param {number} cellHeight height of each cell, in units
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] units ("degrees", "radians", "miles", "kilometers") that the given cellWidth
* and cellHeight are expressed in. Converted at the southern border.
* @param {Units} [options.units='kilometers'] the units of the cell width and height 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 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.
* @param {Feature<Polygon|MultiPolygon>} [options.mask] if passed a Polygon or MultiPolygon,

@@ -16,0 +18,0 @@ * the grid Points will be created only inside it

{
"name": "@turf/rectangle-grid",
"version": "7.1.0-alpha.7+0ce6ecca0",
"version": "7.1.0-alpha.70+948cdafaf",
"description": "turf rectangle-grid module",

@@ -58,4 +58,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",

@@ -73,8 +73,9 @@ "@types/tape": "^4.2.32",

"dependencies": {
"@turf/boolean-intersects": "^7.1.0-alpha.7+0ce6ecca0",
"@turf/distance": "^7.1.0-alpha.7+0ce6ecca0",
"@turf/helpers": "^7.1.0-alpha.7+0ce6ecca0",
"@turf/boolean-intersects": "^7.1.0-alpha.70+948cdafaf",
"@turf/distance": "^7.1.0-alpha.70+948cdafaf",
"@turf/helpers": "^7.1.0-alpha.70+948cdafaf",
"@types/geojson": "^7946.0.10",
"tslib": "^2.6.2"
},
"gitHead": "0ce6ecca05829690270fec6d6bed2003495fe0ea"
"gitHead": "948cdafaf70606d2e27fcc79973fa48ee1182067"
}

@@ -7,16 +7,18 @@ # @turf/rectangle-grid

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][7]<([Polygon][8] | [MultiPolygon][9])>?** 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 `{}`)

@@ -37,24 +39,20 @@ ### Examples

Returns **[FeatureCollection][10]<[Polygon][8]>** 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.2
[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
[10]: 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. -->

@@ -61,0 +59,0 @@

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc