Python bindings for H3, a hierarchical hexagonal geospatial indexing system
84
Construct localized neighborhoods and shortest routes between hexagonal grid cells identified by the H3 index format.
89283082e6bffff and radius 1, returns exactly 7 unique cells (the origin plus its six immediate neighbors). @test89283082e6bffff and radius 2, returns exactly 12 unique cells that exclude the origin and do not overlap the radius-1 perimeter. @testTrue for each cell produced by cells_on_ring(origin, 1) and False for each cell produced by cells_on_ring(origin, 2) generated by this implementation. @test@generates
def cells_within_radius(origin: str, steps: int) -> list[str]:
"""Return the origin and all grid cells reachable within the given number of steps."""
def cells_on_ring(origin: str, steps: int) -> list[str]:
"""Return cells that are exactly the given number of steps away from the origin."""
def are_adjacent(cell_a: str, cell_b: str) -> bool:
"""Return True if the two cells share a grid edge at the same resolution."""
def shortest_path(start: str, end: str) -> list[str]:
"""Return an ordered list of cells forming a minimal stepwise path from start to end, inclusive."""Hexagonal grid indexing and navigation toolkit used for cell neighborhoods, adjacency, distance, and routing. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-h3docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10