PostGIS Internals
These notes cover implementation details that are useful when working inside PostGIS rather than only using the SQL API.
- Memory management covers allocator boundaries and ownership rules.
- PostgreSQL internals for PostGIS developers covers PostgreSQL C function macros, varlena detoasting, serialized geometry handling, and a typical SQL function flow.
- Empty geometry semantics covers how
EMPTYdiffers from SQLNULL, how empties are serialized and indexed, and how accessors, measurements, predicates, and collections handle empty inputs. - Spatial collections and raster/vector crossings covers current geometry collection handling and explains how the retired raster/vector spatial-collection abstraction relates to current code.
- 2D and 3D distance internals covers how geometry distance functions dispatch 2D and 3D candidate checks, including segment-segment and surface cases.
- Precision and tolerance internals maps the current GEOS grid-size, snap-tolerance, topology-precision, and MVT quantization surfaces.
- Raster affine georeferencing covers the scale, skew, rotation, and upper-left coefficients used to convert raster cell coordinates into spatial coordinates.
- Raster physical georeferencing parameters covers the reverse calculation from stored affine coefficients back to pixel sizes, rotation, and basis-vector separation.
- Raster storage and WKB covers the current PostgreSQL varlena representation, Raster WKB/HexWKB paths, out-db band storage, and raster catalog contracts.
- PostGIS Raster and the GDAL driver records the
boundary between PostGIS-maintained raster storage/catalog behavior and the
external GDAL
PostGISRasterdriver.
- Topology internals covers internal topology implementation helpers such as edge end stars.