Raster tools

You can use this only if you have installed sertit[full] or sertit[rasters_rio]

Module Attributes


uint8 nodata


int8 nodata


uint16 nodata


float nodata



Returns YES if array is larger than 4 GB, IF_NEEDED otherwise.

collocate(reference_meta, other_arr, other_meta)

Collocate two georeferenced arrays: forces the other raster to be exactly georeferenced onto the reference raster by reprojection.

crop(ds, shapes[, nodata])

Cropping a dataset: setting nodata outside of the given shapes AND cropping the raster to the shapes extent.

get_data_mask(array, has_nodata[, ...])

Get nodata mask from a masked array.

get_dim_img_path(dim_path[, img_name])

Get the image path from a BEAM-DIMAP data.


Get the extent of a raster as a geopandas.Geodataframe.


Get real footprint of the product (without nodata, in french == emprise utile)

get_new_shape(ds, resolution, size[, window])

Get the new shape (height, width) of a resampled raster.

get_nodata_mask(array, has_nodata[, ...])

Deprecated since version 1.36.0.


Get default nodata value:

get_nodata_vector(ds[, default_nodata])

Get the nodata vector of a raster as a vector.

get_valid_vector(ds[, default_nodata])

Get the valid data of a raster as a vector.

get_window(ds, window)

Get a window from any type of input

hillshade(ds[, azimuth, zenith])

Compute the hillshade of a DEM from an azimuth and elevation angle (in degrees).

mask(ds, shapes[, nodata])

Masking a dataset: setting nodata outside of the given shapes, but without cropping the raster to the shapes extent.

merge_gtiff(paths, merged_path, **kwargs)

Merge rasters as a GeoTiff.

merge_vrt(paths, merged_path[, abs_path])

Merge rasters as a VRT.


Path, xarray, (array, metadata) or dataset decorator.

rasterize(ds, vector[, value_field, ...])

Rasterize a vector into raster format.

read(ds[, resolution, size, window, ...])

Read a raster dataset from a rasterio.Dataset or a path.

read_bit_array(bit_mask, bit_id)

Read bit arrays as a succession of binary masks (sort of read a slice of the bit mask, slice number bit_id)

reproject_match(dst_meta, src_arr, src_meta)

Reproject a raster to match the resolution, projection, and region of another raster.

sieve(array, out_meta, sieve_thresh[, ...])

Sieving, overloads rasterio function with raster shaped like (1, h, w).

slope(ds[, in_pct, in_rad])

Compute the slope of a DEM (in degrees).

unpackbits(array, nof_bits)

Function found here

update_meta(arr, meta)

Basic metadata update from a numpy array.

vectorize(ds[, values, keep_values, ...])

Vectorize a raster to get the class vectors.

write(raster, meta, path[, tags])

Write raster to disk (encapsulation of rasterio's function)