API Reference

Every public symbol in freezebase, grouped by the module that defines it.

MGRS grid

10 km MGRS grid squares to align raster data onto one common grid.

mgrs.MGRSGrid

The 10 km MGRS grid squares covering an area of interest.

mgrs.MGRSGeoBox

A 10x10 km MGRS grid square backed by odc.geo.GeoBox.

mgrs.UTMZones

Generate all 120 UTM zones (60 north + 60 south) in WGS84.

mgrs.mgrs_to_crs()

Derive the UTM CRS from an MGRS grid reference string.

mgrs.utm_to_crs()

Convert a numeric UTM zone and hemisphere to a pyproj.CRS.

mgrs.utms_to_epsgs()

Convert UTM zones and hemispheres to numeric EPSG codes.

mgrs.transform_shapely()

Transform a shapely geometry using a pyproj Transformer.

Raster I/O

rasterio helpers that accept local paths and s3:// URIs via UPath.

raster.rasterio_open()

Open a rasterio dataset from a local path or an S3-backed UPath.

raster.rewrite_tiff()

Rewrite a GeoTIFF, optionally to a different storage backend.

raster.write_cog()

Write an in-memory array as a Cloud Optimized GeoTIFF.

raster.merge_tiffs()

Merge multiple GeoTIFF files into a single file.

raster.build_rasterio_profile()

Build a rasterio profile by merging the provided profiles, starting from defaults.

raster.group_tiffs_by_crs()

Group GeoTIFF files by their coordinate reference system.

raster.get_utm_zone_string()

Extract zero-padded UTM zone identifier.

raster.get_epsg_string()

Extract CRS identifier string from CRS object.

raster.utm_zone_to_crs()

Create a CRS from an UTM zone string.

raster.COG_PROFILE

Creation profile for the GDAL COG driver, used by write_cog() and by

raster.RASTERIO_PROFILE_DEFAULTS

Suitable defaults for a Cloud-optimized GeoTIFF (COG).

VRT generation

Build VRT files without the Python GDAL dependency

vrt.create_decibel_vrt()

Create a VRT file that applies a decibel conversion pixel function.

vrt.create_rgb_vrt()

Create a 3-band RGB VRT from VV and VH rasters.

vrt.build_vrt_mosaic()

Mosaic same-resolution, single-band tiles into a VRT.

Downloads

HTTP downloads with UPath destinations

download.HTTPDownloader

Download manager for fetching files over HTTP/HTTPS.

download.retry_request()

Create a tenacity retry decorator for HTTP requests using the requests library.

S3

S3 UPath construction and retry configuration

s3.make_s3_upath()

Build an S3 UPath with the shared retry policy.

s3.s3_env()

Enter a rasterio (bundled GDAL) environment for S3-compatible storage.

Vector data

Cached vector datasets and GeoDataFrame helpers

vectordata.GeoVectorData

Abstract class for datasets containing geospatial vector data.

vectordata.DatasetMetadata

Metadata container for dataset attribution and licensing.

vectools.save_and_read_parquet()

Save a GeoDataFrame as a GeoParquet file and read it back for verification.

vectools.drop_z_if_zero()

Remove the Z coordinate from all geometries in a GeoDataFrame if all Z coordinates are zero.

vectools.is_z_axis_zero()

Check if the Z axis in a GeoDataFrame is always zero.

vectools.simplify_multipolygons()

Convert single-polygon MultiPolygons to Polygons.

Utilities

Shared helpers used across the package

set_loglevel()

Configure freezebase’s logging levels.

utils.get_cache_dir()

Get cache directory with fallback to system cache.

utils.get_data_dir()

Get data directory - must be explicitly provided.

utils.get_credentials_from_env()

Retrieve username and password credentials from environment variables.

utils.depends_on_optional()

Check if an optional dependency is installed.

utils.file_sha256()

Compute the SHA-256 hex digest of a file, reading it in chunks.

utils.shorten_string()

Shorten a string to length n with an ellipsis in the middle if needed.

utils.format_valid_options()

Format the key-value pairs of a dictionary as a bullet list for error messages.

pandas_utils.clean_names()

Clean DataFrame column names by normalizing whitespace and adjusting case.

progress.create_progress()

Create a rich progress bar with a custom column layout.

progress.track_progress()

Track progress by iterating over a sequence.