Skip to content

Utils

Enums

geefetch.utils.enums

The Enum types used in geefetch.

DType

Bases: Enum

The data type for downloaded data.

UInt8 = 'UINT8' class-attribute instance-attribute
UInt16 = 'UINT16' class-attribute instance-attribute
Float32 = 'FLOAT32' class-attribute instance-attribute
Float64 = 'FLOAT64' class-attribute instance-attribute
transform(im)
to_str()

CompositeMethod

Bases: Enum

The composite method for multiple images mosaicking.

MEAN = 'MEAN' class-attribute instance-attribute
MEDIAN = 'MEDIAN' class-attribute instance-attribute
MEDOID = 'MEDOID' class-attribute instance-attribute
MOSAIC = 'MOSAIC' class-attribute instance-attribute
TIMESERIES = 'TIME_SERIES' class-attribute instance-attribute
transform(col)

Format

Bases: Enum

The file format for downloaded vector data.

CSV = '.csv' class-attribute instance-attribute
GEOJSON = '.geojson' class-attribute instance-attribute
KML = '.kml' class-attribute instance-attribute
KMZ = '.kmz' class-attribute instance-attribute
PARQUET = '.parquet' class-attribute instance-attribute
to_str()

S1Orbit

Bases: Enum

The type of Sentinel-1 orbit.

ASCENDING = 'ASCENDING' class-attribute instance-attribute
DESCENDING = 'DESCENDING' class-attribute instance-attribute
AS_BANDS = 'AS_BANDS' class-attribute instance-attribute
BOTH = 'BOTH' class-attribute instance-attribute

P2Orbit

Bases: Enum

The type of Palsar-2 orbit.

ASCENDING = 'Ascending' class-attribute instance-attribute
DESCENDING = 'Descending' class-attribute instance-attribute

ResamplingMethod

Bases: Enum

The resampling method for image processing.

NEAREST = None class-attribute instance-attribute
BILINEAR = 'bilinear' class-attribute instance-attribute
BICUBIC = 'bicubic' class-attribute instance-attribute

Utilities

geefetch.utils.config

git_style_diff(a, b)

Generate a unified diff between two strings, similar to Git-style diffs.

Parameters:

Name Type Description Default
a str

The original string.

required
b str

The modified string to compare against a.

required

Returns:

Type Description
str

A unified diff string showing the differences between a and b, using the standard Git-style format.

geefetch.utils.gee

Google Earth Engine utilities.

auth(project)

Authentificate and initialize Google Earth Engine

Parameters:

Name Type Description Default
project str

Google Earth Engine project id.

required

geefetch.utils.rasterio

create_vrt(out, tifs)

Create a GDAL Virtual Raster (VRT) file from a list of GeoTIFF files.

Parameters:

Name Type Description Default
out Path

Path to the output .vrt file. Must have a .vrt suffix.

required
tifs Iterable[Path]

List or iterable of input .tif files to be combined into the VRT.

required

Raises:

Type Description
ValueError

If the output path does not have a .vrt suffix.