diff --git a/rasterizor/metadata.txt b/rasterizor/metadata.txt index 610dcb7..1f39c21 100644 --- a/rasterizor/metadata.txt +++ b/rasterizor/metadata.txt @@ -16,7 +16,9 @@ repository=https://github.com/FLO-2DKaren/FLO-2D-Rasterizor hasProcessingProvider=no # Uncomment the following line and add your changelog: -changelog=0.3.1 +changelog= + 0.3.1 + - Added a new symbology for comparison - Allowed only rasters layers for comparison 0.3 - Added the difference between rasters diff --git a/rasterizor/rasterizor.py b/rasterizor/rasterizor.py index acce540..4318aa1 100644 --- a/rasterizor/rasterizor.py +++ b/rasterizor/rasterizor.py @@ -356,17 +356,29 @@ def setStyle(self, layer, style): elif style == 5: min = stats.minimumValue + max = stats.maximumValue range_distance = max - min zero_position = 0 - min normalized_position = zero_position / range_distance + neg1 = (-0.1 - min) / range_distance + neg5 = (-0.05 - min) / range_distance + pos5 = (0.05 - min) / range_distance + pos1 = (0.1 - min) / range_distance + color_ramp = QgsGradientColorRamp( - QColor(QColor(colDic["blue"])), - QColor(QColor(colDic["red"])), - discrete=False, stops=[ - QgsGradientStop(normalized_position, QColor(colDic["green"])), - ]) + QColor('#08306b'), + QColor('#FF0000'), + discrete=False, + stops=[ + QgsGradientStop(neg1, QColor(158, 202, 225)), + QgsGradientStop(neg5, QColor(158, 202, 225, 0)), + QgsGradientStop(normalized_position, QColor(65, 171, 93, 0)), + QgsGradientStop(pos5, QColor(255, 127, 0, 0)), + QgsGradientStop(pos1, QColor(255, 127, 0)), + ], + ) myPseudoRenderer = QgsSingleBandPseudoColorRenderer( layer.dataProvider(), layer.type(), myRasterShader