Python bindings for H3, a hierarchical hexagonal geospatial indexing system
84
Utilities for shrinking and expanding coverage sets of hexagonal grid cells while preserving the represented area.
ValueError before any compaction is attempted. @test@generates
from typing import Iterable, List
def compact_coverage(cells: Iterable[str]) -> List[str]:
"""
Reduce a collection of uniform-resolution cell identifiers to the smallest set that covers the same area.
Raises ValueError when input is empty, contains invalid identifiers, or spans multiple resolutions.
Returns unique identifiers sorted in deterministic order.
"""
def expand_coverage(cells: Iterable[str], resolution: int) -> List[str]:
"""
Expand a compacted or mixed-resolution collection to the specified resolution, returning unique identifiers.
Raises ValueError when resolution is negative or any input cell is already deeper than the target.
Output identifiers are sorted in deterministic order.
"""Provides hierarchical hexagonal grid operations for cell compaction and expansion.
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