PostGIS extends PostgreSQL so that geospatial data can be stored, indexed, queried, and processed in the database. It keeps location data beside ordinary relational data, so a spatial query can use the same SQL, transactions, constraints, access controls, backup tools, and application connections as the rest of a PostgreSQL database.
The main postgis extension adds:
geometry for planar coordinate systems
and geography for geodetic coordinates on the
earth.
Spatial indexes that let the PostgreSQL planner avoid scanning every row when objects can be filtered by location.
Functions for measurement, relationships, overlays, geometry construction and editing, coordinate transformation, clustering, and spatial data exchange.
Support for common geospatial encodings and formats, including WKT, WKB, GeoJSON, GML, KML, FlatGeobuf, Geobuf, and Mapbox Vector Tiles.
This makes PostgreSQL a spatial database: applications can ask both ordinary questions and location-aware questions without moving data to a separate GIS processing system. Desktop GIS, map servers, ETL tools, and application frameworks can connect through normal PostgreSQL interfaces.
This manual documents the main PostGIS source distribution. Depending on how PostGIS was built and packaged, it can provide several PostgreSQL extensions and command-line tools:
postgis
The core geometry and geography types, spatial indexes, and most spatial functions.
postgis_raster
Raster storage, analysis, loading, and export. Raster support uses GDAL and can be omitted from a build.
postgis_topology
SQL/MM topology types and functions for models based on shared nodes, edges, and faces.
postgis_sfcgal
Additional 2D and 3D processing functions backed by the optional SFCGAL library.
shp2pgsql, pgsql2shp, and raster2pgsql move data between common file formats and PostGIS. Other utilities support upgrades, profiling, and development.
The source tree also contains internal libraries such as
liblwgeom and libpgcommon. They
are implementation layers shared by PostGIS components, not separately
released PostgreSQL extensions. Most users start by enabling the core
extension with CREATE EXTENSION postgis; see
Chapter 2, PostGIS Installation for available components and build
options.
This manual covers the main postgis/postgis
distribution. The official
PostGIS source
organization also hosts or mirrors complementary projects. These
projects have their own release cycles, installation instructions, and
documentation; installing the core extension does not install them.
Address Standardizer parses and normalizes postal addresses. It moved from the main PostGIS source tree to a separate repository for the PostGIS 3.7 development cycle.
PostGIS TIGER Geocoder provides United States address geocoding and reverse geocoding using Census TIGER data. It is also maintained separately from the main distribution.
H3-pg provides PostgreSQL bindings for the H3 hierarchical hexagonal indexing system and interoperates with PostGIS.
PostGIS Java provides Java bindings for PostGIS types.
Introduction to PostGIS is the hands-on workshop maintained by the PostGIS project.
Other PostgreSQL spatial extensions can complement PostGIS while remaining independent projects. For example, pgRouting adds routing and graph analysis. Use each project's own manual for its functions and support policy.
The manual is both a guide to the PostGIS data model and the complete reference for the SQL interface. Choose a starting point based on what you are trying to do:
Start with the Introduction to PostGIS workshop for a tutorial, then use Chapter 4, Data Management to understand spatial types, coordinate systems, validity, loading, and indexes.
Read Chapter 2, PostGIS Installation and Chapter 3, PostGIS Administration. Package-specific instructions and supported release information are maintained on the PostGIS website.
Read Chapter 5, Spatial Queries for spatial relationships and index-aware query patterns, and Chapter 6, Performance Tips for common performance problems.
Use Chapter 7, PostGIS Reference or Chapter 13, PostGIS Special Functions Index. Function pages state accepted types, dimensional support, standards conformance, dependency requirements, and version availability.
See Chapter 9, Topology, Chapter 10, Raster Data Management, Queries, and Applications, Chapter 11, Raster Reference, or Chapter 8, SFCGAL Functions Reference.
Collect the versions reported by PostGIS_Full_Version and follow Chapter 14, Reporting Problems. Check Appendix A, Release Notes when behavior differs between release lines.
This manual marks individual functions as compliant with spatial standards so users can tell which behavior is portable and which behavior is a PostGIS extension. PostGIS implements the OGC Simple Features for SQL model, including the geometry type, Well-Known Text (WKT), Well-Known Binary (WKB), and the common spatial accessors, constructors, predicates, and processing functions. PostGIS also implements many SQL/MM Spatial types and functions.
PostGIS supports geometry families defined by later standards, including SQL/MM curved geometry and OGC Simple Features Access 1.2 PolyhedralSurface, Triangle, and TIN. Support for these geometry families is function-specific, and each function page documents the supported input types and conformance level.
PostGIS also includes widely used extensions and integrations. Examples of PostGIS extensions include Extended WKT (EWKT), Extended WKB (EWKB), SRID metadata in those extended formats, geography, and raster. PostGIS also supports input and output exchange formats defined by other standards, such as GeoJSON, GML, and KML. These features are documented individually and should not be read as OGC Simple Features or SQL/MM requirements unless the specific function or format says so.
When the implementation intentionally differs from a standard, or when a standard leaves behavior ambiguous, the relevant function page describes the PostGIS behavior. Chapter 13, PostGIS Special Functions Index summarizes SQL/MM compliance and geometry-type support across functions.
PostGIS began in 2001 as a spatial database research project at Refractions Research. It is now an OSGeo project developed by contributors and organizations around the world. The Project Steering Committee coordinates releases, project policy, and the general direction of development. The complete contributor and sponsor record is in Chapter 15, Credits and Acknowledgments at the end of this manual.
The manual is the authoritative reference for the released SQL interface. The project website and source tree provide the surrounding material:
Documentation routes readers to getting-started instructions, versioned manuals, tips, training material, and the FAQ.
Community lists mailing lists, chat, events, videos, and other support channels.
Developer documentation covers development environments, testing, coding style, internals, maintenance, governance, releases, and website work.