PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwgeom_transform_pipeline()

int lwgeom_transform_pipeline ( LWGEOM geom,
const char *  pipeline,
bool  is_forward 
)

Transform (reproject) a geometry in-place using a PROJ pipeline.

Parameters
geomthe geometry to transform
pipelinethe coordinate operation pipeline string. Either:
  • urn:ogc:def:coordinateOperation:AUTHORITY::CODE
  • a PROJ pipeline string: +proj=pipeline ...
  • concatenated operations: urn:ogc:def:coordinateOperation,coordinateOperation:EPSG::3895,coordinateOperation:EPSG::1618
is_forwardwhether to execute the pipeline in a forward or inverse direction.

Definition at line 187 of file liblwgeom/lwgeom_transform.c.

188 {
189  LWPROJ *lp = lwproj_from_str_pipeline(pipelinestr, is_forward);
190  if (!lp)
191  {
192  PJ *pj_in = proj_create(PJ_DEFAULT_CTX, pipelinestr);
193  if (!pj_in)
194  {
195  proj_errno_reset(NULL);
196  lwerror("could not parse coordinate operation '%s'", pipelinestr);
197  }
198  proj_destroy(pj_in);
199  lwerror("%s: Failed to transform", __func__);
200  return LW_FAILURE;
201  }
202  int ret = lwgeom_transform(geom, lp);
203  proj_destroy(lp->pj);
204  lwfree(lp);
205  return ret;
206 }
int lwgeom_transform(LWGEOM *geom, LWPROJ *pj)
Transform given LWGEOM geometry from inpj projection to outpj projection.
LWPROJ * lwproj_from_str_pipeline(const char *str_pipeline, bool is_forward)
Allocate a new LWPROJ containing the reference to the PROJ's PJ using a PROJ pipeline definition:
#define LW_FAILURE
Definition: liblwgeom.h:96
void lwfree(void *mem)
Definition: lwutil.c:242
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
PJ * pj
Definition: liblwgeom.h:46

References LW_FAILURE, lwerror(), lwfree(), lwgeom_transform(), lwproj_from_str_pipeline(), and LWPROJ::pj.

Referenced by transform_pipeline_geom().

Here is the call graph for this function:
Here is the caller graph for this function: