3.0.12 • Published 8 years ago
turf-hex-grid v3.0.12
turf-hex-grid
turf.hex-grid(bbox, cellWidth, units)
Takes a bounding box and a cell size in degrees and returns a FeatureCollection of flat-topped hexagons (Polygon features) aligned in an "odd-q" vertical grid as described in Hexagonal Grids
Parameters
parameter | type | description |
---|---|---|
bbox | Array.\<number> | bounding box in minX, minY, maxX, maxY order |
cellWidth | Number | width of cell in specified units |
units | String | used in calculating cellWidth ('miles' or 'kilometers') |
Example
var bbox = [-96,31,-84,40];
var cellWidth = 50;
var units = 'miles';
var hexgrid = turf.hexGrid(bbox, cellWidth, units);
//=hexgrid
Returns FeatureCollection
, units used in calculating cellWidth ('miles' or 'kilometers')
Installation
Requires nodejs.
$ npm install turf-hex-grid
Tests
$ npm test
3.0.12
8 years ago
3.0.10
8 years ago
3.0.7-canary.ae89c8b3
8 years ago
3.0.5
8 years ago
3.0.1
8 years ago
3.0.0-canary.7879bf6c
8 years ago
3.0.0-canary.2f5f7167
8 years ago
2.0.1
9 years ago
2.0.0
9 years ago