turf-hex-grid

WebJar for turf-hex-grid

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-hex-grid
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-hex-grid
WebJar for turf-hex-grid
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/turf-junkyard/turf-hex-grid

Download turf-hex-grid

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/turf-hex-grid/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>turf-hex-grid</artifactId>
    <version>3.0.12</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/turf-hex-grid/
implementation 'org.webjars.npm:turf-hex-grid:3.0.12'
// https://jarcasting.com/artifacts/org.webjars.npm/turf-hex-grid/
implementation ("org.webjars.npm:turf-hex-grid:3.0.12")
'org.webjars.npm:turf-hex-grid:jar:3.0.12'
<dependency org="org.webjars.npm" name="turf-hex-grid" rev="3.0.12">
  <artifact name="turf-hex-grid" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='turf-hex-grid', version='3.0.12')
)
libraryDependencies += "org.webjars.npm" % "turf-hex-grid" % "3.0.12"
[org.webjars.npm/turf-hex-grid "3.0.12"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : turf-distance jar [3.0.12,4)
org.webjars.npm : turf-helpers jar [3.0.12,4)

Project Modules

There are no modules declared in this project.

turf-hex-grid

build status

turf.hex-grid(bbox, cellWidth, units, triangles)

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')
triangles Boolean generate hexgrid triangles instead of hexagons

Example

var bbox = [-96,31,-84,40];
var cellWidth = 50;
var units = 'miles';

var hexgrid = turf.hexGrid(bbox, cellWidth, units);

//=hexgrid

Returns FeatureCollection.<Polygon>, a hexagonal grid

Installation

Requires nodejs.

$ npm install turf-hex-grid

Tests

$ npm test
org.webjars.npm

deprecated turf modules: do not use or reference, for redirects only

turf is now a monorepo: all turf modules are in Turfjs/turf

Versions

Version
3.0.12