pgh_hgm
pghydro : Hydrogeomorphological analysis extension for PgHydro
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 1602 | pgh_hgm
|
pghydro
|
2.2.6 |
GIS
|
GPL-2.0
|
SQL
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
----d--
|
No
|
No
|
No
|
Yes
|
no
|
no
|
| Relationships | |
|---|---|
| Schemas | pgh_hgm |
| Requires | plpgsql
postgis
postgis_raster
pghydro
pgh_raster
|
| Siblings | pghydro
pgh_raster
pgh_output
pgh_output_en_au
pgh_output_pt_br
pgh_consistency
|
Extension version is 2.2.6, shipped inside pghydro package version 6.6.
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY
|
2.2.6 |
18
17
16
15
14
|
pghydro |
plpgsql, postgis, postgis_raster, pghydro, pgh_raster |
| RPM | PIGSTY
|
6.6 |
18
17
16
15
14
|
pghydro_$v |
postgis36_$v |
| DEB | PIGSTY
|
6.6 |
18
17
16
15
14
|
postgresql-$v-pghydro |
postgresql-$v-postgis-3 |
| Linux / 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
|
Source
pig build pkg pghydro; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install pghydro; # install via package name, for the active PG version
pig install pgh_hgm; # install by extension name, for the current active PG version
pig install pgh_hgm -v 18; # install for PG 18
pig install pgh_hgm -v 17; # install for PG 17
pig install pgh_hgm -v 16; # install for PG 16
pig install pgh_hgm -v 15; # install for PG 15
pig install pgh_hgm -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION pgh_hgm CASCADE; -- requires plpgsql, postgis, postgis_raster, pghydro, pgh_rasterUsage
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.