Crates.io | h3o-cli |
lib.rs | h3o-cli |
version | 0.2.6 |
source | src |
created_at | 2023-01-09 04:18:14.554242 |
updated_at | 2024-11-28 05:24:33.576894 |
description | A CLI app that exposes most of the h3o API for scripting. |
homepage | https://docs.rs/h3o-cli |
repository | https://github.com/HydroniumLabs/h3o-cli |
max_upload_size | |
id | 754101 |
size | 167,154 |
You can download a pre-compiled executable for Linux, MacOS and Windows
operating systems from the
release page, then you
should copy that executable to a location from your $PATH
env.
If you prefer to build h3o-cli
manually, or a pre-compiled executable is not
provided for your platform, then you can build h3o-cli
from the source:
cargo install h3o-cli
Each subcommand comes with its own help through -h/--help
.
There are two classes of output format for the commands:
Most of the commands can either take a single input from the CLI options or a
list of input from stdin
.
Plain text output can be directly used as input for others, allowing command pipelines.
For geo output:
cellToLatLng
returns the center (Point
) of each indexcellToBoundary
returns the outline (LineString
) of each indexcellToPolygon
returns the shape (Polygon
) of contiguous indexes.Prints information (coordinates, area, …) about on given cell:
h3o-cli cellInfo -i 844c001ffffffff
Decodes an index into its components:
h3o-cli indexDecode -i 21b1fb4644920fff --pretty
Creates a GeoJSON file containing the cell center points of all of the resolution 9 hexagons covering Uber HQ and the surrounding region of San Francisco.
h3o-cli cellToChildren --parent 86283082fffffff --resolution 9 \
| h3o-cli cellToLatLng -f geojson > uber9pts.geojson
Generates the set of indexes that cover Paris at resolution 11 and save the
compacted result in cells.txt
.
h3o-cli geomToCells -r 11 -f geojson < paris.geojson | h3o-cli compact > cells.txt
Prints the indexes from the 2-ring around 89283082ed7ffff
.
h3o-cli gridDisk -o 89283082ed7ffff -r 2
At resolution 7, prints the grid path that goes through a bunch of French cities and return the resulting KML.
h3o-cli latLngToCell -r 7 < cities-center.txt \
| h3o-cli gridPath \
| h3o-cli cellToBoundary -f kml
Load the shape of a city, compute the cell coverage at resolution 11 and save
the compressed result in city.cht
:
h3o-cli geomToCells -r 11 < city.geojson \
| h3o-cli compact \
| h3o-cli compress > city.cht