An open API service indexing awesome lists of open source software.

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.

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

[![build status](https://secure.travis-ci.org/Turfjs/turf-point-grid.png)](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
```