Module gdal_utils

Source
Expand description

GDAL utility functions for raster processing. GDAL utility functions for raster processing.

This module provides helper functions for GDAL command-line operations including warping, translating, creating VRTs, and mosaic building.

Structsยง

BasicRasterInfo
Basic metadata extracted from a single GDAL dataset open.

Functionsยง

change_res ๐Ÿ”’
Changes the resolution of a raster source.
compute_raster_union_extent
Compute the union extent of multiple raster files in the target CRS.
compute_single_raster_extent ๐Ÿ”’
Compute the extent of a single raster file in the target CRS.
compute_vector_extent
Compute the extent of a vector layer in the target CRS.
create_rayon_pool
Creates a rayon ThreadPool with the given number of CPUs.
create_temp_file
Creates a temporary file with the given extension.
extract_band ๐Ÿ”’
Extracts a single band from a raster source into a VRT.
file_stem_str
Extracts the file stem as a &str from a path.
get_class
Gets class IDs from a vector dataset.
get_widest_type ๐Ÿ”’
Returns the widest GDAL data type among all raster bands in the dataset.
mosaic
Creates a mosaic from multiple raster files.
mosaic_keep_inputs
Mosaics multiple raster files into a single output WITHOUT deleting inputs. Unlike mosaic_translate_cleanup, this preserves the input files.
mosaic_translate_cleanup
Assembles processed block files into a final output via mosaic + translate + cleanup.
mosaic_translate_cleanup_time_steps
Assembles time-step block files into a final output via mosaic + translate + cleanup.
open_for_update
Opens a GDAL dataset with update access.
raster_from_size
Creates an empty raster file with the given size and properties.
read_basic_raster_info
Opens a raster dataset once and extracts all basic metadata fields.
read_raster_band
Reads a raster band window into a 2D array.
run_gdal_command
Runs a GDAL command-line tool with the given arguments.
translate
Translates a raster file to GeoTIFF format.
translate_to_cog
Translates an existing GeoTIFF to a Cloud Optimized GeoTIFF.
translate_with_driver
Translates a raster file to a different format using the specified driver.
warp ๐Ÿ”’
Warps a raster source to a different EPSG projection.
warp_with_te_tr ๐Ÿ”’
Warps a raster source to a different extent and resolution.
write_bands_to_file
Writes each band of a 3D array to a GDAL dataset.