postgis_raster
PostGIS raster types and functions
postgis : PostGIS raster types and functions
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 1502 | postgis_raster | postgis | 3.6.4 |
GIS | GPL-2.0 | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| Requires | postgis |
| Need By | h3_postgis pgh_hgm pgh_raster |
| See Also | pgh_raster pointcloud ogr_fdw pgrouting q3c h3 |
| Siblings | postgis postgis_topology postgis_sfcgal postgis_tiger_geocoder address_standardizer address_standardizer_data_us |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG | 3.6.4 |
18 17 16 15 14 | postgis |
postgis |
| RPM | PGDG | 3.6.3 |
18 17 16 15 14 | postgis36_$v |
- |
| DEB | PGDG | 3.6.4 |
18 17 16 15 14 | postgresql-$v-postgis-3 |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 |
| el8.aarch64 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 |
| el9.x86_64 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 |
| el9.aarch64 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 |
| el10.x86_64 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 |
| el10.aarch64 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 | PGDG 3.6.3 |
| d12.x86_64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
| d12.aarch64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
| d13.x86_64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
| d13.aarch64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
| u22.x86_64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
| u22.aarch64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
| u24.x86_64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
| u24.aarch64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
| u26.x86_64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
| u26.aarch64 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 | PGDG 3.6.4 |
Source
git.osgeo.org/gitea/postgis/postgis
Install
Make sure PGDG repo available:
Install this extension with pig:
Create this extension with:
Usage
PostGIS Raster extends PostGIS with support for raster (gridded) data stored directly in PostgreSQL. It enables raster analysis, raster/vector interaction, and map algebra operations within SQL.
Setup
Loading Raster Data
The raster2pgsql command-line tool imports raster files (GeoTIFF, etc.) into PostgreSQL:
Key flags:
-s <srid>– Set the SRID-t <width>x<height>– Tile the raster into chunks-I– Create a spatial GiST index-C– Apply raster constraints-M– Vacuum analyze after loading
Querying Raster Data
Raster Metadata
Pixel Values
Band Statistics
Raster Processing
Clipping Rasters by Vector Geometry
Map Algebra
Apply pixel-by-pixel operations: