Skip to content

CLI Configuration

GeeFetch uses a YAML-based configuration system to specify download parameters. This page documents all available configuration options.

Common Configuration Schema

This is configuration that you specify once in the default_satellite section, and that will be merge to all satellite-specific configurations.

geefetch.cli.omegaconfig

SatelliteDefaultConfig dataclass

The structured type for a GeeFetch default satellite configuration

Attributes:

Name Type Description
aoi AOIConfig

The temporal/spatial Area of Interest

gee GEEConfig

Google Earth Engine specific configurations

tile_size int

The pixel side length for downloaded images

resolution int

The resolution for downloaded images, in meters

dtype DType

The data type for downloaded images. Can be used to reduce file size and download speed at the cost of some loss of precision.

composite_method CompositeMethod

The mosaicking method. Use CompositeMethod.TIMESERIES to download time series instead of mosaicks. Defaults to CompositeMethod.MEDIAN.

selected_bands list[str] | None

The bands to download. If None, will use the satellite default bands. Defaults to None.

resampling ResamplingMethod

The resampling method to use when reprojecting images. Can be BILINEAR, BICUBIC or NEAREST. Defaults to ResamplingMethod.BILINEAR.

GEEConfig dataclass

Configuration of Google Earth Engine.

Attributes:

Name Type Description
ee_project_ids list[str]

One or more GEE project id, to connect to the API. More project ids allow geefetch to process downloads in parallel.

.. see also:: https://developers.google.com/earth-engine/apidocs/ee-initialize

max_tile_size float

Size constraint in MB for the request sent to GEE. This is heuristical and depends in general on what satellite you are interested in. Decrease if User Memory Excess Error, but choose highest possible otherwise. Defaults is 10.

AOIConfig dataclass

Configuration of a spatial/temporal Area of Interest (AOI).

Attributes:

Name Type Description
spatial SpatialAOIConfig
temporal TemporalAOIConfig | None
country str | list[str] | None

The name of one or more countries. If given, spatial AOI is further restricted to its area that intersects one of the country boundaries. Defaults to None.

.. note:: See https://www.naturalearthdata.com/downloads/110m-cultural-vectors/ for possible values

TemporalAOIConfig dataclass

Configuration of the temporal range of interest.

Attributes:

Name Type Description
start_date str

Start date in 'YYYY-MM-DD' format.

end_date str

End date in 'YYYY-MM-DD' format.

SpatialAOIConfig dataclass

Configuration of the spatial area of interest.

Attributes:

Name Type Description
left float
right float
top float
bottom float
epsg int

EPSG code for the CRS in which the boundaries are given. If given, the downloaded data will be expressed in that same CRS. Defaults is 4326, corresponding to WGS84 (latitude, longitude).

Satellite specific options

GEDIL2AConfig dataclass

Bases: SatelliteDefaultConfig

The structured type for configuring GEDI L2A.

Attributes:

Name Type Description
format Format

Filetype for downloading vector GEDI. Defaults to Format.PARQUET

GEDIL2BConfig dataclass

Bases: SatelliteDefaultConfig

The structured type for configuring GEDI L2B.

Attributes:

Name Type Description
format Format

Filetype for downloading vector GEDI. Defaults to Format.PARQUET

TerrainNormalizationConfig dataclass

The structured type to configure terrain normalization

Attributes:

Name Type Description
flattening_model str

The radiometric terrain normalization model, either VOLUME or DIRECT

layover_shadow_buffer int

The additional buffer to account for the passive layover and shadow

dem str

Digital elevation Model used for terrain corrections

SpeckleFilterConfig dataclass

The structured type for configuring speckle Speckle filter configuration to apply to Sentinel-1

Attributes:

Name Type Description
framework str

MONO for mono temporal filtering, MULTI for multi temporal.

filter_name str

Name of the filter to use. BOXCAR, LEE, REFINED LEE, LEE SIGMA, GAMMA MAP.

kernel_size int

Size of the filter kernel.

nr_of_images int

