salem.Grid.region_of_interest

Grid.region_of_interest(shape=None, geometry=None, grid=None, corners=None, crs=<Other Coordinate Operation Transformer: longlat> Description: PROJ-based coordinate operation Area of Use: - undefined, roi=None, all_touched=False)[source]

Computes a region of interest (ROI).

A ROI is simply a mask of the same size as the grid.

Parameters:
shapestr

path to a shapefile

geometrygeometry

a shapely geometry (don’t forget the crs keyword)

gridGrid

a Grid object which extent will form the ROI

cornerstuple

a ((x0, y0), (x1, y1)) tuple of the corners of the square to subset the dataset to (don’t forget the crs keyword)

crscrs, default wgs84

coordinate reference system of the geometry and corners

roindarray

add the new region_of_interest to a previous one (useful for multiple geometries for example)

all_touchedboolean

pass-through argument for rasterio.features.rasterize, indicating that all grid cells which are clipped by the shapefile defining the region of interest should be included (default=False)