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

Reverse vertex order of LWGEOM.

Definition at line 51 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().

52 {
53  int i;
54  LWCOLLECTION *col;
55 
56  switch (lwgeom->type)
57  {
58  case LINETYPE:
59  lwline_reverse((LWLINE *)lwgeom);
60  return;
61  case POLYGONTYPE:
62  lwpoly_reverse((LWPOLY *)lwgeom);
63  return;
64  case TRIANGLETYPE:
65  lwtriangle_reverse((LWTRIANGLE *)lwgeom);
66  return;
67  case MULTILINETYPE:
68  case MULTIPOLYGONTYPE:
70  case TINTYPE:
71  case COLLECTIONTYPE:
72  col = (LWCOLLECTION *)lwgeom;
73  for (i=0; i<col->ngeoms; i++)
74  lwgeom_reverse(col->geoms[i]);
75  return;
76  }
77 }
#define LINETYPE
Definition: liblwgeom.h:61
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define TRIANGLETYPE
Definition: liblwgeom.h:73
void lwtriangle_reverse(LWTRIANGLE *triangle)
Definition: lwtriangle.c:100
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:72
LWGEOM ** geoms
Definition: liblwgeom.h:465
#define TINTYPE
Definition: liblwgeom.h:74
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
void lwpoly_reverse(LWPOLY *poly)
Definition: lwpoly.c:201
void lwline_reverse(LWLINE *line)
Definition: lwline.c:127
uint8_t type
Definition: liblwgeom.h:352
#define MULTILINETYPE
Definition: liblwgeom.h:64
#define COLLECTIONTYPE
Definition: liblwgeom.h:66
void lwgeom_reverse(LWGEOM *lwgeom)
Reverse vertex order of LWGEOM.
Definition: lwgeom.c:51

Here is the call graph for this function:

Here is the caller graph for this function: