PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ lwgeom_transform_from_str()

int lwgeom_transform_from_str ( LWGEOM geom,
const char *  instr,
const char *  outstr 
)

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

228 {
229  LWPROJ *lp = lwproj_from_str(instr, outstr);
230  if (!lp)
231  {
232  PJ *pj_in = proj_create(PJ_DEFAULT_CTX, instr);
233  if (!pj_in)
234  {
235  proj_errno_reset(NULL);
236  lwerror("could not parse proj string '%s'", instr);
237  }
238  proj_destroy(pj_in);
239 
240  PJ *pj_out = proj_create(PJ_DEFAULT_CTX, outstr);
241  if (!pj_out)
242  {
243  proj_errno_reset(NULL);
244  lwerror("could not parse proj string '%s'", outstr);
245  }
246  proj_destroy(pj_out);
247  lwerror("%s: Failed to transform", __func__);
248  return LW_FAILURE;
249  }
250  int ret = lwgeom_transform(geom, lp);
251  proj_destroy(lp->pj);
252  lwfree(lp);
253  return ret;
254 }
int lwgeom_transform(LWGEOM *geom, LWPROJ *pj)
Transform given LWGEOM geometry from inpj projection to outpj projection.
LWPROJ * lwproj_from_str(const char *str_in, const char *str_out)
Allocate a new LWPROJ containing the reference to the PROJ's PJ If extra_geography_data is true,...
#define LW_FAILURE
Definition: liblwgeom.h:111
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:61

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

Referenced by transform_geom().

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