:py:mod:`ecoscope.io.raster` ============================ .. py:module:: ecoscope.io.raster Module Contents --------------- .. py:data:: logger .. py:class:: RasterExtent(x_min=33.0, x_max=37.0, y_min=2.0, y_max=-2.0) .. py:method:: __repr__() Return repr(self). .. py:method:: create_from_origin(pixel_size=0.5, x_min=0.0, y_min=0.0, num_rows=100, num_columns=100) :classmethod: .. py:class:: RasterProfile(pixel_size=1000.0, pixel_dtype=rio.float64, crs='EPSG:8857', nodata_value=0.0, band_count=1, raster_extent=None) Bases: :py:obj:`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 .. py:method:: _recompute_transform_(key) Recomputes the affine transformation matrix when the pixel_size or raster_extent value is updated. .. py:method:: __getattr__(name) .. py:method:: __setattr__(name, value) Implement setattr(self, name, value). .. py:method:: __setitem__(key, item) .. py:class:: RasterPy .. py:method:: write(ndarray, fp, columns, rows, band_count, driver='GTiff', dtype=rio.float64, crs=None, transform=None, nodata=None, sharing=False, indexes=1, **kwargs) :classmethod: .. py:method:: read(fp, driver=None, **kwargs) :classmethod: .. py:method:: read_write(fp, driver=None, **kwargs) :classmethod: .. py:function:: reduce_region(gdf, raster_path_list, reduce_func) 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 .. py:function:: raster_to_gdf(raster_path)