Skip to content
pghydro

pghydro

pghydro : Drainage network analysis core for PostgreSQL and PostGIS

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
1600
pghydro
pghydro
6.6
GIS
GPL-2.0
SQL
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
----d--
No
No
No
Yes
no
no
Relationships
Schemaspghydro
Requires
plpgsql
postgis
Siblings
pgh_raster
pgh_hgm
pgh_output
pgh_output_en_au
pgh_output_pt_br
pgh_consistency

Lead row; package also ships pgh_raster, pgh_hgm, pgh_output, pgh_output_en_au, pgh_output_pt_br, and pgh_consistency.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PIGSTY
6.6
18
17
16
15
14
pghydroplpgsql, postgis
RPM
PIGSTY
6.6
18
17
16
15
14
pghydro_$vpostgis36_$v
DEB
PIGSTY
6.6
18
17
16
15
14
postgresql-$v-pghydropostgresql-$v-postgis-3
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
el8.aarch64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
el9.x86_64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
el9.aarch64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
el10.x86_64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
el10.aarch64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
d12.x86_64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
d12.aarch64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
d13.x86_64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
d13.aarch64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
u22.x86_64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
u22.aarch64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
u24.x86_64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
u24.aarch64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
u26.x86_64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
u26.aarch64
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6
PIGSTY 6.6

Source

pig build pkg pghydro;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pghydro;		# install via package name, for the active PG version

pig install pghydro -v 18;   # install for PG 18
pig install pghydro -v 17;   # install for PG 17
pig install pghydro -v 16;   # install for PG 16
pig install pghydro -v 15;   # install for PG 15
pig install pghydro -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION pghydro CASCADE; -- requires plpgsql, postgis

Usage

Sources: README, repo, releases

pghydro is the core extension in the PgHydro suite for drainage-network analysis and water-resources decision support on top of PostgreSQL and PostGIS.

Install the PgHydro suite

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_raster;
CREATE EXTENSION pghydro;
CREATE EXTENSION pgh_raster;
CREATE EXTENSION pgh_hgm;
CREATE EXTENSION pgh_consistency;
CREATE EXTENSION pgh_output;

The upstream README presents these companion extensions together:

  • pghydro for drainage-network analysis
  • pgh_raster for DEM-derived hydrological products
  • pgh_hgm for hydrogeomorphological analysis
  • pgh_consistency for Pfafstetter consistency checks
  • pgh_output for reporting objects

What upstream says it covers

The README describes support for:

  • flow-direction correction in river networks
  • Otto Pfafstetter basin coding
  • upstream and downstream stretch selection
  • distance-to-mouth calculations
  • upstream area calculations
  • river orders and basin levels

Requirements

  • PostgreSQL 9.1+
  • PostGIS 3.x
  • PostGIS Raster

Notes

  • The current upstream README status section still says the master branch tracks release 6.6 and the develop branch tracks 6.7-dev.
  • The repository also publishes newer tags, but the user-facing README remains centered on the 6.6 installation and tutorial flow.
Last updated on