anyways-open / impact-qgis-plugin

QGIS plugin as part of the ANYWAYS Impact tools.
https://www.anyways.eu
MIT License
2 stars 0 forks source link
impact mobility routing scenarios

Impact QGIS-plugin

staging

This repo contains the code for the Impact toolbox plugin for QGIS.

This plugin has been developed to automate accessing the ANYWAYS Routing API and ease the subsequent routing analysis by importing all calculated routings (combined or separately) in QGIS. However, this is just the beginning of developing a fantastic toolbox that not only automates but also links our APIs to facilitate mobility-related analysis in multiple levels. Some examples of these analyses are as follows:

Installation and user documentation

The documentation for users can be found here

The source of the user documentation is kept in the anyways/docs repo

This plugin should be installed via the QGIS plugin manager. The plugin is in the QGIS Python Plugins repository The latest unstable version can be found here

The rest of this document contains technical instructions for developers.

Development hints

To load the code locally:

For development purposes:

In QGIS:

sudo pip3 install pb_tool

Note: print-statements will end up in the 'python console' (plugins > Python Console), log messages in the logbook (view > panels > Log Messages)

Compilation

Convert ui to python with pyuic5 --import-from=. -o ImPact_toolbox_dialog_base.py ImPact_toolbox_dialog_base.ui. Do this if the UI file is changed

pyrcc5 -o resources.py resources.qrc to create 'resources.py' (needed if e.g. the icon changes) cd i18n && lrelease *.ts to regenerate the compiled translations (needed if translations are added) pylupdate5 -verbose ImPact_toolbox_dialog.py ImPact_toolbox.py -ts i18n/ImPact_toolbox_dynamic_nl.ts i18n/ImPact_toolbox_dynamic_en.ts

In combination with the plugin reloader: configure the plugin reloader with the following script

cd <write home location here>/anyways-open/impact-qgis-plugin
pb_tool compile && pb_tool zip && pb_tool deploy --no-confirm

Translations

All string on the UI can be translated:

The process in a nutshell:

  1. Extract them into intermediate .ts-files
  2. Add translations with QtLinguist
  3. Convert the .ts-files into .qm files
  4. Recompile the plugin

Extra reading

1. Extract ts files

To extract the translatable string into the translation files, run:

pylupdate5 -verbose *.ui *.py -ts i18n/ImPact_toolbox_en.ts i18n/ImPact_toolbox_nl.ts

This will not overwrite earlier translation work, it'll only append new strings to translate.

2. Translate files

QT Linguist is available on the package repos. The windows installer can be found here

3.

To compile the message files, run cd i18n && lrelease *.ts