Water management has traditionally been complex and costly, making it difficult to efficiently plan or control water supply networks without further investments. However, with the inception of Giswater in 2014, the first open-source software specifically designed for water supply and water management, this complexity is now manageable.
Giswater integrates various IT solutions and pre-existing databases, enabling high-performance management systems combined with hydraulic software such as EPANET and SWMM.
Giswater is the first open-source tool for integral water cycle management, created for city councils, municipal administrations, water and sewerage service providers, and hydraulic professionals. As a driver, it connects hydraulic analysis tools and spatial databases, allowing user access from any GIS. Compatible with EPANET, EPA SWMM, GIS, WMS, SCADA, and more, Giswater integrates seamlessly into water management entities’ ecosystems, amplifying their operational capabilities.
Additionally, Giswater can be connected with business management tools like ERP, CRM, Business Intelligence software, and corporate mobile devices.
Developed in Python (QGIS plugin) and PL/SQL (PostgreSQL database), the project is organized across three main repositories: QGIS-PLUGIN, DB-MODEL, and DOCS.
- Requirements
- Install
- Test
- Deployment
- Wiki
- FAQ
- Code Repositories
- Versioning
- Third-Party Libraries
- License
- Acknowledgments
To work with Giswater, you will need:
- PostgreSQL: Ensure to select the pgAdmin component (Database Manager) and PostGIS (Spatial Extension) during installation.
- QGIS: Required geoprocessing software.
Since Giswater functions as server-client software, installation is done across two environments.
Compatible with Windows, Mac, and Linux OS.
-
Install PostgreSQL (versions 9.5 to 18).
-
Install PostGIS, pgRouting, and other required PostgreSQL extensions (database-level, once per database):
CREATE EXTENSION IF NOT EXISTS postgis; CREATE EXTENSION IF NOT EXISTS pgrouting; CREATE EXTENSION IF NOT EXISTS tablefunc; CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS postgis_raster; CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
postgis,pgrouting,tablefunc, andunaccentare also created automatically when you build a WS/UD schema (dbmodel/schemas/main/common/base/init.sql). Install the packages on the server first; the extension objects must exist at the OS level. -
PostgreSQL roles — Giswater uses a fixed role hierarchy. You do not need to run separate corporate DDL scripts: roles are created idempotently during schema creation and permissions are applied by
gw_fct_admin_role_permissions()at the end oflastprocess.Role Purpose Inherits role_basicRead-only base ( SELECTon catalogued tables/views)— role_omOperations & maintenance role_basicrole_editNetwork editing role_omrole_epaEPA / SWMM modelling role_editrole_planPlanning (psectors, etc.) role_eparole_adminSchema administration (no superuser) role_planrole_systemOwns schema objects; used for DDL during build role_adminrole_crmCRM integration (standalone, no inheritance chain) — Inheritance chain (each role is granted to the one below; higher roles inherit all lower permissions):
role_system └── role_admin └── role_plan └── role_epa └── role_edit └── role_om └── role_basic role_crm (standalone)Installer requirements: connect as a PostgreSQL superuser (or equivalent:
CREATEROLE+CREATEon the target database). The build creates missing roles, (re)applies the role hierarchy on every schema create (GRANTis idempotent), grantsrole_systemto the installer when superuser, creates the project schemaAUTHORIZATION role_system, and runs restrictive grants (no blanketALLon tables — seegw_fct_admin_role_permissions).Manual bootstrap (only if you must prepare roles before the first schema build, e.g. restricted DBA workflow):
DO $$ DECLARE v_role_exists boolean; BEGIN SELECT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'role_basic') INTO v_role_exists; IF NOT v_role_exists THEN CREATE ROLE role_basic NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; END IF; SELECT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'role_om') INTO v_role_exists; IF NOT v_role_exists THEN CREATE ROLE role_om NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; END IF; SELECT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'role_edit') INTO v_role_exists; IF NOT v_role_exists THEN CREATE ROLE role_edit NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; END IF; SELECT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'role_epa') INTO v_role_exists; IF NOT v_role_exists THEN CREATE ROLE role_epa NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; END IF; SELECT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'role_plan') INTO v_role_exists; IF NOT v_role_exists THEN CREATE ROLE role_plan NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; END IF; SELECT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'role_admin') INTO v_role_exists; IF NOT v_role_exists THEN CREATE ROLE role_admin NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; END IF; SELECT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'role_system') INTO v_role_exists; IF NOT v_role_exists THEN CREATE ROLE role_system NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; END IF; SELECT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'role_crm') INTO v_role_exists; IF NOT v_role_exists THEN CREATE ROLE role_crm NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; END IF; GRANT role_basic TO role_om; GRANT role_om TO role_edit; GRANT role_edit TO role_epa; GRANT role_epa TO role_plan; GRANT role_plan TO role_admin; GRANT role_admin TO role_system; IF NOT pg_has_role(current_user, 'role_system', 'member') AND (SELECT rolsuper FROM pg_roles WHERE rolname = current_user) IS TRUE THEN GRANT role_system TO current_user; END IF; END$$;
Map QGIS/PostgreSQL logins to the appropriate role (e.g.
GRANT role_edit TO gis_user). Object-level grants on each project schema are (re)applied bygw_fct_admin_role_permissions()during create and upgrade (lastprocess).
Compatible with Windows, Mac, and Linux, but EPA models are only supported on Windows.
- Install the latest Long-Term Release (LTR) of QGIS.
- Install SWMM (5.1) and EPANET (2.2). Note: EPA SWMM and EPANET may not work on Linux front-end environments.
- On Linux systems, you may need to install the PostgreSQL Qt driver for database connectivity.
- On Ubuntu:
sudo apt install libqt5sql5-psql- On Fedora:
sudo dnf install qt5-qtbase-postgresql
Database model (pgTAP, Docker): dbmodel/README.md — Testing — ./dbmodel/test/run_tests.sh ws (PostgreSQL 16–18 via PG_MAJOR).
Schema CLI (no QGIS): giswater_admin/README.md — pipx install giswater-cli then gw create --kind ws …
Python unit tests: python3 -m pytest test/engine -v (from plugin repo root).
Use the provided example projects, pre-loaded with datasets for testing. Find setup videos below:
Ensure you have the permissions to connect to PostgreSQL and that your user has superuser rights for database administration tasks (e.g., creating schemas, roles, backups).
- Define catalogs with at least the mandatory categories ([materials, node, arc]) and create map zones ([macroexploitation, exploitation, municipality, sector, dma]).
- To get started, refer to Start from Scratch for guidance.
- Tip: Once map zones and catalogs are defined, you can begin adding network nodes and arcs.
For more configuration options, see the Giswater configuration guide.
Explore additional documentation on the Giswater Wiki.
Find answers to common questions in the Giswater FAQs.
- Docs: Documentation repository
- QGIS Plugin: QGIS Plugin repository
- Database Model: Database Model repository — in this repo: dbmodel/ (schema layout, local tests)
- Headless schema CLI: giswater_admin/ (full reference)
Other repositories may exist but are either deprecated or inactive.
Giswater follows a three-level release system:
- Major: New architecture with significant updates (no forward compatibility).
- Minor: Bug fixes and new features (forward compatible).
- Build: Minor fixes and updates (forward compatible).
Release frequency:
- Build: Monthly (12 builds/year)
- Minor: Annually
- Major: No fixed schedule
Giswater uses the following third-party libraries:
-
WNTR: WNTR GitHub WNTR is an open-source Python package for analyzing water distribution systems using hydraulic and water quality models. The WNTR license can be found in the LICENSE file or in their repository.
-
swmm-api: swmm-api GitLab swmm-api provides a Pythonic interface to the EPA SWMM5 software, enabling advanced scripting, simulation control, and access to simulation results. The license and further details can be found in the LICENSE or in their repository.
-
tqdm: tqdm GitHub tqdm is a fast, extensible progress bar library for Python, supporting console, GUI, and notebook environments. The tqdm license can be viewed in the LICENSE or in their repository.
-
PyPDF2: PyPDF2 GitHub PyPDF2 is a Python library for working with PDF files, offering functionalities such as splitting, merging, and text extraction. The PyPDF2 license is available in the LICENSE or in their repository.
-
osmnx: OSMnx GitHub OSMnx is a Python package to easily download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap. You can download and model walking, driving, or biking networks with a single line of code then analyze and visualize them. You can just as easily work with urban amenities/points of interest, building footprints, transit stops, elevation data, street orientations, speed/travel time, and routing. The OSMnx license can be viewed in the LICENSE or in their repository
This program is free software, licensed under the GNU General Public License (GPL) version 3 or later. Refer to the LICENSE file for details.
Special thanks to our founding contributors:
- GITS-BarcelonaTech University
- Aigües de Mataró
- Cicle de l'Aigua del Ter S.A
- Aigües de Blanes
- Aigües del Prat
- Aigües de Vic
- Aigües de Castellbisbal
- Aigües de Banyoles
- Figueres de Serveis, S.A
- Prodaisa
- Sabemsa
- Consorci Aigües de Tarragona
- BGEO OPEN GIS S.L.