PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ ST_IsPolygonCCW()

Datum ST_IsPolygonCCW ( PG_FUNCTION_ARGS  )

Definition at line 1300 of file lwgeom_functions_analytic.c.

References dumpnode::geom, lwgeom_free(), lwgeom_from_gserialized(), lwgeom_is_clockwise(), and lwgeom_reverse_in_place().

Referenced by ST_IsPolygonCW().

1301 {
1302  GSERIALIZED* geom;
1303  LWGEOM* input;
1304  bool is_ccw;
1305 
1306  if (PG_ARGISNULL(0))
1307  PG_RETURN_NULL();
1308 
1309  geom = PG_GETARG_GSERIALIZED_P_COPY(0);
1310  input = lwgeom_from_gserialized(geom);
1311  lwgeom_reverse_in_place(input);
1312  is_ccw = lwgeom_is_clockwise(input);
1313  lwgeom_free(input);
1314  PG_FREE_IF_COPY(geom, 0);
1315 
1316  PG_RETURN_BOOL(is_ccw);
1317 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_reverse_in_place(LWGEOM *lwgeom)
Reverse vertex order of LWGEOM.
Definition: lwgeom.c:102
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * geom
int lwgeom_is_clockwise(LWGEOM *lwgeom)
Ensure the outer ring is clockwise oriented and all inner rings are counter-clockwise.
Definition: lwgeom.c:65
Here is the call graph for this function:
Here is the caller graph for this function: