PostGIS  2.1.10dev-r@@SVN_REVISION@@
POINTARRAY* ptarray_flip_coordinates ( POINTARRAY pa)

Reverse X and Y axis on a given POINTARRAY.

Definition at line 354 of file ptarray.c.

References getPoint4d_p(), POINTARRAY::npoints, ptarray_set_point4d(), POINT4D::x, and POINT4D::y.

Referenced by lwgeom_flip_coordinates(), 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().

355 {
356  int i;
357  double d;
358  POINT4D p;
359 
360  for (i=0 ; i < pa->npoints ; i++)
361  {
362  getPoint4d_p(pa, i, &p);
363  d = p.y;
364  p.y = p.x;
365  p.x = d;
366  ptarray_set_point4d(pa, i, &p);
367  }
368 
369  return pa;
370 }
void ptarray_set_point4d(POINTARRAY *pa, int n, const POINT4D *p4d)
Definition: lwgeom_api.c:501
double x
Definition: liblwgeom.h:308
int npoints
Definition: liblwgeom.h:327
double y
Definition: liblwgeom.h:308
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
Definition: lwgeom_api.c:217

Here is the call graph for this function:

Here is the caller graph for this function: