3.0.12 • Published 8 years ago

turf-triangle-grid v3.0.12

Weekly downloads
11,351
License
MIT
Repository
github
Last release
8 years ago

turf-triangle-grid

build status

turf.triangle-grid(extent, cellWidth, units)

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

Parameters

parametertypedescription
extentArray.extent in minX, minY, maxX, maxY order
cellWidthNumberwidth of each cell
unitsStringunits to use for cellWidth

Example

var extent = [-77.3876953125,38.71980474264239,-76.9482421875,39.027718840211605];
var cellWidth = 10;
var units = 'miles';

var triangleGrid = turf.triangleGrid(extent, cellWidth, units);

//=triangleGrid

Installation

Requires nodejs.

$ npm install turf-triangle-grid

Tests

$ npm test