Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/urschrei/hexcover
Hexcover: tile an area with regular flat-topped hexagons
https://github.com/urschrei/hexcover
Last synced: 28 days ago
JSON representation
Hexcover: tile an area with regular flat-topped hexagons
- Host: GitHub
- URL: https://github.com/urschrei/hexcover
- Owner: urschrei
- License: other
- Created: 2019-06-29T15:23:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-07T17:29:31.000Z (about 1 month ago)
- Last Synced: 2024-10-11T09:14:15.442Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 38.1 KB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# Hexcover
A utility package which calculates a regular hexagonal tiling for an area, given a centroid as a Shapely [Point](https://shapely.readthedocs.io/en/latest/manual.html#Point), and a side length.# Installation
`Hexcover` is available on PyPI:
`pip install hexcover`# Usage
```pythonfrom 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](hexcover.ipynb), and a sample output [GeoJSON file](coverage.geojson) showing the result of covering the [Crystal Palace Transmitting Station](https://en.wikipedia.org/wiki/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](LICENSE.md)# DOI
[![DOI](https://zenodo.org/badge/194419900.svg)](https://zenodo.org/badge/latestdoi/194419900)