The Riverscapes Viewer (formerly QRAVE) is a QGIS plugin you can use to interact with riverscapes data. See the repository online documentation for more information:
https://riverscapes.github.io/RiverscapesToolbar/
The Riverscapes Viewer Plugin software was developed by North Arrow Research Ltd., with funding form the Bonneville Power Administration (BPA) BPA Fish and Wildlife Program Project #2011-006. Contributions were also made by South Fork Research and members of the Fluvial Habitats Center at Utah State University.
Make sure the RS_DEBUG=true
is set in QGIS Environment
fill in paths where appropriate. NOTE: ALL THESE PATHS SHOULD BE CHECKED. They change from version to version!! You'll need one of these files for each version of QGIS that you are developing on. You only need this file if you want to debug using breakpoints.
@echo off
@REM First one needs an explicit path
call "C:\Program Files\QGIS 3.16.10\bin\o4w_env.bat"
call %OSGEO4W_ROOT%\bin\qt5_env.bat
call %OSGEO4W_ROOT%\bin\py3_env.bat
@echo off
path %PATH%;%OSGEO4W_ROOT%\apps\qgis-ltr\bin
path %PATH%;%OSGEO4W_ROOT%\apps\Qt5\bin
path %PATH%;%OSGEO4W_ROOT%\apps\Python39\Scripts
rem o4w_env.bat starts with a clean path, so add what you need
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT%:\=/%/apps/qgis-ltr
set GDAL_FILENAME_IS_UTF8=YES
rem Set VSI cache to be used as buffer, see #6448
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis-ltr\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis-ltr\python\
set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis-ltr\python\qgis
@REM We include local python scripts since this is where pip installs to for ptvsd and pb_tool
path %PATH%;%APPDATA%\Python\Python39\Scripts
pushd %~dp0
call "C:\Users\Matt\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd"
When you run this batch file you'll get a vscode window. Use this window to open Workspaces\WindowsDev.code-workspace
.
Go to the terminal and install pb-tool and other python development dependencies if you haven't already:
pip install pylint autopep8 ptvsd pb-tool
clone this repo to riverscapes_viewer_dev
so that riverscapes_viewer
is what gets used for deployment
before you start you need to set two environment variables to tell VSCode where QGIS's version of python is. This will depend on which shell you're using (The default is bash but we tend to use zsh)
~/.bashrc
or ~/.zshrc
file:export QGIS_PATH=/Applications/QGIS.app
export QGIS_PLUGINS=/Users/USERNAME/Library/Application Support/QGIS/QGIS3/profiles/user/python/plugins
NOTE: This path must not end in a slash and must match what's on your system. If you're using the LTR version of QGIS this path might be something like /Applications/QGIS-LTR.app
After this is done you need to restart VSCode completely (not just relloading the window).
"terminal.integrated.allowWorkspaceConfiguration": true
Workspaces/OSXDev.code-workspace
using VSCode. This file contains all the right environment variables necessary to find and work with QGIS python libraries.Launching the Qt designer:
$QGIS_PATH/Contents/MacOS/bin/designer
rsxml
dependencyThis plugin uses the rsxml
library to parse and manipulate Riverscapes XML files. This library is available on PyPi butso you need to install it manually as a wheel so that the plugin can use it. You can install it using the following command:
sh ./scripts/install_deps.sh
THis is just running the following command:
$QGIS_PATH_PYTHON_PATH/pip3 wheel rsxml==2.0.1 -w ./wheels --no-deps
pyuic5 -x input.ui -o output.py
Licensed under the GNU General Public License Version 3.
pb_tool
First make sure that pb_tool is installed (note that you may need to adjust your QGIS paths in the commands below )
/Applications/QGIS-LTR.app/Contents/MacOS/bin/pip3 install pb_tool
pb_tool
compileYou just need to run pb_tool compile
from the installed QGIS python environment. Make sure you're in the repo root for QRavePlugin when you do that
pb_tool compile will do 2 things:
src/resources.qrc
file and compile it to a python file in the src
directorysrc/ui/*.ui
files and compile them to python files in the src/ui
directory> /Applications/QGIS-LTR.app/Contents/MacOS/bin/pb_tool compile
Skipping ./src/ui/dock_widget.ui (unchanged)
Skipping ./src/ui/meta_widget.ui (unchanged)
Skipping ./src/ui/meta_widget.ui (unchanged)
Skipping ./src/ui/about_dialog.ui (unchanged)
Skipping ./src/ui/options_dialog.ui (unchanged)
Compiling ./src/ui/project_upload_dialog.ui to ./src/ui/project_upload_dialog.py
Compiled 1 UI files
Compiling ./src/resources.qrc to ./src/resources.py
Compiled 1 resource files
On MacOS
/Applications/QGIS.app/Contents/MacOS/bin/designer
https://github.com/planetfederal/qgis-connect-plugin/blob/885773aa0bed618f85bd15d4c67ccbbcf9bee64c/boundlessconnect/gui/connectdockwidget.py#L430