PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_IsPolygonCW()

Datum ST_IsPolygonCW ( PG_FUNCTION_ARGS  )

Definition at line 1301 of file lwgeom_functions_analytic.c.

References dumpnode::geom, is_clockwise(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_is_clockwise(), PG_FUNCTION_INFO_V1(), and ST_IsPolygonCCW().

Referenced by ST_GeometricMedian().

1302 {
1303  GSERIALIZED* geom;
1304  LWGEOM* input;
1305  bool is_clockwise;
1306 
1307  if (PG_ARGISNULL(0))
1308  PG_RETURN_NULL();
1309 
1310  geom = PG_GETARG_GSERIALIZED_P(0);
1311  input = lwgeom_from_gserialized(geom);
1312 
1313  is_clockwise = lwgeom_is_clockwise(input);
1314 
1315  lwgeom_free(input);
1316  PG_FREE_IF_COPY(geom, 0);
1317 
1318  PG_RETURN_BOOL(is_clockwise);
1319 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * geom
static int is_clockwise(int num_points, double *x, double *y, double *z)
int lwgeom_is_clockwise(LWGEOM *lwgeom)
Check clockwise orientation on LWGEOM polygons.
Definition: lwgeom.c:64
Here is the call graph for this function:
Here is the caller graph for this function: