remotior_sensus.tools.band_erosion module

Band erosion.

This tool allows for the spatial erosion, through a moving window, of band pixels selected by values.

Typical usage example:

>>> # import Remotior Sensus and start the session
>>> import remotior_sensus
>>> rs = remotior_sensus.Session()
>>> # start the process
>>> dilation = rs.band_erosion(input_bands=['file1.tif', 'file2.tif'],
... value_list=[1], size=1, output_path='directory_path',
... circular_structure=True,prefix='erosion_')
remotior_sensus.tools.band_erosion.band_erosion(input_bands: list | int | BandSet, value_list: list, size: int, output_path: str | list | None = None, overwrite: bool | None = False, circular_structure: bool | None = None, prefix: str | None = '', extent_list: list | None = None, n_processes: None | int = None, available_ram: None | int = None, bandset_catalog: BandSetCatalog | None = None, virtual_output: bool | None = None)

Perform erosion of band pixels.

This tool performs the erosion of pixels identified by a list of values. A new raster is created for each input band.

Parameters:
  • input_bands – input of type BandSet or list of paths or integer number of BandSet.

  • output_path – string of output path directory or list of paths.

  • overwrite – if True, output overwrites existing files.

  • value_list – list of values for dilation.

  • size – size of dilation in pixels.

  • virtual_output – if True (and output_path is directory), save output as virtual raster of multiprocess parts.

  • circular_structure – if True, use circular structure; if False, square structure.

  • prefix – optional string for output name prefix.

  • extent_list – list of boundary coordinates left top right bottom.

  • n_processes – number of parallel processes.

  • available_ram – number of megabytes of RAM available to processes.

  • bandset_catalog – optional type BandSetCatalog for BandSet number.

Returns:

Object OutputManager() with
  • paths = output list

Examples

Perform the erosion of size 1 for value 1 and 2
>>> dilation = band_erosion(input_bands=['path_1', 'path_2'],value_list=[1, 2],size=1,output_path='directory_path',circular_structure=True)