BergWerkGIS / VoGIS-Profil-Tool

VoGIS-Profil-Tool, Amt der Vorarlberger Landesregierung , Landesamt für Vermessung und Geoinformation
http://vorarlberg.at/vorarlberg/bauen_wohnen/bauen/vermessung_geoinformation/start.htm
7 stars 4 forks source link

UnboundLocalError: local variable 'p' referenced before assignment #13

Closed nicpitsch closed 5 years ago

nicpitsch commented 5 years ago

Issue

Raster: Arc/Info ASCII Grid file. Profile line: Digitized line. Define vertices: tried both options with default setting. Flächenverschneidung: none.

When click on OK to generate a profile this Error raises Could not create any profiles.

VoGis Log Message:

2018-09-30T15:18:44     WARNING    Locale: en_US
2018-09-30T15:19:08     WARNING    Is open: False
2018-09-30T15:19:08     WARNING    [geogr_swissalti3d_av] provider type: gdal
2018-09-30T15:19:08     WARNING    [SI] provider type: gdal
2018-09-30T15:19:28     WARNING    Maindlg: nodata: -9999
2018-09-30T15:19:28     WARNING    modeLine!=line: True
2018-09-30T15:19:28     WARNING    customLine is None: False
2018-09-30T15:19:28     WARNING    Error during profile creation: Traceback (most recent call last):
File "C:/Users/me/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\VoGisProfilTool\util\createProfile.py", line 73, in create
self.settings.mapData.customLine
File "C:/Users/me/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\VoGisProfilTool\util\createProfile.py", line 137, in processFeature
segments = self.processVertices(fields, feat.attributes(), profileId, geom, layerId, feat.id())
File "C:/Users/me/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\VoGisProfilTool\util\createProfile.py", line 247, in processVertices
z, nodata = self.__getValsAtPoint(qg_line_vertices[0])
File "C:/Users/me/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\VoGisProfilTool\util\createProfile.py", line 408, in __getValsAtPoint
identify_result = raster.dataProvider().identify(p, QgsRaster.IdentifyFormatValue)
UnboundLocalError: local variable 'p' referenced before assignment

2018-09-30T15:19:28     WARNING    Profile Count: 0

Environment

wilhelmberg commented 5 years ago

@nicpitsch thanks for the bug report. Working on a release for QGIS >=3.4 that should have that fixed.

If you want to try it out before it's published here's the current dev version: https://github.com/BergWerkGIS/VoGIS-Profil-Tool/raw/qgis-v3.x/VoGisProfilTool.zip

nicpitsch commented 5 years ago

Thanks, still an error:

CRITICAL Error during profile creation: Traceback (most recent call last): File "C:/Users/me/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\VoGisProfilTool\util\createProfile.py", line 73, in create self.settings.mapData.customLine File "C:/Users/me/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\VoGisProfilTool\util\createProfile.py", line 137, in processFeature segments = self.processVertices(fields, feat.attributes(), profileId, geom, layerId, feat.id()) File "C:/Users/me/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\VoGisProfilTool\util\createProfile.py", line 247, in processVertices z, nodata = self.__getValsAtPoint(qg_line_vertices[0]) File "C:/Users/me/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\VoGisProfilTool\util\createProfile.py", line 406, in __getValsAtPoint if p is None: UnboundLocalError: local variable 'p' referenced before assignment

I did uninstall and reinstall the Plugin version 3.0.1 again, always the same error. I'm using QGIS 3.4.1.

wilhelmberg commented 5 years ago

@nicpitsch

  1. did you use this one: https://github.com/BergWerkGIS/VoGIS-Profil-Tool/raw/qgis-v3.x/VoGisProfilTool.zip

  2. I updated the zip ~12hrs ago, in case you downloaded before could you try again? Plugins -> Manage and Install Plugins... -> Install from ZIP should be enough. No need to un-install.

nicpitsch commented 5 years ago

I did download it again a now it works!

Vielen Dank!

wilhelmberg commented 5 years ago

🎉 thanks for letting me know.