ecoscope.io.raster#
Module Contents#
- ecoscope.io.raster.logger#
- class ecoscope.io.raster.RasterExtent(x_min=33.0, x_max=37.0, y_min=2.0, y_max=-2.0)[source]#
- x_min#
- x_max#
- y_min#
- y_max#
- class ecoscope.io.raster.RasterProfile(pixel_size=1000.0, pixel_dtype=rio.float64, crs='EPSG:8857', nodata_value=0.0, band_count=1, raster_extent=None)[source]#
Bases:
collections.UserDict
A class for holding raster properties At present this class is only valid for non-rotated rasters with a north-up orientation and square sized pixels defined by the E-W pixel size
- crs#
- raster_extent#
- cols#
- rows#
- affine_transform#
- class ecoscope.io.raster.RasterPy[source]#
- ecoscope.io.raster.reduce_region(gdf, raster_path_list, reduce_func)[source]#
A function to apply the reduce_func to the values of the pixels within each of the rasters for every shape within the input geopandas dataframe ‘geometry’ column :param gdf: geopandas dataframe. The geometry column will be used to mask the areas of the input raster to be used in the reduction :param raster_path_list: a list of raster files on disc to analyse :param reduce_func: a single-value function to apply to the values of the input raster :return: dataframe with a column of reduce values for each raster and a row for each region