Command line — pyramids cog#
pyramids ships a small command-line interface (the pyramids console script, registered on
pip install pyramids-gis) built on the standard-library argparse — no extra dependency.
The cog command group mirrors the common write / validate / inspect workflow.
# Write a COG (validates the output unless --no-validate)
pyramids cog create input.tif scene_cog.tif --profile zstd
pyramids cog create input.tif scene_cog.tif --compress DEFLATE --blocksize 256
# Validate (exit code 1 for a non-COG; --strict promotes warnings to errors)
pyramids cog validate scene_cog.tif --strict
# Print structured metadata + the overview pyramid
pyramids cog info scene_cog.tif
The functions are also callable in-process for scripting/testing:
API#
pyramids.cli
#
Command-line interface for pyramids — currently the cog command group.
Exposes the common Cloud Optimized GeoTIFF workflow from the shell, built on the
pyramids COG engine and the standard-library :mod:argparse (no extra
dependency):
pyramids cog create IN OUT [--profile P] [--compress C] [--blocksize N]pyramids cog validate FILE [--strict]pyramids cog info FILE
The entry point is registered as the pyramids console script; the functions
here are also callable in-process (main([...])) for testing.
main(argv=None)
#
Entry point for the pyramids console script.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
argv
|
Sequence[str] | None
|
Argument list (excluding the program name). Defaults to
:data: |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Process exit code ( |
Examples:
- Inspect a COG from the shell: