CLI Reference#
gedih3 installs 10 command-line tools. All tools support -v (INFO) and -vv (DEBUG) verbosity, and -Q for quiet mode.
Tip: Every tool supports
--help(-h) for a complete list of flags and examples:gh3_build --help gh3_aggregate --help gh3_extract --help
Core Workflow Tools#
gh3_download#
Download GEDI data from NASA DAAC.
gh3_download -r "W,S,E,N" -l2a default -l4a default -N 8
gh3_download -r region.shp -l4a agbd -t0 2020-01-01 -t1 2021-01-01
gh3_download --s3 # Stream from NASA S3 without local download
Flag |
Description |
|---|---|
|
Spatial filter: bbox, vector file, or ISO3 code |
|
Start/end date (YYYY-MM-DD) |
|
Products to download ( |
|
GEDI data version (default: latest) |
|
S3 streaming mode |
gh3_build#
Build H3 parquet database from downloaded HDF5 files.
gh3_build -r "W,S,E,N" -l2a default -l4a default -h3r 12 -h3p 3
gh3_build -r region.shp -l4a agbd --resume
gh3_build --s3 -r region.shp -l4a agbd # Build directly from S3
Flag |
Description |
|---|---|
|
H3 index resolution (default: 12, ~25 m²) |
|
H3 partition resolution (default: 3, ~12,393 km²) |
|
Input directory where GEDI HDF5 files are stored (default: |
|
Output H3 database directory |
gh3_extract#
Extract data from H3 database into simplified flat parquet files.
gh3_extract -d /path/to/database -r region.shp -l2a rh_098 -l4a agbd -y -o output/
Flag |
Description |
|---|---|
|
H3 database path |
|
Spatial filter |
|
Temporal filter |
|
Product variables |
|
Apply pre-configured quality filters |
|
Pandas-style filter string |
|
Include geometry |
|
Output directory |
EGI variant#
For square-pixel indexing instead of H3 — see EGI Indexing.
gh3_extract -d /path/to/database -egi 6 -o output/ # ~1 km EGI index
gh3_extract -d /path/to/database -egi 6:10 -o output/ # explicit index:partition
Flag |
Description |
|---|---|
|
EGI index level and optional partition level |
gh3_aggregate#
Aggregate data to a coarser spatial resolution.
gh3_aggregate -d /path/to/database -h3 6 -o output/
gh3_aggregate -d /path/to/database -h3 6 -a "['mean','std','count']" -o output/
Flag |
Description |
|---|---|
|
Aggregate to H3 level |
|
Aggregation function: |
|
Export as rasters after aggregation |
|
Output directory |
EGI variant#
gh3_aggregate -d /path/to/database -egi 6 -a mean -o output/ # ~1 km
gh3_aggregate -d /path/to/database -egi 6:10 -a mean -o output/ # explicit partition
gh3_aggregate -d /path/to/database -egi 6 -a mean -R -o output/ # aggregate + rasterize
Flag |
Description |
|---|---|
|
EGI aggregation level and optional partition level |
gh3_rasterize#
Convert pre-aggregated dataset to GeoTIFF rasters.
gh3_rasterize -d /path/to/aggregated/ -o output/ --compress LZW # tiled output
gh3_rasterize -d /path/to/aggregated/ -m -o output.tif # merged GeoTIFF
gh3_rasterize -d /path/to/aggregated/ -l agbd_l4a -o output/ # select variables
Flag |
Description |
|---|---|
|
Dataset from |
|
Variable(s) to rasterize |
|
Merge all tiles into a single GeoTIFF |
|
Compression: |
|
Output path (directory or |
Ancillary Data Tools#
gh3_from_img#
Sample raster pixel values at GEDI shot locations.
# Single raster
gh3_from_img -i /path/to/dem.tif -d /path/to/database -r region.shp -o output/
# Tile directory with band selection and window operations
gh3_from_img -i /path/to/tiles/ -B 0 2 -w 131 -d /path/to/database -o output/
# Custom band names, quality filter, include geometry
gh3_from_img -i /path/to/raster.vrt -b elevation slope -d /path/to/database -y -g -o output/
Flag |
Description |
|---|---|
|
Raster file (tif), VRT, or tile directory |
|
Band indices to sample (0-based) |
|
Custom band names |
|
Window operations (3-digit BZO format) |
|
Fill NoData value |
|
Include geometry in output |
Window spec format (-w BZO):
B= band index (0-based)Z= window size (odd, 1–9)O= operation:0=sum,1=mean,2=median,3=mode
gh3_from_polygon#
Join polygon attributes to GEDI shots via spatial join.
gh3_from_polygon -i ecoregions.shp -c ECO_NAME BIOME_NAME -d /path/to/database -o output/
gh3_from_polygon -i landcover.gpkg -x lc_ --dropna -d /path/to/database -o output/
gh3_from_polygon -i boundaries.shp -p intersects -d /path/to/database -o output/
Flag |
Description |
|---|---|
|
Polygon vector file (shapefile, GPKG, GeoJSON) |
|
Columns to include from polygon file |
|
Column name prefix (avoids conflicts) |
|
Spatial predicate: |
|
Drop shots not matched to any polygon |
|
Include geometry in output |
Utility Tools#
gh3_list_resolutions#
Display H3 and EGI resolution levels with pixel sizes.
gh3_list_resolutions # H3 levels
gh3_list_resolutions -egi # EGI levels
gh3_read_schema#
Inspect file or database schemas. Lists column names and types from parquet, feather, geopackage, HDF5 files, or H3 databases. When no path is given, reads from the default H3 database.
gh3_read_schema # default H3 database
gh3_read_schema /path/to/database/ # specific H3 database
gh3_read_schema /path/to/file.parquet # single file
gh3_read_schema /path/to/file.h5 # HDF5 file
gh3_read_schema -p L2A # filter by product
gh3_read_schema --grep agbd # grep filter
Flag |
Description |
|---|---|
|
File or directory to inspect (default: H3 database) |
|
Filter by product suffix (e.g., |
|
Filter columns by keyword (case-insensitive) |
|
HDF5 group/beam filter (e.g., |
Common Flags#
Flag |
Description |
|---|---|
|
Spatial filter: vector file, bbox |
|
Temporal filters (YYYY-MM-DD) |
|
Product variables (supports wildcards, e.g. |
|
Dask workers, threads, memory, dashboard port |
|
Connect to existing Dask scheduler |
|
Verbosity: INFO, DEBUG |
|
Quiet mode (errors only) |
|
EGI indexing |
|
Rasterize after aggregation ( |
Remote Storage Credentials#
All tools that accept a database path (-d) can read from remote filesystems. Pass the appropriate credential flags alongside the remote URI:
Flag |
Description |
|---|---|
|
S3 endpoint URL (e.g. |
|
S3 access key |
|
S3 secret key |
|
Anonymous S3 access (for public buckets) |
|
Username for HTTP basic auth / FTP / SFTP |
|
Password for HTTP basic auth / FTP / SFTP |
|
Bearer token for HTTP(S) auth |
|
Path to SSH/SFTP private key file |
Note
Supported protocols: s3://, http://, https://, ftp://, sftp:// (or ssh://). Credentials are passed through to fsspec — any option that fsspec accepts for a given protocol will work.
# Public S3 bucket (anonymous)
gh3_extract -d s3://my-bucket/h3_database/ --s3-anon -r region.shp -o output/
# SFTP with SSH key
gh3_aggregate -d sftp://server.example.com/data/h3/ --ssh-key ~/.ssh/id_rsa -egi 6 -o output/