Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turf-hex-grid

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-hex-grid

# hexGrid

  • 3.0.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
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

Package last updated on 05 Jul 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc