Skip to main content

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

Project description

Hexcover

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

Installation

Hexcover is available on PyPI:
pip install hexcover

Usage

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 fields:

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

Examples

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

Input Coordinates

A projected coordinate system must be used. Don't give input in e.g. WGS84

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.

Source Distribution

hexcover-0.6.0.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

hexcover-0.6.0-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page