Raster handler#

Some functions to manipulate raster files#

gdal_raster_open(filename)

Opening a raster with gdal.

gdal_read_windowed_raster(filename, smash_mesh)

Reading a raster file with gdal and return a np.ndarray storing the different data bands according the SMASH model boundingbox.

gdal_reproject_raster(dataset, xres, yres)

Reproject the dataset raster accoding a new resolution in the x and y directions

gdal_crop_dataset_to_array([dataset, ...])

Read the raster bands from gdal object and crop the array according the window

gdal_crop_dataset_to_ndarray([dataset, ...])

Read the raster bands from gdal object and crop the array according the window

gdal_write_dataset(filename, dataset[, format])

write a gdal object to a new file

gdal_get_geotransform(dataset)

Getting the GeoTransform coeficients from a gdal object

gdal_smash_window_from_geotransform(...)

Compute the dataset array window (from the geotransform) according the Smash mesh

union_bbox(bbox1, bbox2)

Function which compute the bounding boxes union of 2 input bbox.

get_bbox(dataset)

Function to get the bbox from a raster dataset opened with Gdal

get_bbox_from_window(dataset, window)

Function to get the bbox of a defined window of a dataset

get_window_from_bbox(dataset, bbox)

Function to get the window of a defined bbox of a dataset

crop_array(array, window)

Function to crop an array according a window