PostGIS  2.3.7dev-r@@SVN_REVISION@@
void lwgeom_reverse ( LWGEOM lwgeom)

Reverse vertex order of LWGEOM.

Definition at line 64 of file lwgeom.c.

References COLLECTIONTYPE, LWCOLLECTION::geoms, LINETYPE, lwline_reverse(), lwpoly_reverse(), lwtriangle_reverse(), MULTILINETYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by LWGEOM_reverse(), and lwt_GetFaceEdges().

65 {
66  int i;
67  LWCOLLECTION *col;
68 
69  switch (lwgeom->type)
70  {
71  case LINETYPE:
72  lwline_reverse((LWLINE *)lwgeom);
73  return;
74  case POLYGONTYPE:
75  lwpoly_reverse((LWPOLY *)lwgeom);
76  return;
77  case TRIANGLETYPE:
78  lwtriangle_reverse((LWTRIANGLE *)lwgeom);
79  return;
80  case MULTILINETYPE:
81  case MULTIPOLYGONTYPE:
83  case TINTYPE:
84  case COLLECTIONTYPE:
85  col = (LWCOLLECTION *)lwgeom;
86  for (i=0; i<col->ngeoms; i++)
87  lwgeom_reverse(col->geoms[i]);
88  return;
89  }
90 }
#define LINETYPE
Definition: liblwgeom.h:85
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define TRIANGLETYPE
Definition: liblwgeom.h:97
void lwtriangle_reverse(LWTRIANGLE *triangle)
Definition: lwtriangle.c:113
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
LWGEOM ** geoms
Definition: liblwgeom.h:508
#define TINTYPE
Definition: liblwgeom.h:98
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
void lwpoly_reverse(LWPOLY *poly)
Definition: lwpoly.c:272
void lwline_reverse(LWLINE *line)
Definition: lwline.c:140
uint8_t type
Definition: liblwgeom.h:395
#define MULTILINETYPE
Definition: liblwgeom.h:88
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
void lwgeom_reverse(LWGEOM *lwgeom)
Reverse vertex order of LWGEOM.
Definition: lwgeom.c:64

Here is the call graph for this function:

Here is the caller graph for this function: