Skip to content

Deltares/QGIS-Tim

Repository files navigation

QGIS-Tim

QGIS-Tim is an open source project for multi-layer groundwater flow simulations. QGIS-Tim provides a link between QGIS and the open source analytic element method software: timflow.

The benefit of the analytic element method (AEM) is that no grid or time-stepping is required. Geohydrological features are represented by points, lines, and polygons. QGIS-Tim stores these features in a GeoPackage.

QGIS-Tim consists of a "front-end" (the QGIS plugin) and a "back-end" (the timflow server). The front-end is a QGIS plugin that provides a limited graphical interface to setup model input, visualize, and analyze model input. The back-end is a Python package. The plugin converts the GeoPackage content to a JSON file or a Python script. The back-end reads the JSON file, does the necessary computations and writes result files that are loaded back into QGIS by the plugin.

Documentation

Find the documentation here.

Installation

Download and install a recent version of QGIS (>=3.28): https://www.qgis.org/en/site/forusers/download.html

Method A: From the QGIS plugin database

  1. Open QGIS.
  2. At the top, find the Plugins menu (~sixth object in the menubar).
  3. Find "Manage and Install plugins" (~first object in drop-down).
  4. Find "All" (~first in left section).
  5. Search for "Qgis-Tim".
  6. Click "Install Plugin".

NB: The latest release might not be available yet on the QGIS plugin database, as vetting a new release takes a few days. The latest release is always available via method B.

Method B: From ZIP file

  1. Download the "QGIS-Tim-plugin.zip" from the GitHub Releases page (do not unzip!).
  2. Open QGIS.
  3. At the top, find the Plugins menu (~sixth object in the menubar).
  4. Find "Manage and Install plugins" (~first object in drop-down).
  5. Find "Install from ZIP" (~fourth in left section).
  6. Enter the path to the file "QGIS-TIM-plugin.zip".
  7. Click "Install Plugin".

This will add an icon to the toolbar(s). By clicking the icon, the plugin is started.

Install the timflow server

With the plugin installed, we can already define model input and convert it to Python scripts or JSON files. To run timflow computations directly from QGIS, we need to install a server program which contains timflow.

  1. Start the QGIS-Tim plugin by clicking the QGIS-Tim icon in the toolbar.
  2. Find and click the "Install timflow server" button at the bottom of the plugin window.
  3. Click the "Install latest release from GitHub" button to download and install the server program.

Specific releases can also be manually downloaded from the GitHub Releases page:

  1. Download the gistim ZIP file for your platform: Windows, macOS, or Linux.
  2. Find and click the "Install timflow server" button at the bottom of the plugin window.
  3. Set the path to the downloaded ZIP file in the "Install from ZIP file" section.
  4. Click the "Install" button.

Development

This repository uses pixi to install required dependencies.

  1. Install pixi by following these instructions.
  2. Call pixi install -e dev on the command line to install all required dependencies.
  3. Call pixi shell -e dev to activate the development environment.
  4. Call pixi run install-qgis-plugins to install this plugin and some debug tools inside of the included QGIS installation.
  5. Call pixi run install-backend to install the backend as a symlink between the pyinstaller dist folder and %APPDATA%/qgis-tim.
  6. Call pixi run qgis to start QGIS. The plugin should be installed and enabled and you should be able to see the versions of timflow.

After making a change to the plugin, you can reload the plugin with the plugin reloader.

You can debug the plugin itself with the QGIS DevTools plugin. We set up our pixi development environment such, that it comes down to:

  • pixi run qgis.
  • Press the start button: Start button from QGIS DevTools plugin.
  • In VS Code, press F5 to Attach to QGIS. The ports in the QGIS DevTools plugin and the launch.json file should match.

This should be enough to get started with debugging. For further setup information see the QGIS DevTools docs.

We recommend debugging the backend separately by simply running the backend as a sole entity and perform some separate operations. We can not yet connect to the backend while running the QGIS plugin. Instead, export to json or python and connect the debugger to a separate backend process from VS Code.

About

QGIS plugin and utilities for TimML multi-layer analytic element model

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors