postgis

PostGIS geometry and geography spatial types and functions

Overview

PackageVersionCategoryLicenseLanguage
postgis3.6.3GISGPL-2.0C
IDExtensionBinLibLoadCreateTrustRelocSchema
1500postgisNoYesNoYesNoNo-
1501postgis_topologyNoYesNoYesNoNotopology
1502postgis_rasterNoYesNoYesNoNo-
1503postgis_sfcgalNoYesNoYesNoYes-
1504postgis_tiger_geocoderNoYesNoYesYesNotiger
1505address_standardizerNoYesNoYesNoYes-
1506address_standardizer_data_usNoYesNoYesNoYes-
Relatedpointcloud h3 pg_geohash geoip pg_polyline earthdistance ogr_fdw tzf
Depended Bydocumentdb h3_postgis mobilitydb pgrouting pointcloud_postgis postgis_raster postgis_sfcgal postgis_tiger_geocoder postgis_topology pg_eviltransform

Version

TypeRepoVersionPG VerPackageDeps
EXTPGDG3.6.31817161514postgis-
RPMPGDG3.6.31817161514postgis36_$v-
DEBPGDG3.6.31817161514postgresql-$v-postgis-3-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
u22.x86_64
u22.aarch64
u24.x86_64
u24.aarch64

Install

You can install postgis directly. First, make sure the PGDG repository is added and enabled:

pig repo add pgdg -u          # Add PGDG repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install postgis;          # Install for current active PG version
pig ext install -y postgis -v 18  # PG 18
pig ext install -y postgis -v 17  # PG 17
pig ext install -y postgis -v 16  # PG 16
pig ext install -y postgis -v 15  # PG 15
pig ext install -y postgis -v 14  # PG 14
dnf install -y postgis36_18       # PG 18
dnf install -y postgis36_17       # PG 17
dnf install -y postgis36_16       # PG 16
dnf install -y postgis36_15       # PG 15
dnf install -y postgis36_14       # PG 14
apt install -y postgresql-18-postgis-3   # PG 18
apt install -y postgresql-17-postgis-3   # PG 17
apt install -y postgresql-16-postgis-3   # PG 16
apt install -y postgresql-15-postgis-3   # PG 15
apt install -y postgresql-14-postgis-3   # PG 14

Create Extension:

CREATE EXTENSION postgis;

Usage

Source: Official manual, current manual HTML, release notes, patch release announcement

postgis adds spatial types, indexes, and SQL functions to PostgreSQL. The main user-facing split is between geometry for planar/projected work and geography for spherical calculations on longitude/latitude data.

Basic setup

CREATE EXTENSION postgis;
SELECT PostGIS_Full_Version();

Core types and functions

CREATE TABLE sensors (
  id bigserial PRIMARY KEY,
  geom geometry(Point, 4326),
  geog geography(Point, 4326)
);

SELECT ST_SetSRID(ST_MakePoint(-73.985, 40.748), 4326);
SELECT ST_Intersects(a.geom, b.geom) FROM a, b;
SELECT ST_DWithin(a.geom, b.geom, 100);
SELECT ST_Distance(a.geog, b.geog);
SELECT ST_Transform(geom, 3857) FROM sensors;
  • constructors: ST_MakePoint, ST_GeomFromText, ST_GeomFromGeoJSON
  • relationships: ST_Intersects, ST_Contains, ST_Within, ST_DWithin
  • measurements and transforms: ST_Distance, ST_Area, ST_Length, ST_Transform
  • processing: ST_Buffer, ST_Intersection, ST_Union

Spatial indexes

CREATE INDEX idx_sensors_geom ON sensors USING GIST (geom);

The official manual continues to recommend GiST as the general-purpose spatial index, with BRIN and SP-GiST available for specific data distributions and tradeoffs.

Caveats

  • Use geometry in an appropriate projected SRID for planar distances and areas; use geography when you need meter-based spheroidal calculations.
  • PostGIS 3.6.3 is a patch release dated 2026-04-14. The release notes describe fixes and a security hardening change, not a new stub-level usage surface, so this refresh mostly trims and aligns the stub with the current manual.

Last Modified 2026-04-19: update extension stub docs (9f178c3)