Skip to main content

HexGrid Geo

Project description


GEO wrapper for HexGrid


import hexgrid
import hexgridgeo
import morton

grid = hexgridgeo.Grid(
    hexgrid.OrientationFlat, hexgrid.Point(500, 500),
hex = grid.hex_at(hexgridgeo.Point(-73.5, 40.3))
code = grid.hex_to_code(hex)
restored_hex = grid.hex_from_code(code)
neighbors = grid.hex_neighbors(hex, 2)
points = [
    hexgridgeo.Point(-73.0, 40.0), hexgridgeo.Point(-74.0, 40.0),
    hexgridgeo.Point(-74.0, 41.0), hexgridgeo.Point(-73.0, 41.0)
region = grid.make_region(points)
hexes_in_region = region.hexes

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 hexgridgeo-py, version 1.3
Filename, size File type Python version Upload date Hashes
Filename, size hexgridgeo-py-1.3.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page