Skip to content

Commit

Permalink
Merge pull request #927 from nens/leendert-fix-cross-sectional-discharge
Browse files Browse the repository at this point in the history
Minor fixes to cross sectional discharge processing algorithm
  • Loading branch information
benvanbasten-ns authored Oct 18, 2023
2 parents 561431d + ab2b163 commit 83d15fd
Show file tree
Hide file tree
Showing 4 changed files with 393 additions and 345 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
3.1.12 (unreleased)
-------------------

- Nothing changed yet.
- Cross-sectional discharge: minor bugfix to correctly set the attributes of the intersected flowlines


3.1.11 (2023-10-02)
Expand Down
9 changes: 4 additions & 5 deletions processing/cross_sectional_discharge_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,13 @@ def processAlgorithm(self, parameters, context, feedback):
flowlines_sink_fields = QgsFields()
flowlines_sink_fields.append(QgsField(name="id", type=QVariant.Int))
flowlines_sink_fields.append(
QgsField(name="spatialite_id", type=QVariant.Int)
QgsField(name="source_table_id", type=QVariant.Int)
)
flowlines_sink_fields.append(
QgsField(name="content_type", type=QVariant.String)
QgsField(name="source_table", type=QVariant.String)
)
flowlines_sink_fields.append(QgsField(name="kcu", type=QVariant.Int))
flowlines_sink_fields.append(
QgsField(name="kcu_description", type=QVariant.String)
QgsField(name="line_type", type=QVariant.Int)
)
flowlines_sink_fields.append(
QgsField(name="gauge_line_id", type=QVariant.Int)
Expand Down Expand Up @@ -370,7 +369,7 @@ def processAlgorithm(self, parameters, context, feedback):
layer = QgsVectorLayer(self.csv_output_file_path, "Time series output")
context.temporaryLayerStore().addMapLayer(layer)
layer_details = QgsProcessingContext.LayerDetails(
"Output: Timeseries", context.project(), "Output: Timeseries"
"Output: Time series", context.project(), "Output: Time series"
)
context.addLayerToLoadOnCompletion(layer.id(), layer_details)

Expand Down
1 change: 1 addition & 0 deletions processing/deps/discharge/cross_sectional_discharge.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def left_to_right_discharge_ogr(
tgt_ds=tgt_ds,
attributes=attributes,
attr_data_types=attr_data_types,
include_all_threedigrid_attributes=True
)
ogr_lyr = tgt_ds.GetLayerByName("flowline")
for i, feature in enumerate(ogr_lyr):
Expand Down
Loading

0 comments on commit 83d15fd

Please sign in to comment.