Raster tools

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

Module Attributes


uint8 nodata


int8 nodata


uint16 nodata


float nodata


collocate(reference, other[, resampling])

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

crop(xds, shapes[, nodata])

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


Get nodata mask from a xarray.

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)


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(xds[, default_nodata])

Get the valid data of a raster, returned as a vector.

hillshade(xds[, azimuth, zenith])

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

mask(xds, shapes[, nodata])

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

merge_gtiff(crs_paths, crs_merged_path, **kwargs)

Merge rasters as a GeoTiff.

merge_vrt(crs_paths, crs_merged_path[, abs_path])

Merge rasters as a VRT.

paint(xds, shapes, value[, invert])

Painting a dataset: setting values inside the given shapes.


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


Path, xarray.Dataset, xarray.DataArray,or dataset decorator.

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

Rasterize a vector into raster format.

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

Read a raster dataset from a :

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)

read_uint8_array(bit_mask, bit_id)

Read 8 bit arrays as a succession of binary masks.

set_metadata(naked_xda, mtd_xda[, new_name])

Set metadata from a xr.DataArray to another (including rioxarray metadata such as encoded_nodata and crs).

set_nodata(xda, nodata_val)

Set nodata to a xarray that have no default nodata value.

sieve(xds, sieve_thresh[, connectivity])

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

slope(xds[, in_pct, in_rad])

Compute the slope of a DEM (in degrees).

unpackbits(array, nof_bits)

Function found here

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

Vectorize a xarray to get the class vectors.

where(cond, if_true, if_false[, master_xda, ...])

Overloads xr.where with:

write(xds, path[, tags])

Write raster to disk.