Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename z_coordinate to bottom_level in change_in_wl preset #906

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tool_statistics/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def aggregations(self):
CHANGE_WL_PRESETS = Preset(
name="Change in water level",
description="Calculates the difference in water level (last - first). In the styling "
"NULL values (when the cell is dry) are replaced by the cells lowest "
"pixel elevation (z_coordinate).",
"NULL values (when the cell is dry) are replaced by the cell's lowest "
"pixel elevation (bottom_level).",
aggregations=change_wl_aggregations,
cells_style=STYLE_CHANGE_WL,
cells_style_param_values={"first": "s1_first", "last": "s1_last"},
Expand Down Expand Up @@ -256,7 +256,7 @@ def aggregations(self):

WATER_ON_STREET_DURATION_PRESET = Preset(
name="Water on street duration",
description="Duration of waterlevel above manhole drain level.",
description="Duration of water level above manhole drain level.",
aggregations=water_on_street_aggregations,
nodes_style=STYLE_WATER_ON_STREET_DURATION_NODE,
nodes_style_param_values={"column": "s1_time_above_threshold"},
Expand Down
2 changes: 1 addition & 1 deletion tool_statistics/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def style_change_water_level(layer, qml: str, first: str, last: str):

layer.loadNamedStyle(qml)
class_attribute_string = (
f"((coalesce({last}, z_coordinate))-(coalesce({first}, z_coordinate)))"
f"((coalesce({last}, bottom_level))-(coalesce({first}, bottom_level)))"
)
layer.renderer().setClassAttribute(class_attribute_string)
# layer.renderer().deleteAllClasses()
Expand Down
226 changes: 2 additions & 224 deletions tool_statistics/style/change_water_level.qml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="3.10.10-A Coruña" minScale="1e+08" simplifyDrawingTol="1" simplifyLocal="1" hasScaleBasedVisibilityFlag="0" maxScale="0" simplifyDrawingHints="1" styleCategories="AllStyleCategories" simplifyMaxScale="1" readOnly="0" labelsEnabled="0" simplifyAlgorithm="0">
<flags>
<Identifiable>1</Identifiable>
<Removable>1</Removable>
<Searchable>1</Searchable>
</flags>
<renderer-v2 symbollevels="0" graduatedMethod="GraduatedColor" type="graduatedSymbol" forceraster="0" enableorderby="0" attr="((coalesce(s1_last, z_coordinate))-(coalesce(s1_first, z_coordinate)))">
<renderer-v2 symbollevels="0" graduatedMethod="GraduatedColor" type="graduatedSymbol" forceraster="0" enableorderby="0" attr="((coalesce(s1_last, bottom_level))-(coalesce(s1_first, bottom_level)))">
<ranges>
<range label="&lt; -2" upper="-2.000000000000000" lower="-99999999.000000000000000" render="true" symbol="0"/>
<range label="-2 - -1 " upper="-1.000000000000000" lower="-2.000000000000000" render="true" symbol="1"/>
Expand Down Expand Up @@ -440,221 +435,4 @@
<rotation/>
<sizescale/>
</renderer-v2>
<customproperties>
<property value="id" key="dualview/previewExpressions"/>
<property value="0" key="embeddedWidgets/count"/>
<property key="variableNames"/>
<property key="variableValues"/>
</customproperties>
<blendMode>0</blendMode>
<featureBlendMode>0</featureBlendMode>
<layerOpacity>1</layerOpacity>
<SingleCategoryDiagramRenderer attributeLegend="1" diagramType="Histogram">
<DiagramCategory minScaleDenominator="0" penWidth="0" sizeScale="3x:0,0,0,0,0,0" sizeType="MM" backgroundAlpha="255" penColor="#000000" diagramOrientation="Up" labelPlacementMethod="XHeight" opacity="1" scaleBasedVisibility="0" penAlpha="255" backgroundColor="#ffffff" lineSizeScale="3x:0,0,0,0,0,0" rotationOffset="270" enabled="0" minimumSize="0" height="15" width="15" maxScaleDenominator="1e+08" scaleDependency="Area" barWidth="5" lineSizeType="MM">
<fontProperties style="" description="MS Shell Dlg 2,7.8,-1,5,50,0,0,0,0,0"/>
<attribute label="" field="" color="#000000"/>
</DiagramCategory>
</SingleCategoryDiagramRenderer>
<DiagramLayerSettings placement="1" priority="0" showAll="1" zIndex="0" obstacle="0" dist="0" linePlacementFlags="18">
<properties>
<Option type="Map">
<Option name="name" type="QString" value=""/>
<Option name="properties"/>
<Option name="type" type="QString" value="collection"/>
</Option>
</properties>
</DiagramLayerSettings>
<geometryOptions removeDuplicateNodes="0" geometryPrecision="0">
<activeChecks/>
<checkConfiguration type="Map">
<Option name="QgsGeometryGapCheck" type="Map">
<Option name="allowedGapsBuffer" type="double" value="0"/>
<Option name="allowedGapsEnabled" type="bool" value="false"/>
<Option name="allowedGapsLayer" type="QString" value=""/>
</Option>
</checkConfiguration>
</geometryOptions>
<fieldConfiguration>
<field name="id">
<editWidget type="Range">
<config>
<Option/>
</config>
</editWidget>
</field>
<field name="node_type">
<editWidget type="Range">
<config>
<Option/>
</config>
</editWidget>
</field>
<field name="node_type_description">
<editWidget type="TextEdit">
<config>
<Option/>
</config>
</editWidget>
</field>
<field name="z_coordinate">
<editWidget type="TextEdit">
<config>
<Option/>
</config>
</editWidget>
</field>
<field name="s1_first">
<editWidget type="TextEdit">
<config>
<Option/>
</config>
</editWidget>
</field>
<field name="s1_last">
<editWidget type="TextEdit">
<config>
<Option/>
</config>
</editWidget>
</field>
<field name="s1_min">
<editWidget type="TextEdit">
<config>
<Option/>
</config>
</editWidget>
</field>
<field name="s1_max">
<editWidget type="TextEdit">
<config>
<Option/>
</config>
</editWidget>
</field>
</fieldConfiguration>
<aliases>
<alias name="" field="id" index="0"/>
<alias name="" field="node_type" index="1"/>
<alias name="" field="node_type_description" index="2"/>
<alias name="" field="z_coordinate" index="3"/>
<alias name="" field="s1_first" index="4"/>
<alias name="" field="s1_last" index="5"/>
<alias name="" field="s1_min" index="6"/>
<alias name="" field="s1_max" index="7"/>
</aliases>
<excludeAttributesWMS/>
<excludeAttributesWFS/>
<defaults>
<default applyOnUpdate="0" field="id" expression=""/>
<default applyOnUpdate="0" field="node_type" expression=""/>
<default applyOnUpdate="0" field="node_type_description" expression=""/>
<default applyOnUpdate="0" field="z_coordinate" expression=""/>
<default applyOnUpdate="0" field="s1_first" expression=""/>
<default applyOnUpdate="0" field="s1_last" expression=""/>
<default applyOnUpdate="0" field="s1_min" expression=""/>
<default applyOnUpdate="0" field="s1_max" expression=""/>
</defaults>
<constraints>
<constraint exp_strength="0" constraints="0" field="id" unique_strength="0" notnull_strength="0"/>
<constraint exp_strength="0" constraints="0" field="node_type" unique_strength="0" notnull_strength="0"/>
<constraint exp_strength="0" constraints="0" field="node_type_description" unique_strength="0" notnull_strength="0"/>
<constraint exp_strength="0" constraints="0" field="z_coordinate" unique_strength="0" notnull_strength="0"/>
<constraint exp_strength="0" constraints="0" field="s1_first" unique_strength="0" notnull_strength="0"/>
<constraint exp_strength="0" constraints="0" field="s1_last" unique_strength="0" notnull_strength="0"/>
<constraint exp_strength="0" constraints="0" field="s1_min" unique_strength="0" notnull_strength="0"/>
<constraint exp_strength="0" constraints="0" field="s1_max" unique_strength="0" notnull_strength="0"/>
</constraints>
<constraintExpressions>
<constraint exp="" desc="" field="id"/>
<constraint exp="" desc="" field="node_type"/>
<constraint exp="" desc="" field="node_type_description"/>
<constraint exp="" desc="" field="z_coordinate"/>
<constraint exp="" desc="" field="s1_first"/>
<constraint exp="" desc="" field="s1_last"/>
<constraint exp="" desc="" field="s1_min"/>
<constraint exp="" desc="" field="s1_max"/>
</constraintExpressions>
<expressionfields/>
<attributeactions>
<defaultAction value="{00000000-0000-0000-0000-000000000000}" key="Canvas"/>
</attributeactions>
<attributetableconfig sortOrder="0" actionWidgetStyle="dropDown" sortExpression="">
<columns>
<column name="id" width="-1" hidden="0" type="field"/>
<column width="-1" hidden="1" type="actions"/>
<column name="node_type" width="-1" hidden="0" type="field"/>
<column name="node_type_description" width="-1" hidden="0" type="field"/>
<column name="z_coordinate" width="-1" hidden="0" type="field"/>
<column name="s1_first" width="-1" hidden="0" type="field"/>
<column name="s1_max" width="-1" hidden="0" type="field"/>
<column name="s1_min" width="-1" hidden="0" type="field"/>
<column name="s1_last" width="-1" hidden="0" type="field"/>
</columns>
</attributetableconfig>
<conditionalstyles>
<rowstyles/>
<fieldstyles/>
</conditionalstyles>
<storedexpressions/>
<editform tolerant="1"></editform>
<editforminit/>
<editforminitcodesource>0</editforminitcodesource>
<editforminitfilepath></editforminitfilepath>
<editforminitcode><![CDATA[# -*- coding: utf-8 -*-
"""
QGIS forms can have a Python function that is called when the form is
opened.

Use this function to add extra logic to your forms.

Enter the name of the function in the "Python Init function"
field.
An example follows:
"""
from qgis.PyQt.QtWidgets import QWidget

def my_form_open(dialog, layer, feature):
geom = feature.geometry()
control = dialog.findChild(QWidget, "MyLineEdit")
]]></editforminitcode>
<featformsuppress>0</featformsuppress>
<editorlayout>generatedlayout</editorlayout>
<editable>
<field name="fid" editable="1"/>
<field name="id" editable="1"/>
<field name="infiltration_rate_mm_sum" editable="1"/>
<field name="intercepted_volume_mm_last" editable="1"/>
<field name="node_type" editable="1"/>
<field name="node_type_description" editable="1"/>
<field name="q_out_x_sum" editable="1"/>
<field name="q_out_y_sum" editable="1"/>
<field name="rain_depth_sum" editable="1"/>
<field name="s1_first" editable="1"/>
<field name="s1_last" editable="1"/>
<field name="s1_max" editable="1"/>
<field name="s1_min" editable="1"/>
<field name="spatialite_id" editable="1"/>
<field name="z_coordinate" editable="1"/>
</editable>
<labelOnTop>
<field name="fid" labelOnTop="0"/>
<field name="id" labelOnTop="0"/>
<field name="infiltration_rate_mm_sum" labelOnTop="0"/>
<field name="intercepted_volume_mm_last" labelOnTop="0"/>
<field name="node_type" labelOnTop="0"/>
<field name="node_type_description" labelOnTop="0"/>
<field name="q_out_x_sum" labelOnTop="0"/>
<field name="q_out_y_sum" labelOnTop="0"/>
<field name="rain_depth_sum" labelOnTop="0"/>
<field name="s1_first" labelOnTop="0"/>
<field name="s1_last" labelOnTop="0"/>
<field name="s1_max" labelOnTop="0"/>
<field name="s1_min" labelOnTop="0"/>
<field name="spatialite_id" labelOnTop="0"/>
<field name="z_coordinate" labelOnTop="0"/>
</labelOnTop>
<widgets/>
<previewExpression>"id"</previewExpression>
<mapTip></mapTip>
<layerGeometryType>2</layerGeometryType>
</qgis>
</qgis>
Loading