jkall / qgis-midvatten-plugin

Midvatten plugin for QGIS
25 stars 8 forks source link

New Section plot No line layer selected issue #350

Open jonasstromb opened 10 months ago

jonasstromb commented 10 months ago

Hi,

I´m trying to plot my first section plot using QGIS 3.34.1 and Midvatten 1.7.15.

Everything has been done accordingly to the steps in Midvatten wiki "Create section plot".

Featuring layers obs_points along a obs_lines polyline and a DEM in file in a projected coordinate system ESPG 3006

When plotting, the following error appears: "No line layer was selected. The stratigraphy bars will be lined up from south-north or west-east and no DEMs will be plotted". As shown in the picture below.

I see that the problem has been discussed in an earlier post 2021.

Is this a bug or is it just something I am doing wrong?

Screenshot 2023-12-17 133415

Regards Jonas

HenrikSpa commented 10 months ago

Hi! You need to select the line layer containing you profile line (layer Polyline?).

jonasstromb commented 10 months ago

Hi, Thank you for answering.

Sorry, but i was using the obs_lines layer. Since the feature in the map was highlighted it should have been selected.

When trying once again now just to make sure i actually did select a line layer, a Python error appears.

I´m able to plot a section without a line layer selected. But with the error only a blank section is plotted. I tried once more on another computer, having the same error:

An error has occurred while executing Python code:

TypeError: QgsGeometry.convertToType(): argument 1 has unexpected type 'int'

Traceback (most recent call last): File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\midvatten_plugin.py", line 898, in plot_section self.myplot.do_it(self.ms,selected_obspoints,selected_layer) File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\tools\utils\common_utils.py", line 1099, in function_timer result = function(*args, *kwargs) File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\tools\sectionplot.py", line 298, in do_it ok = self.upload_qgis_vector_layer(self.sectionlinelayer, self.line_crs.postgisSrid(), True, File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\tools\utils\common_utils.py", line 1099, in function_timer result = function(args, **kwargs) File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\tools\sectionplot.py", line 1365, in upload_qgis_vector_layer geom_linestring = geom.convertToType(1) TypeError: QgsGeometry.convertToType(): argument 1 has unexpected type 'int'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\midvatten_plugin.py", line 184, in self.actionPlotSection.triggered.connect(lambda x: self.plot_section()) File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\tools\utils\common_utils.py", line 1136, in new_func result = func(*args, kwargs) File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\midvatten_plugin.py", line 901, in plot_section self.myplot.do_it(self.ms,selected_obspoints,selected_layer) File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\tools\utils\common_utils.py", line 1099, in function_timer result = function(*args, *kwargs) File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\tools\sectionplot.py", line 298, in do_it ok = self.upload_qgis_vector_layer(self.sectionlinelayer, self.line_crs.postgisSrid(), True, File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\tools\utils\common_utils.py", line 1099, in function_timer result = function(args, kwargs) File "C:\Users/jostro/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\midvatten\tools\sectionplot.py", line 1365, in upload_qgis_vector_layer geom_linestring = geom.convertToType(1) TypeError: QgsGeometry.convertToType(): argument 1 has unexpected type 'int'

HenrikSpa commented 10 months ago

The plugin only supports QGIS 3.28 so far (the latest LTR release). The error you get is caused from a change in QGIS >3.30. I will check if it's simple to adapt it to 3.34.

jonasstromb commented 10 months ago

I installed QGIS 3.28 and now I can do a section plot. Thank you for helping out!