https://github.com/turfjs/turf-point-grid
Takes a bounding box and a cell depth and outputs a feature collection of points in a grid.
https://github.com/turfjs/turf-point-grid
Last synced: about 1 month ago
JSON representation
Takes a bounding box and a cell depth and outputs a feature collection of points in a grid.
- Host: GitHub
- URL: https://github.com/turfjs/turf-point-grid
- Owner: Turfjs
- License: mit
- Archived: true
- Created: 2014-05-13T13:38:57.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T13:57:50.000Z (about 8 years ago)
- Last Synced: 2025-04-03T17:53:20.555Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DEPRECATED - replaced with [`@turf/point-grid`](https://github.com/Turfjs/turf/tree/master/packages/turf-point-grid)
# turf-point-grid[](http://travis-ci.org/Turfjs/turf-point-grid)
### `turf.point-grid(extent, cellWidth, units)`
Takes a bounding box and a cell depth and returns a set of Point|points in a grid.
### Parameters
| parameter | type | description |
| ----------- | ----------------- | ------------------------------------------------------- |
| `extent` | Array\.\ | extent in [minX, minY, maxX, maxY] order |
| `cellWidth` | Number | the distance across each cell |
| `units` | String | used in calculating cellWidth ('miles' or 'kilometers') |### Example
```js
var extent = [-70.823364, -33.553984, -70.473175, -33.302986];
var cellWidth = 3;
var units = 'miles';var grid = turf.pointGrid(extent, cellWidth, units);
//=grid
```**Returns** `FeatureCollection.`, grid of points
## Installation
Requires [nodejs](http://nodejs.org/).
```sh
$ npm install turf-point-grid
```## Tests
```sh
$ npm test
```