Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Given a centroid and side length, tile an area with regular flat hexagons

Project description

Hexcover

A small utility package which calculates a regular hexagonal tiling for an area, given a centroid as a Shapely Point, and a side length.

Example

from shapely.geometry import Point
from hexcover.util import hexagon_coverage

# centroid
c = Point(0.0, 0.0)
coverage = hexagon_coverage(c, 10)

# coverage is a namedtuple of seven polygons. The first entry is the central polygon.
# Subsequent entries begin directly above the central polygon, and proceed clockwise.

The returned namedtuple has seven properties:

  • centre
  • top
  • topright
  • bottomright
  • bottom
  • bottomleft
  • topleft

There's also an example notebook, and a sample output GeoJSON file showing the result of covering the Crystal Palace Transmitting Station with 100-metre hexagons.

Requirements

Shapely >= 1.6.3

License

The Blue Oak Model License 1.0

DOI

DOI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hexcover, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size hexcover-0.4.0-py2.py3-none-any.whl (2.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page