PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ lwgeom_force_clockwise()

void lwgeom_force_clockwise ( LWGEOM lwgeom)

Force Right-hand-rule on LWGEOM polygons.

Definition at line 37 of file lwgeom.c.

References COLLECTIONTYPE, LWCOLLECTION::geoms, lwpoly_force_clockwise(), lwtriangle_force_clockwise(), MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, POLYGONTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by LWGEOM_force_clockwise_poly(), mvt_geom(), and test_lwgeom_force_clockwise().

38 {
39  LWCOLLECTION *coll;
40  uint32_t i;
41 
42  switch (lwgeom->type)
43  {
44  case POLYGONTYPE:
45  lwpoly_force_clockwise((LWPOLY *)lwgeom);
46  return;
47 
48  case TRIANGLETYPE:
50  return;
51 
52  /* Not handle POLYHEDRALSURFACE and TIN
53  as they are supposed to be well oriented */
54  case MULTIPOLYGONTYPE:
55  case COLLECTIONTYPE:
56  coll = (LWCOLLECTION *)lwgeom;
57  for (i=0; i<coll->ngeoms; i++)
58  lwgeom_force_clockwise(coll->geoms[i]);
59  return;
60  }
61 }
void lwpoly_force_clockwise(LWPOLY *poly)
Definition: lwpoly.c:268
void lwgeom_force_clockwise(LWGEOM *lwgeom)
Force Right-hand-rule on LWGEOM polygons.
Definition: lwgeom.c:37
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define TRIANGLETYPE
Definition: liblwgeom.h:97
void lwtriangle_force_clockwise(LWTRIANGLE *triangle)
Definition: lwtriangle.c:106
uint32_t ngeoms
Definition: liblwgeom.h:509
unsigned int uint32_t
Definition: uthash.h:78
LWGEOM ** geoms
Definition: liblwgeom.h:511
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
uint8_t type
Definition: liblwgeom.h:398
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
Here is the call graph for this function:
Here is the caller graph for this function: