Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE][processing] New Raster Boolean logical OR/AND algorithms
These algorithms calculate the boolean OR or AND for a set of input rasters. For AND, if all of the input rasters have a non-zero value for a pixel, that pixel will be set to 1 in the output raster, otherwise it will be set to 0. For OR, if ANY of the input rasters have a non-zero value for a pixel, that pixel will be set to 1 in the output raster, else 0. A reference layer parameter specifies an existing raster layer to use as a reference when creating the output raster. The output raster will have the same extent, CRS, and pixel dimensions as this layer By default, a nodata pixel in ANY of the input layers will result in a nodata pixel in the output raster. If the 'Treat nodata values as false' option is checked, then nodata inputs will be treated the same as a 0 input value. Makes for much simpler raster boolean logic calculation without the complexity of using the raster calculator (and that's not always possible to do anyway, e.g. when ANY of the input rasters has a nodata pixel). It's also scalable dynamic to any number of input rasters (unlike raster calc), so is more flexible when used within models.
- Loading branch information
Showing with 1,004 additions and 0 deletions.
- BIN python/plugins/processing/tests/testdata/custom/raster_boolean1.tif
- BIN python/plugins/processing/tests/testdata/custom/raster_boolean2.tif
- BIN python/plugins/processing/tests/testdata/custom/raster_boolean3.tif
- BIN python/plugins/processing/tests/testdata/custom/raster_boolean3_resample.tif
- +229 −0 python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
- +1 −0 src/analysis/CMakeLists.txt
- +309 −0 src/analysis/processing/qgsalgorithmrasterlogicalop.cpp
- +108 −0 src/analysis/processing/qgsalgorithmrasterlogicalop.h
- +3 −0 src/analysis/processing/qgsnativealgorithms.cpp
- +59 −0 src/analysis/processing/qgsrasteranalysisutils.cpp
- +20 −0 src/analysis/processing/qgsrasteranalysisutils.h
- +275 −0 tests/src/analysis/testqgsprocessingalgs.cpp
There are no files selected for viewing
Oops, something went wrong.