pgh_hgm
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pghydro | 2.2.6 | GIS | GPL-2.0 | SQL |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 1600 | pghydro | No | No | No | Yes | No | No | pghydro |
| 1601 | pgh_raster | No | No | No | Yes | No | No | pgh_raster |
| 1602 | pgh_hgm | No | No | No | Yes | No | No | pgh_hgm |
| 1603 | pgh_output | No | No | No | Yes | No | No | pgh_output |
| 1604 | pgh_output_en_au | No | No | No | Yes | No | No | pgh_output_en_au |
| 1605 | pgh_output_pt_br | No | No | No | Yes | No | No | pgh_output_pt_br |
| 1606 | pgh_consistency | No | No | No | Yes | No | No | pgh_consistency |
| Related | plpgsql postgis postgis_raster pghydro pgh_raster |
|---|
Extension version is 2.2.6, shipped inside pghydro package version 6.6.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 2.2.6 | 1817161514 | pghydro | plpgsql, postgis, postgis_raster, pghydro, pgh_raster |
| RPM | PIGSTY | 6.6 | 1817161514 | pghydro_$v | postgis36_$v |
| DEB | PIGSTY | 6.6 | 1817161514 | postgresql-$v-pghydro | postgresql-$v-postgis-3 |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| 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 |
Build
You can build the RPM / DEB packages for pghydro using pig build:
pig build pkg pghydro # build RPM / DEB packages
Install
You can install pghydro directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pghydro; # Install for current active PG version
pig ext install -y pghydro -v 18 # PG 18
pig ext install -y pghydro -v 17 # PG 17
pig ext install -y pghydro -v 16 # PG 16
pig ext install -y pghydro -v 15 # PG 15
pig ext install -y pghydro -v 14 # PG 14
dnf install -y pghydro_18 # PG 18
dnf install -y pghydro_17 # PG 17
dnf install -y pghydro_16 # PG 16
dnf install -y pghydro_15 # PG 15
dnf install -y pghydro_14 # PG 14
apt install -y postgresql-18-pghydro # PG 18
apt install -y postgresql-17-pghydro # PG 17
apt install -y postgresql-16-pghydro # PG 16
apt install -y postgresql-15-pghydro # PG 15
apt install -y postgresql-14-pghydro # PG 14
Create Extension:
CREATE EXTENSION pgh_hgm CASCADE; -- requires: plpgsql, postgis, postgis_raster, pghydro, pgh_raster
Usage
Sources: PGHydro README, pgh_hgm SQL
pgh_hgm adds hydrogeomorphological analysis routines to PgHydro. It combines drainage-line, drainage-area, DEM, and derived raster products to calculate basin and river-network metrics used in water-resources analysis.
Enable
Install it after the core PgHydro and raster extensions:
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_raster;
CREATE EXTENSION pghydro;
CREATE EXTENSION pgh_raster;
CREATE EXTENSION pgh_hgm;
Initialize Objects
The extension creates the pgh_hgm schema with tables such as pghft_drn_elevationprofile, pghft_upn_elevationprofile, and pghft_hydro_intel.
SELECT pgh_hgm.pghfn_tables_initialize();
Metrics
The SQL objects include functions for elevation profiles, drainage-area elevation summaries, average length of overland flow, axis length, circularity, compacity, drainage density, elevation statistics, form factor, hydrodensity, Kirpich time, perimeter, reach gradient, relief ratio, shape factor, time of concentration, slope methods, sinuosity, wave travel, and AMHG depth/width estimates.
SELECT nspname, proname
FROM pg_proc p
JOIN pg_namespace n ON n.oid = p.pronamespace
WHERE nspname = 'pgh_hgm'
ORDER BY proname;
Notes
Load and validate DEM, flow-direction, flow-accumulation, and PgHydro drainage layers before running the metrics. pgh_hgm depends on pgh_raster for raster-derived hydrological products.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.