If the MULTI framework is used, it will use this number of temporal neighbouring images per filtered image.

S1Config dataclass

Bases: SatelliteDefaultConfig

The structured type for configuring Sentinel-1.

Attributes:

Name Type Description
orbit S1Orbit

Orbit direction to filter Sentinel-1 acquisitions. Can be ASCENDING, DESCENDING, BOTH, or AS_BANDS to download ascending and descending composites as separate bands. Defaults to BOTH.

speckle_filter SpeckleFilterConfig | Literal['default'] | None

Configuration dataclass for speckle filtering, or None for no speckle filtering. Can also be "default" to use baseline speckle filtering parameters. Defaults to None.

terrain_normalization TerrainNormalizationConfig | Literal['default'] | None

Configuration dataclass for terrain normalization, or None for no terrain normalization. Defaults to "default" which uses baseline terrain normalization parameters.

S2Config dataclass

Bases: SatelliteDefaultConfig

The structured type for configuring Sentinel-2.

Attributes:

Name Type Description
cloudless_portion int

Threshold for the portion of filled pixels that must be cloud/shadow free (%). Images that do not fullfill the requirement are filtered out before mosaicking. Default is 40.

cloud_prb_threshold int

Threshold for cloud probability above which a pixel is filtered out (%). Default is 40.

DynWorldConfig dataclass

Bases: SatelliteDefaultConfig

The structured type for configuring Dynamic World.

Landsat8Config dataclass

Bases: SatelliteDefaultConfig

The structured type for configuring Landsat 8.

Palsar2Config dataclass

Bases: SatelliteDefaultConfig

The structured type for configuring Palsar 2.

Attributes:

Name Type Description
orbit P2Orbit

Orbit direction to filter PALSAR-2 acquisitions. Can be ASCENDING or DESCENDING. Defaults to DESCENDING.

refined_lee bool

Whether to apply the Refined Lee filter to reduce speckle noise. Defaults to True.

NASADEMConfig dataclass

Bases: SatelliteDefaultConfig

The structured type for configuring NASADEM.

CustomSatelliteConfig dataclass

Bases: SatelliteDefaultConfig

The structured type for configuring a custom GEE dataset source.

Attributes:

Name Type Description
url str

The Google Earth Engine id to access the satellite. Example: "NASA/NASADEM_HGT/001"

pixel_range tuple[float, float]

The (min, max) range of pixel values. Used to normalize the custom satellite data.

Geefetch configuration

Tying it all together, the configuration for the geefetch application looks like this.

GeefetchConfig dataclass

The structured type for a GeeFetch configuration.

Attributes:

Name Type Description
data_dir Path

The path to store downloaded data.

satellite_default SatelliteDefaultConfig

Default satellite configuration.

gedi_l2a GEDIL2AConfig

GEDI specific configuration / variation to the default.

gedi_l2b GEDIL2BConfig

GEDI L2B specific configuration / variation to the default.

s1 S1Config

Sentinel-1 specific configuration / variation to the default.

s2 S2Config

Sentinel-2 specific configuration / variation to the default.

dynworld DynWorldConfig

Dynamic world specific configuration / variation to the default.

landsat8 Landsat8Config

Landsat 8 specific configuration / variation to the default.

palsar2 Palsar2Config

Palsar 2 specific configuration / variation to the default.

nasadem NASADEMConfig

NASA-DEM specific configuration / variation to the default.

customs dict[str, CustomSatelliteConfig]

Configuration for a specific dataset sources unsupported natively by geefetch.

load(path, add_missing_sats=True)

Loads and validates a geefetch configuration from a YAML file or directory.

If a directory is provided, all .yaml files within it are merged. The function then injects missing satellite configurations with defaults.

Parameters:

Name Type Description Default
path Path

Path to a YAML file or a directory containing YAML files to load.

required
add_missing_sats bool

Whether to inject missing satellite configurations with defaults. Defaults to True.

True

Returns:

Type Description
GeefetchConfig

The fully merged and validated configuration object.