remotior_sensus.tools.band_dilation module
Band dilation.
This tool allows for the spatial dilation, 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_dilation(input_bands=['file1.tif', 'file2.tif'],
... value_list=[1], size=3, output_path='directory_path',
... circular_structure=True, prefix='dilation_')
- remotior_sensus.tools.band_dilation.band_dilation(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, multiple_resolution: bool | None = True, n_processes: None | int = None, available_ram: None | int = None, bandset_catalog: BandSetCatalog | None = None, virtual_output: bool | None = None, progress_message: bool | None = True) OutputManager
Perform dilation of band pixels.
This tool performs the dilation 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.
multiple_resolution – if True, keep the original resolution of individual raster; if False, use the resolution of the first raster for all the bands.
n_processes – number of parallel processes.
available_ram – number of megabytes of RAM available to processes.
bandset_catalog – optional type BandSetCatalog for BandSet number.
progress_message – if True then start progress message, if False does not start the progress message (useful if launched from other tools).
- Returns:
- Object
OutputManager()
with paths = output list
- Object
Examples
- Perform the dilation of size 5 for value 1 and 2
>>> dilation = band_dilation(input_bands=['path_1', 'path_2'],value_list=[1, 2],size=5,output_path='directory_path',circular_structure=True)