Skip to content

read_geotiff builtin

read_geotiff(path, *, nodata=None, length_unit=None)

Reads a GeoTIFF raster as a 2D BlockModel.

Parameters:

Name Type Description Default
path str or Path

A stripped or tiled GeoTIFF, uncompressed or compressed with deflate, LZW or PackBits, with integer or float samples.

required
nodata float

Pixel value read as null, replacing the file's GDAL_NODATA. NaN pixels are always null.

None

Returns:

Type Description
BlockModel

A regular grid with nz = 1 and one column per band, named from the band descriptions or band_1, band_2, ... float32 bands stay float32, the rest become float64. The geometry comes from the pixel scale and tie point or from the model transformation, rotation included; cell centers fall on the tie points of pixel-is-point rasters. An EPSG code in the GeoKeys becomes the CRS "EPSG:<code>", otherwise the citation.

used in