PostGIS  2.5.7dev-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.

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 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define TRIANGLETYPE
Definition: liblwgeom.h:98
void lwtriangle_force_clockwise(LWTRIANGLE *triangle)
Definition: lwtriangle.c:106
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
uint32_t ngeoms
Definition: liblwgeom.h:510
LWGEOM ** geoms
Definition: liblwgeom.h:512
uint8_t type
Definition: liblwgeom.h:399
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by lwgeom_force_clockwise(), LWGEOM_force_clockwise_poly(), mvt_grid_and_validate_geos(), and test_lwgeom_force_clockwise().

Here is the call graph for this function:
Here is the caller graph for this function: