diff --git a/geest/core/algorithms/wee_score_processor.py b/geest/core/algorithms/wee_score_processor.py index f4f845c..6d13f43 100644 --- a/geest/core/algorithms/wee_score_processor.py +++ b/geest/core/algorithms/wee_score_processor.py @@ -146,6 +146,29 @@ def calculate_wee_score(self) -> None: log_message(f"Calculating WEE SCORE for area {index}") + # processing.run("gdal:rastercalculator", + # { + # 'INPUT_A':'/home/timlinux/dev/python/GEEST2/test/test_data/wee_score/wee.asc', + # 'BAND_A':1, + # 'INPUT_B':'/home/timlinux/dev/python/GEEST2/test/test_data/wee_score/population/population.asc', + # 'BAND_B':1, + # 'INPUT_C':None, + # 'BAND_C':None, + # 'INPUT_D':None, + # 'BAND_D':None, + # 'INPUT_E':None, + # 'BAND_E':None, + # 'INPUT_F':None, + # 'BAND_F':None, + # 'FORMULA':'((A - 1) * 3) + B', + # 'NO_DATA':None, + # 'EXTENT_OPT':3, + # 'PROJWIN':None, + # 'RTYPE':0, + # 'OPTIONS':'', + # 'EXTRA':'', + # 'OUTPUT':'TEMPORARY_OUTPUT'}) + # Raster algebra formula: ((GEEST - 1) * 3) + POP params = { "EXPRESSION": f"((A@1 - 1) * 3) + B@1", diff --git a/test/test_data/wee_score/population/population.asc b/test/test_data/wee_score/population/population.asc index c850d8b..d2802ac 100644 --- a/test/test_data/wee_score/population/population.asc +++ b/test/test_data/wee_score/population/population.asc @@ -4,7 +4,7 @@ xllcorner 0.0 yllcorner 0.0 cellsize 1.0 NODATA_value -9999 -1 2 3 -9999 -2 3 1 2 -3 1 2 3 --9999 1 2 3 +1 1 1 1 +1 2 2 2 +2 2 3 3 +3 3 3 -9999 diff --git a/test/test_data/wee_score/population/population.asc.aux.xml b/test/test_data/wee_score/population/population.asc.aux.xml new file mode 100644 index 0000000..e1f2d89 --- /dev/null +++ b/test/test_data/wee_score/population/population.asc.aux.xml @@ -0,0 +1,11 @@ + + + + 1 + 3 + 2.0714285714286 + 0.79859570624992 + 87.5 + + + diff --git a/test/test_data/wee_score/population/population.qml b/test/test_data/wee_score/population/population.qml new file mode 100644 index 0000000..085c205 --- /dev/null +++ b/test/test_data/wee_score/population/population.qml @@ -0,0 +1,156 @@ + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + + + + + + + + + resamplingFilter + + 0 + diff --git a/test/test_data/wee_score/validation.tif.aux.xml b/test/test_data/wee_score/validation.tif.aux.xml new file mode 100644 index 0000000..3aedd74 --- /dev/null +++ b/test/test_data/wee_score/validation.tif.aux.xml @@ -0,0 +1,11 @@ + + + + 1 + 14 + 8.2307692307692 + 4.0601979139682 + 81.25 + + + diff --git a/test/test_data/wee_score/wee.asc b/test/test_data/wee_score/wee.asc index 4399e3f..0516fe9 100644 --- a/test/test_data/wee_score/wee.asc +++ b/test/test_data/wee_score/wee.asc @@ -5,6 +5,6 @@ yllcorner 0.0 cellsize 1.0 NODATA_value -9999 1 2 3 4 -2 3 4 5 -3 4 5 -9999 +5 1 2 3 4 5 1 2 +3 4 5 -9999 diff --git a/test/test_data/wee_score/wee.asc.aux.xml b/test/test_data/wee_score/wee.asc.aux.xml new file mode 100644 index 0000000..4a64422 --- /dev/null +++ b/test/test_data/wee_score/wee.asc.aux.xml @@ -0,0 +1,11 @@ + + + + 1 + 5 + 3.2 + 1.3266499161422 + 93.75 + + + diff --git a/test/test_data/wee_score/wee.qml b/test/test_data/wee_score/wee.qml new file mode 100644 index 0000000..09ef9b8 --- /dev/null +++ b/test/test_data/wee_score/wee.qml @@ -0,0 +1,176 @@ + + + + 1 + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + WholeRaster + Estimated + 0.02 + 0.98 + 2 + + + + + + + + + + + + + + + + + + + + + + + resamplingFilter + + 0 +