turf-hex

1.0.2 • Public • Published

turf-hex

build status

turf hex module

turf.hex(bbox, size)

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. bounding box in [minX, minY, maxX, maxY] order
size Number size of cells in degrees

Example

var bbox = [7.2669410, 43.695307, 7.2862529, 43.706476];
var size = 0.001;
 
var hexgrid = turf.hex(bbox, size);
 
//=hexgrid

Installation

Requires nodejs.

$ npm install turf-hex

Tests

$ npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    5
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    5
  • 1.0.1
    1
  • 1.0.0
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i turf-hex

Weekly Downloads

5

Version

1.0.2

License

MIT

Last publish

Collaborators

  • tcql
  • jseppi
  • mourner
  • jvrousseau
  • cspanring
  • cwmma
  • lyzidiamond
  • tmcw
  • morganherlocker