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

Export label positions to INTERLIS #73

Merged
merged 26 commits into from
Nov 10, 2022
Merged

Conversation

olivierdalang
Copy link
Collaborator

@olivierdalang olivierdalang commented Aug 3, 2022

Implementation of exporting label position.

It works by running the extractlabels algorithm (packaged in a custom qgep:extractlabels_interlis algorithm that runs it sequentially with predefined scales), and copying the results to the ili2pg tables before export.

It is usable from the QGEP plugin through the GUI with a new list of scales in the export window.

image

Status:

  • initial implementation (working export)
  • multi scale exports
    • basic implementation
    • make scale selection customizable in the UI
    • fix extractlabels crashing when no labels are generated (due to extent or scale) and saving to geojson ->see qgis/QGIS#49602 (fixed in upcoming 3.26.2 by Mathieu)
  • write tests (the current test only covers export of label positions, not the GUI part nor the label positions themselves - if we want to go further, we would need a test suite for the qgepplugin that runs in QGIS)
  • generalize/integrate for QWAT (not sure if it makes sense, since there's no GUI integration yet for interlis export, and label placement can only be generated with a QGIS project) (I don't think that was part of the offer, right ?)
  • write docs (PR QGEP/docs/#192)
  • integrate in the plugin (PR QGEP/qgepplugin/#69)
  • add skip logic for QGIS < 3.26

Notes:

  • requires QGIS 3.26.2
  • extracting all labels is relatively slow (talking about 8 mins on my setup for 5 scales for the full demo dataset - but the rest of the XTF export process is slow too)

- matching between label from the export and original features
  for the foreing key doesn't work yet...
- export starts working (use the gui to extract the labels, as obj_id must
  be added to extractlabels output)
- for some reason textpos are not exported by ili2pg (they are correctly
  exported to the ili schema, at least for haltung_text)
@olivierdalang olivierdalang changed the title [WIP] export label positions [WIP] export label positions to interlis Aug 3, 2022
@olivierdalang olivierdalang changed the title [WIP] export label positions to interlis export label positions to interlis Aug 11, 2022
@olivierdalang olivierdalang marked this pull request as ready for review August 11, 2022 14:59
qgepqwat2ili/gui/__init__.py Outdated Show resolved Hide resolved
qgepqwat2ili/processing_algs/extractlabels_interlis.py Outdated Show resolved Hide resolved
@olivierdalang
Copy link
Collaborator Author

Updated the UI and added check for pre-3.26.2 versions

image
image

@olivierdalang olivierdalang force-pushed the 2022-08_export-label-pos branch from b5bee36 to 82b4d82 Compare October 12, 2022 13:04
@olivierdalang
Copy link
Collaborator Author

@sjib Ok was able to reproduce issue described in QGEP/QGEP#552 (comment). Ability to add geom without explicit SRID only exists since Postgis 3.1 (didn't expect such a difference in minor versions).

I have pushed a fix ready to test (still same PR: QGEP/qgepplugin#69)
I also added Postgis 3.0 to the CI matrix.

@olivierdalang
Copy link
Collaborator Author

olivierdalang commented Nov 8, 2022

Todo:

  • store selection in the settings (the first time, none are selected)

@sjib sjib changed the title export label positions to interlis Export label positions to INTERLIS Nov 9, 2022
@olivierdalang olivierdalang merged commit c33b842 into master Nov 10, 2022
@sjib sjib mentioned this pull request Nov 10, 2022
13 tasks
@ponceta ponceta deleted the 2022-08_export-label-pos branch November 11, 2022 05:59
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

Successfully merging this pull request may close these issues.

2 participants