smash.tools.raster_handler.gdal_crop_dataset_to_ndarray#
- smash.tools.raster_handler.gdal_crop_dataset_to_ndarray(dataset=<object object>, window={}, lacuna=None)[source]#
Read the raster bands from gdal object and crop the array according the window
- Parameters:
- datasetgdal object from gdal.Open()
- window: window to crop (in grid unit)
- lacuna: None or float64
- Returns:
- dictionnarya dictionary with ndarrays (depending the number of bands)
Examples
window=gdal_smash_window_from_geotransform(dataset,smash_mesh) array=gdal_crop_dataset_to_array(dataset,window)