environmentaltools.common.to_geotiff
- environmentaltools.common.to_geotiff(data: ndarray, file_name: str, profile: dict = None, transform: Affine = None, auxiliary: dict = None)[source]
Save georeferenced raster data to GeoTIFF format.
Exports 2D array to GeoTIFF with spatial reference information. Profile can be provided directly or constructed from auxiliary parameters.
- Parameters:
data (np.ndarray) – 2D array of raster values.
file_name (str) – Output GeoTIFF file path.
profile (dict, optional) – Rasterio profile dictionary with metadata (driver, dtype, nodata, dimensions, CRS, transform). If None, built from auxiliary.
transform (Affine, optional) – Affine transformation matrix. Ignored if profile provided. Defaults to None.
auxiliary (dict, optional) – Dictionary with keys: ‘corners’ (origin [x, y]), ‘dx’, ‘dy’ (cell sizes), ‘angle’ (rotation), ‘driver’, ‘dtype’, ‘nodata’, ‘nodesx’, ‘nodesy’ (dimensions), ‘count’ (bands), ‘crsno’ (EPSG code). Required if profile is None.
- Returns:
None