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 squares intersecting an area of interest.

mgrs.MGRSGeoBox

A 10 x 10 km MGRS square backed by odc.geo.GeoBox.

mgrs.UTMZones

All UTM zones in WGS84, including Norway and Svalbard exceptions.

mgrs.mgrs_to_crs()

Return the UTM CRS for an MGRS reference.

mgrs.utm_to_crs()

Return the CRS for a UTM zone and hemisphere.

mgrs.utms_to_epsgs()

Convert UTM zones and hemispheres to EPSG codes.

mgrs.transform_shapely()

Transform Shapely geometries between CRSs.

Raster I/O

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

raster.rasterio_open()

Open a local or S3-backed rasterio dataset.

raster.rewrite_tiff()

Rewrite a GeoTIFF locally or on S3 while preserving metadata.

raster.write_cog()

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

raster.merge_tiffs()

Merge GeoTIFFs, preserving band names from the first source.

raster.build_rasterio_profile()

Merge profiles over RASTERIO_PROFILE_DEFAULTS in order.

raster.group_tiffs_by_crs()

Group GeoTIFFs by CRS.

raster.get_utm_zone_string()

Return a zero-padded UTM zone identifier.

raster.get_epsg_string()

Return an EPSG:<code> identifier.

raster.utm_zone_to_crs()

Create a CRS from a UTM zone.

raster.COG_PROFILE

Default GDAL COG creation profile.

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 applying a decibel conversion.

vrt.create_rgb_vrt()

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

vrt.build_vrt_mosaic()

Mosaic aligned, single-band tiles into a VRT.

Downloads

HTTP downloads with UPath destinations

download.HTTPDownloader

Stream HTTP downloads through a reusable session.

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 shared authentication and retries.

s3.s3_env()

Enter a rasterio environment configured from an S3 UPath.

s3.subprocess_s3_env()

Build the S3 settings a child process needs, as environment variables.

s3.aws_session()

Return a cached rasterio AWSSession for an S3 path.

s3.clear_aws_session_cache()

Clear cached AWS sessions and configured endpoints.

s3.resolve_endpoint_url()

Return the endpoint an S3 path’s requests go to.

s3.configured_endpoint_url()

Return the S3 endpoint the AWS configuration sets for a profile, if any.

s3.list_object_sizes()

List a prefix as {relative path: size} from one listing call.

s3.atomic_write_text()

Write a text file so that a reader never sees it half-written.

s3.content_type_for()

Return the content type an object should be served as, by its suffix.

s3.CONTENT_TYPES

S3 settings

Connection settings read from prefixed environment variables

settings.S3Settings

S3 profile and botocore tuning from <PREFIX>ENDPOINT_URL and friends.

Vector data

Cached vector datasets and GeoDataFrame helpers

vectordata.GeoVectorData

Base class for cached geospatial vector datasets.

vectordata.DatasetMetadata

Metadata container for dataset attribution and licensing.

vectools.save_and_read_parquet()

Atomically save a GeoDataFrame as GeoParquet and read it back.

vectools.drop_z_if_zero()

Drop the Z axis when every Z coordinate is zero.

vectools.is_z_axis_zero()

Return whether every Z coordinate is zero.

vectools.simplify_multipolygons()

Convert single-part MultiPolygons to Polygons.

Utilities

Shared helpers used across the package

set_loglevel()

Set the package log level.

utils.get_cache_dir()

Get cache directory with fallback to system cache.

utils.get_data_dir()

Return the explicit or FREEZEBASE_DATA directory.

utils.get_credentials_from_env()

Read a non-empty username and password from the environment.

utils.depends_on_optional()

Require an optional dependency when the decorated function is called.

utils.file_sha256()

Return a file’s SHA-256 hex digest, read in chunks.

utils.shorten_string()

Shorten a string to n characters with a middle ellipsis.

utils.format_valid_options()

Format dictionary items as a bullet list.

pandas_utils.clean_names()

Normalize DataFrame column names.

progress.create_progress()

Create a rich progress bar with a custom column layout.

progress.track_progress()

Yield items while tracking progress with the shared layout.