Takes a bounding box and a cell depth and returns a FeatureCollection of Polygon features in a grid.
parameter | type | description |
---|---|---|
extent |
Array. | extent in [minX, minY, maxX, maxY] order |
cellWidth |
Number | width of each cell |
units |
String | units to use for cellWidth |
var extent = [-77.3876953125,38.71980474264239,-76.9482421875,39.027718840211605];
var cellWidth = 10;
var units = 'miles';
var triangleGrid = turf.triangleGrid(extent, cellWidth, units);
//=triangleGrid
Requires nodejs.
$ npm install turf-triangle-grid
$ npm test