PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ptarray_flip_coordinates()

POINTARRAY * ptarray_flip_coordinates ( POINTARRAY pa)
extern

Reverse X and Y axis on a given POINTARRAY.

Definition at line 368 of file ptarray.c.

369{
370 uint32_t i;
371 double d;
372 POINT4D p;
373
374 for (i=0 ; i < pa->npoints ; i++)
375 {
376 getPoint4d_p(pa, i, &p);
377 d = p.y;
378 p.y = p.x;
379 p.x = d;
380 ptarray_set_point4d(pa, i, &p);
381 }
382
383 return pa;
384}
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
Definition lwgeom_api.c:125
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
Definition lwgeom_api.c:369
double x
Definition liblwgeom.h:414
double y
Definition liblwgeom.h:414
uint32_t npoints
Definition liblwgeom.h:427

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

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: