Socket
Socket
Sign inDemoInstall

turf-hex-grid

Package Overview
Dependencies
3
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    turf-hex-grid

# hexGrid


Version published
Weekly downloads
14K
increased by0.48%
Maintainers
2
Install size
60.9 kB
Created
Weekly downloads
 

Readme

Source

turf-hex-grid

hexGrid

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

  • bbox Array<number> bounding box in [minX, minY, maxX, maxY] order
  • cellSize number dimension of cell in specified units
  • units string used in calculating cellWidth ('miles' or 'kilometers')
  • triangles boolean whether to return as triangles instead of hexagons

Examples

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


This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.

Installation

Install this module individually:

$ npm install turf-hex-grid

Or install the Turf module that includes it as a function:

$ npm install turf

Keywords

FAQs

Last updated on 05 Jul 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc