计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
core-indexing【效率与协作】Use the default h3 string API for point indexing, cell inspection, hierarchy, grid navigation, edges, vertices, local IJ coordinates, measurements, and H3 index validation.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this route when a user needs to turn a latitude/longitude into an H3 cell,
inspect a cell or index, move through the hierarchy or neighboring grid, create
edges or vertices, use local IJ coordinates, measure spherical quantities, or
validate inputs. The public default is the h3 string API: scalar indexes are
canonical lowercase hexadecimal strings and collections are ordinary Python
lists unless a function documents an unordered result.
(lat, lng) (latitude first, in degrees).0..15; a larger resolution is finer.False for malformed or wrong-kind values; operational functions
raise an H3 exception instead of silently accepting them.latlng_to_cell(lat, lng, res) for a point, then check
is_valid_cell(cell) and get_resolution(cell).compact_cells requires one common resolution.grid_disk for filled
neighborhoods, grid_ring for an exact shell, grid_path_cells for an
ordered shortest path, and grid_distance for a scalar distance.are_neighbor_cells(origin, destination) or
catch H3NotNeighborsError; validate the resulting edge separately.cell_to_vertexes rather than assuming six vertices;
pentagons have five. For local IJ, keep one origin and the same resolution.km, m, rads; areas use km^2, m^2,
rads^2) when output leaves the immediate call site.import h3
cell = h3.latlng_to_cell(37.7752702151959, -122.418307270836, 9)
assert cell == "8928308280fffff"
assert h3.is_valid_index(cell) and h3.is_valid_cell(cell)
assert h3.get_resolution(cell) == 9
assert h3.cell_to_latlng(cell)[0] == 37.77670234943567
For a deterministic package check, run the bundled helper:
python scripts/smoke_core.py --help
python scripts/smoke_core.py check
Read api-reference.md for the supported surface, workflows.md for copyable recipes, and troubleshooting.md before retrying a failure.
(lat, lng), not (lng, lat).is_valid_* predicate.0..15.k.H3CellInvalidError, H3IndexInvalidError, or a False predicate result:
stop and repair the index source; do not coerce a random hexadecimal string.H3ResDomainError or H3ResMismatchError: inspect both resolutions and
choose a parent/child target in range; grid paths and local IJ require the
same resolution.H3NotNeighborsError: test adjacency and reverse the edge direction only
when the requested direction is actually intended.H3FailedError during distance/local IJ/path: reduce the geographic span or
choose a known same-face neighborhood; the operation can be undefined or
too far to compute, not evidence that the indexes are invalid.ValueError for a unit: use only the documented units in
api-reference.md.smoke_core.py check before diagnosing H3 data.