remotior_sensus.tools.band_resample module
Band resample.
This tool allows for resampling and reprojecting bands.
Typical usage example:
>>> # import Remotior Sensus and start the session
>>> import remotior_sensus
>>> rs = remotior_sensus.Session()
>>> # start the process
>>> rs.band_resample(input_bands=['path_1', 'path_2'],
... output_path='output_path')
- remotior_sensus.tools.band_resample.band_resample(input_bands: list | int | BandSet, output_path: None | str = None, epsg_code: None | str = None, align_raster: str | BandSet | int | None = None, overwrite: bool | None = False, resampling: None | str = None, nodata_value: None | int = None, x_y_resolution: list | int | None = None, resample_pixel_factor: None | float = None, output_data_type: None | str = None, same_extent: bool | None = False, virtual_output: bool | None = None, compress=None, compress_format=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, progress_message: bool | None = True) OutputManager
Performs band resample and reprojection.
This tool performs the resampling and reprojection of raster bands. Available resampling methods are:
nearest_neighbour
average
sum
maximum
minimum
mode
median
first_quartile
third_quartile
- 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.
epsg_code – optional EPSG code for output.
align_raster – string path of raster used for aligning output pixels and projections.
overwrite – if True, output overwrites existing files.
resampling – method of resample such as nearest_neighbour (default), average, sum, maximum, minimum, mode, median, first_quartile, third_quartile.
nodata_value – value to be considered as nodata.
x_y_resolution – integer pixel size of output raster or pixel size as list of x, y.
resample_pixel_factor – define output resolution by multiplying original pixel size to this value.
output_data_type – optional raster output data type, if None the data type is the same as input raster.
same_extent – if True, output extent is the same as align_raster.
virtual_output – if True (and output_path is directory), save output as virtual raster of multiprocess parts.
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.
compress – if True, compress output.
compress_format – format of compressions such as LZW or DEFLATE.
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 band resample
>>> band_resample( ... input_bands=['path_1', 'path_2'], output_path='output_path', ... resampling='mode', resample_pixel_factor=2 ... )