PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_reverse()

void lwgeom_reverse ( LWGEOM lwgeom)

Reverse vertex order of LWGEOM.

Definition at line 93 of file lwgeom.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LWCOLLECTION::geoms, LINETYPE, lwcircstring_reverse(), lwline_reverse(), lwpoly_reverse(), lwtriangle_reverse(), MULTICURVETYPE, MULTILINETYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, LWCOLLECTION::ngeoms, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by LWGEOM_reverse(), lwt_GetFaceEdges(), mvt_geom(), ST_IsPolygonCCW(), and test_lwcurve_linearize().

94 {
95  int i;
96  LWCOLLECTION *col;
97 
98  switch (lwgeom->type)
99  {
100  case LINETYPE:
101  lwline_reverse((LWLINE *)lwgeom);
102  return;
103  case POLYGONTYPE:
104  lwpoly_reverse((LWPOLY *)lwgeom);
105  return;
106  case TRIANGLETYPE:
107  lwtriangle_reverse((LWTRIANGLE *)lwgeom);
108  return;
109  case CIRCSTRINGTYPE:
111  return;
112  case MULTICURVETYPE:
113  case MULTILINETYPE:
114  case MULTIPOLYGONTYPE:
115  case MULTISURFACETYPE:
117  case TINTYPE:
118  case COLLECTIONTYPE:
119  case COMPOUNDTYPE:
120  case CURVEPOLYTYPE:
121  col = (LWCOLLECTION *)lwgeom;
122  for (i=0; i<col->ngeoms; i++)
123  lwgeom_reverse(col->geoms[i]);
124  return;
125  }
126 }
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTICURVETYPE
Definition: liblwgeom.h:95
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define TRIANGLETYPE
Definition: liblwgeom.h:98
void lwtriangle_reverse(LWTRIANGLE *triangle)
Definition: lwtriangle.c:119
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
void lwcircstring_reverse(LWCIRCSTRING *curve)
Definition: lwcircstring.c:131
LWGEOM ** geoms
Definition: liblwgeom.h:509
#define TINTYPE
Definition: liblwgeom.h:99
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
void lwpoly_reverse(LWPOLY *poly)
Definition: lwpoly.c:314
void lwline_reverse(LWLINE *line)
Definition: lwline.c:140
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
uint8_t type
Definition: liblwgeom.h:396
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
void lwgeom_reverse(LWGEOM *lwgeom)
Reverse vertex order of LWGEOM.
Definition: lwgeom.c:93
Here is the call graph for this function:
Here is the caller graph for this function: