PostGISSpatial Reference System

ST_InverseTransformPipeline

What is ST_InverseTransformPipeline?

ST_InverseTransformPipeline runs a PROJ pipeline string in reverse on a geometry, moving coordinates from the pipeline's target CRS back to its source CRS. Available from PostGIS 3.4.

SQL
ST_InverseTransformPipeline(geometry geom, text pipeline, integer to_srid = 0)geometry

pipeline is a PROJ-formatted operation string. to_srid sets the SRID to attach to the output, defaulting to 0 (unknown).

When would you use ST_InverseTransformPipeline?

Use ST_InverseTransformPipeline when you need finer control than ST_Transform offers — for instance when applying a specific datum shift, grid correction, or multi-step chain of projection operations. The pipeline string lets you pin the exact transformation PROJ should use, avoiding the default chooser that may pick a different operation across PROJ versions.

It is the counterpart of ST_TransformPipeline — use it when your workflow produced geometry in a transformed CRS and you now need to convert back to the original source space.

FAQs

What pipeline format does it expect?

The standard PROJ +proj=pipeline +step ... syntax or an OGC WKT2 coordinate operation. Any string accepted by proj_create can be used.

Why use pipelines instead of ST_Transform?

ST_Transform asks PROJ to choose a transformation automatically. For regulated surveys, archival reproducibility, or grid-shift accuracy, pinning the pipeline avoids silent differences between PROJ versions.

Why is to_srid optional?

The SRID stored on the output is a PostGIS concept independent from the pipeline. If the target CRS has an SRID you care about, supply it explicitly; otherwise 0 keeps the geometry SRID-less.

What version introduced ST_InverseTransformPipeline?

PostGIS 3.4.