Generate streamlines from gridded datasets w/ precision & ease
Get StartedThe grd2stream QGIS plugin allows users to comfortably generate multiple flowlines from rasters by selecting seed points. This plugin leverages the power of GMT6 (Generic Mapping Tools) to ensure compatibility with all GDAL file formats!
The core functionality is based on the grd2stream
command-line utility, which utilizes Runge-Kutta integration methods.
Key features and capabilities
Setup guide and requirements
Compatibility information
Technical design details
How to use the plugin
Working with configuration presets
Integration methods and file formats
Common issues and solutions
Isolated GMT6 environment that does not interfere with existing installations
Generate flowlines from any GDAL-compatible raster datasets containing X and Y component data
Interactive seed point selection via map clicks or manual coordinate entry
Configurable integration parameters (step size, max steps, etc.)
Save and load parameter presets for repeated use
Launch your QGIS application
Go to Plugins → Manage and Install Plugins
Type "grd2stream" in the search box
Click "Install Plugin" and wait for completion
The plugin requires:
Note: On Linux and macOS, the plugin can automatically install these dependencies in an isolated Miniconda environment.
Automatic installation of dependencies via Miniconda
Automatic installation of dependencies via Miniconda
Currently only planning/parameter configuration available. Command execution not yet supported.
On Windows, the plugin currently cannot execute the grd2stream command. However, you can still:
Full Windows support is being developed and will be available in a future update.
The plugin consists of several key components:
Handles installation and management of GMT6 and grd2stream
The UI components that integrate with QGIS
Core functionality for generating flowlines
Handles saving and loading of parameter configurations
On Linux and macOS, the plugin:
Installs Miniconda3 to ~/miniconda3
(if not already installed)
Creates a "GMT6" Conda environment with GMT6 and required dependencies
Installs the grd2stream utility in the Conda environment
This approach ensures that:
Click the grd2stream icon in the QGIS toolbar
First-time users on Linux/macOS may be prompted to install dependencies
Choose X-component and Y-component raster dataset
Set parameters or load a preset configuration
Click on the map or enter coordinates manually
The plugin calculates and adds the flowline as a vector layer
Parameter | Description |
---|---|
Raster 1 & Raster 2 | The X and Y component rasters |
Seed Point | The starting location for the flowline |
Parameter | Description |
---|---|
Backward Steps | Enable to trace the flowline in both upstream and downstream directions |
Step Size | Distance increment for integration steps (default is min(x_inc, y_inc) / 5) |
Max Integration Time | Maximum time for the integration process |
Max Steps | Maximum number of steps to calculate (default is 10,000) |
Output Format | Choose what data columns to include in the output layer |
x y dist
x y dist v_x v_y
x y dist v_x v_y time
The "Use Last Settings" button quickly reapplies:
Note: Presets are stored in a presets.json
file in the plugin directory and persist between QGIS sessions.
The plugin uses the grd2stream utility, which implements:
The plugin can work with any raster format supported by GDAL, including:
Tip: For NetCDF and similar multi-dimensional formats, you can select the specific variable by choosing the appropriate band in the input dialog.
Executes the grd2stream
command with the specified parameters
Captures the command output (a text stream of coordinates and attributes)
Parses the output and converts it to a QGIS vector layer
Adds the vector layer to the current project
Plugin runs but no flowline appears
Dependency installation fails
Plugin shows command but doesn't execute it
Windows execution support is still under development
Currently not available; Windows support will be added in a future update
For detailed troubleshooting, follow these steps to access and analyze plugin logs:
Plugins → Python Console
)grd2stream
Plugin initialization
Main plugin class and QGIS integration
Core functionality
UI for parameter selection
UI for preset management
Help documentation display
Contributions to the plugin are welcome! Priority areas include:
Windows support implementation
The grd2stream QGIS plugin is licensed under the GNU General Public License v3.0 (GPL-3.0).
The plugin includes:
lib/LICENSE.txt
© 2013-2025 Abraham Wondimu, Anna Menshikova, Maxim Poliakov, Simon Povh & Thomas Kleiner