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

INTERLIS Export Selection of object not possible with German project #92

Closed
4 tasks
sjib opened this issue Dec 7, 2022 · 1 comment · Fixed by #100
Closed
4 tasks

INTERLIS Export Selection of object not possible with German project #92

sjib opened this issue Dec 7, 2022 · 1 comment · Fixed by #100
Labels
bug Something isn't working enhancement New feature or request

Comments

@sjib
Copy link
Contributor

sjib commented Dec 7, 2022

Describe the bug
When having a project file in another language than English, where vw_qgep_reach is named vw_qgep_haltung - resp. vw_qgep_abwasserbauwerk instead of vw_qgep_wastewater_structure - the selection is not working

To Reproduce
Exact steps to reproduce the behavior:

  1. Go to layer vw_qgep_Haltung
  2. Select some reaches with the Selection tool or a filter
  3. Click on the INTERLIS Export button
  4. Limit to selection show 0 structures and 0 reaches instead of the number of selected objects

Expected behavior
Selection should also work with German and French (and all other translated) files
Or at least a warning should be displayed that the needed layer is not available

Screenshots / data
20221207_interlisexport_selection_not_working_with_German_project

It looks like the layer names are hardcoded in the INTERLIS Export:

structures_layers = QgsProject.instance().mapLayersByName("vw_qgep_wastewater_structure")

reaches_layers = QgsProject.instance().mapLayersByName("vw_qgep_reach")

Current workaround
Use an English project file for the export of a selection.

Possible improvement

  • Adapt code so that layer name references also check for translated layer names.
  • Add these translation to the config

or maybe even better

  • Check source instead of layer name for vw_qgep_wastewater_structure / vw_qgep_reach - this would not need to know the name of the layer itself
    20221207_interlisexport_selection_not_working_with_German_project_check_layername_source

  • Check code where else layer names are hardcoded. May be it also influences the label export.

Desktop (please complete the following information):

  • QGEP plugin version 1.5.6
  • QGEP datamodel version 1.5.5
  • QGEP project file version latest
  • QGIS Version 3.23
  • OS Windows 10

Additional context
Add any other context about the problem here.

@sjib sjib added bug Something isn't working enhancement New feature or request labels Dec 7, 2022
@sjib
Copy link
Contributor Author

sjib commented Dec 9, 2022

If you choose "Export labels" an error message is displayed when the layer is not found:

"Could not find the vw_qgep_wastewater_structure and/or the vw_qgep_reach layers.",

if len(structures_lyrs) == 0 or len(reaches_lyrs) == 0:

-> Should be displayed in any case if layer is not found in project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant