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

Python error when using a Mesh as terrain #86

Open
Vincentvd-T opened this issue May 5, 2023 · 3 comments
Open

Python error when using a Mesh as terrain #86

Vincentvd-T opened this issue May 5, 2023 · 3 comments

Comments

@Vincentvd-T
Copy link

I get a python error for the profile tool when using a mesh as height layer. See the error below. It does not matter if you draw a section line or use a line layer for the section line. I tested it with a freshly create 2dm mesh in QGIS.

Steps to reproduce:

  1. Add a mesh to QGIS and open the profile tool
  2. Add the mesh layer to the profile tool
  3. Draw a section line or use a layer
  4. Optionally, click the "interpolate line" if a python error has not occured already. Pressing this button does force a render of the graph
  5. Observe that you get a python error as below.
IndexError: list index out of range 
Traceback (most recent call last):
  File "C:\Users/<username>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\profiletool\ui\ptdockwidget.py", line 338, in refreshPlot
    self.profiletoolcore.updateProfil(self.profiletoolcore.pointstoDraw, False, True)
  File "C:\Users/<username>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\profiletool\tools\profiletool_core.py", line 197, in updateProfil
    self.profiles[i] = DataReaderTool().dataRasterReaderTool(
  File "C:\Users/<username>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\profiletool\tools\dataReaderTool.py", line 135, in dataRasterReaderTool
    z = self._extractZValues(x, y)
  File "C:\Users/<username>/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\profiletool\tools\dataReaderTool.py", line 176, in _extractZValues
    ident = identifier.identify(
IndexError: list index out of range
@nicogodet
Copy link
Collaborator

Profile on mesh layer was implemented quickly and never fully tested.

Unfortunately, I won't have time to work on it.

@Vincentvd-T
Copy link
Author

Alright, thanks for the quick reply. I saw on another issue that this plugin is basically deprecated for QGIS version 3.26 and higher. I tested the build-in elevation profile in the newest LTR and there meshes work fine. I suppose this issue can be closed then.

@nicogodet
Copy link
Collaborator

Not really deprecated for 3.26 and above.
Core profile tool still misses some features (copy values to clipboard as example).

I keep this open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants