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:
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.
To load the code locally:
For development purposes:
FIRST AID!
in order to open the debugger.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)
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
All string on the UI can be translated:
self.tr("text to translate")
in ImPact_toolbox_dialog.py
.The process in a nutshell:
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.
QT Linguist is available on the package repos. The windows installer can be found here
To compile the message files, run cd i18n && lrelease *.ts