gedih3.raster.config#

Raster Module Configuration

This module defines constants and defaults for raster output operations including GeoTIFF compression, tiling, and format settings.

Attributes#

Functions#

get_geotiff_options(→ Dict[str, Any])

Generate rasterio GeoTIFF export options.

get_cog_options(→ Dict[str, Any])

Generate rasterio creation options for the GDAL COG driver.

is_raster_format(→ bool)

Check if a format string indicates raster output.

Module Contents#

gedih3.raster.config.GEOTIFF_DEFAULTS: Dict[str, Any]#
gedih3.raster.config.COG_DEFAULTS: Dict[str, Any]#
gedih3.raster.config.COMPRESSION_OPTIONS = ['LZW', 'ZSTD', 'DEFLATE', 'PACKBITS', 'NONE']#
gedih3.raster.config.RASTER_FORMATS = ['tif', 'tiff', 'geotiff', 'nc', 'netcdf']#
gedih3.raster.config.TIME_UNITS = ['years', 'months', 'weeks', 'days']#
gedih3.raster.config.H3_RASTER_CRS = 'EPSG:4326'#
gedih3.raster.config.GEDI_START_DATE_STR = '2018-01-01'#
gedih3.raster.config.get_geotiff_options(compress: str = 'LZW', tiled: bool = True, blocksize: int = 256, bigtiff: bool = True) Dict[str, Any][source]#

Generate rasterio GeoTIFF export options.

Parameters:
compressstr

Compression method (‘LZW’, ‘ZSTD’, ‘DEFLATE’, ‘PACKBITS’, ‘NONE’)

tiledbool

Use tiled output format

blocksizeint

Tile block size in pixels

bigtiffbool

Use BigTIFF format for large files

Returns:
dict

Options dictionary for rio.to_raster()

gedih3.raster.config.get_cog_options(compress: str = 'LZW', blocksize: int = 256, bigtiff: bool = True, overviews: str = 'AUTO', resampling: str = 'AVERAGE') Dict[str, Any][source]#

Generate rasterio creation options for the GDAL COG driver.

The COG driver takes its own option names — BLOCKSIZE rather than TILED/BLOCKXSIZE, and it is always tiled. Passing the GeoTIFF option names instead is silently ignored and you get the driver defaults (512-pixel blocks), which is why this is a separate builder rather than a flag on get_geotiff_options().

Parameters:
compressstr

Compression method (‘LZW’, ‘ZSTD’, ‘DEFLATE’, ‘PACKBITS’, ‘NONE’)

blocksizeint

Internal tile size in pixels

bigtiffbool

Use BigTIFF for large files

overviewsstr

COG OVERVIEWS policy — ‘AUTO’ builds the pyramid when the image is larger than one block, ‘NONE’ skips it

resamplingstr

Resampling used to build the overviews

Returns:
dict

Options for rio.to_raster(), including driver='COG'

gedih3.raster.config.is_raster_format(fmt: str) bool[source]#

Check if a format string indicates raster output.