PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ gml_reproject_pa()

static POINTARRAY* gml_reproject_pa ( POINTARRAY pa,
int  srid_in,
int  srid_out 
)
static

Use Proj4 to reproject a given POINTARRAY.

Definition at line 303 of file lwgeom_in_gml.c.

304 {
305  projPJ in_pj, out_pj;
306  char *text_in, *text_out;
307 
308  if (srid_in == SRID_UNKNOWN) return pa; /* nothing to do */
309  if (srid_out == SRID_UNKNOWN) gml_lwpgerror("invalid GML representation", 3);
310 
311  text_in = GetProj4StringSPI(srid_in);
312  text_out = GetProj4StringSPI(srid_out);
313 
314  in_pj = lwproj_from_string(text_in);
315  out_pj = lwproj_from_string(text_out);
316 
317  lwfree(text_in);
318  lwfree(text_out);
319 
320  if ( ptarray_transform(pa, in_pj, out_pj) == LW_FAILURE )
321  {
322  elog(ERROR, "gml_reproject_pa: reprojection failed");
323  }
324 
325  pj_free(in_pj);
326  pj_free(out_pj);
327 
328  return pa;
329 }
projPJ lwproj_from_string(const char *txt)
Get a projection from a string representation.
#define LW_FAILURE
Definition: liblwgeom.h:79
int ptarray_transform(POINTARRAY *pa, projPJ inpj, projPJ outpj)
Transform given POINTARRAY from inpj projection to outpj projection.
void lwfree(void *mem)
Definition: lwutil.c:244
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:188
static void gml_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
Definition: lwgeom_in_gml.c:82

References gml_lwpgerror(), LW_FAILURE, lwfree(), lwproj_from_string(), ptarray_transform(), and SRID_UNKNOWN.

Referenced by parse_gml_curve(), parse_gml_data(), parse_gml_line(), parse_gml_linearring(), parse_gml_patch(), parse_gml_point(), parse_gml_polygon(), and parse_gml_triangle().

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