QGEP / qgepqwat2ili

3 stars 3 forks source link

Export with labels: error with labels in not-qgep-layers #99

Closed urskaufmann closed 1 year ago

urskaufmann commented 1 year ago

Describe the bug When exporting to INTERLIS with labels, there is an error, if there are other layers with labels. For the SIA- or DSS-Export, there are only labels of the layers vw_qgep_wastewater_structure, vw_qgep_reach and catchment_area needed, all other labels have no importance.

Errormessage (Layer BB_Nummern_Name is part of land register data)

Ein Fehler trat bei der Ausführung von Python-Code auf:

_core.QgsProcessingException: Traceback (most recent call last): File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgepplugin\qgepqwat2ili\qgepqwat2ili\processing_algs\extractlabels_interlis.py", line 162, in processAlgorithm label["properties"]["qgep_obj_id"] = rowid_to_obj_id[lyr][rowid] KeyError: 'BB_Nummern_Namen (lcobj)' Traceback (most recent call last): File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgepplugin\qgepqwat2ili\qgepqwat2ili\gui__init__.py", line 238, in action_do_export processing.run( File "C:\PROGRA~1/QGIS3/apps/qgis/./python/plugins\processing\tools\general.py", line 108, in run return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context) File "C:\PROGRA~1/QGIS3/apps/qgis/./python/plugins\processing\core\Processing.py", line 187, in runAlgorithm ret, results = execute(alg, parameters, context, feedback, catch_exceptions=False) File "C:\PROGRA~1/QGIS3/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 72, in execute results, ok = alg.run(parameters, context, feedback, {}, False) _core.QgsProcessingException: Traceback (most recent call last): File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgepplugin\qgepqwat2ili\qgepqwat2ili\processing_algs\extractlabels_interlis.py", line 162, in processAlgorithm label["properties"]["qgep_obj_id"] = rowid_to_obj_id[lyr][rowid] KeyError: 'BB_Nummern_Namen (lcobj)'

Python-Version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] QGIS-Version: 3.26.3-Buenos Aires Buenos Aires, 65e4edfdada

To Reproduce Exact steps to reproduce the behavior:

  1. Turn on additional layer with labels in the qgep-project
  2. Click on 'nach Interlis exportieren'
  3. Choose 'Export labels'
  4. See error

Expected behavior I do not want do change the visabilty of the layers when exporting to INTERLIS. Only labels of the three qgep-layer vw_qgep_wastewater_structure, vw_qgep_reach and catchment_area should be used for the export

Screenshots / data

Desktop (please complete the following information):