Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

turf-point-grid

Turfjs74.2kMITdeprecated3.0.12

Turf packages are now namespaced: please use @turf/point-grid instead

pointGrid

turf, grid, points, geojson

readme

turf-point-grid

build status

turf.point-grid(extent, depth)

Takes a bounding box and a cell depth and returns a FeatureCollection of Point features in a grid.

Parameters

parameter type description
extent Array.<number> extent in [minX, minY, maxX, maxY] order
depth Number how many cells to output

Example

var extent = [-70.823364, -33.553984, -70.473175, -33.302986];
var depth = 10;

var grid = turf.pointGrid(extent, depth);

//=grid

Returns FeatureCollection, grid as FeatureCollection with Point features

Installation

Requires nodejs.

$ npm install turf-point-grid

Tests

$ npm test