PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum issimple ( PG_FUNCTION_ARGS  )

Definition at line 2712 of file postgis/lwgeom_geos.c.

References dumpnode::geom, gserialized_is_empty(), lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_is_simple().

2713 {
2714  GSERIALIZED *geom;
2715  LWGEOM *lwgeom_in;
2716  int result;
2717 
2718  POSTGIS_DEBUG(2, "issimple called");
2719 
2720  geom = PG_GETARG_GSERIALIZED_P(0);
2721 
2722  if ( gserialized_is_empty(geom) )
2723  PG_RETURN_BOOL(true);
2724 
2725  lwgeom_in = lwgeom_from_gserialized(geom);
2726  result = lwgeom_is_simple(lwgeom_in);
2727  lwgeom_free(lwgeom_in) ;
2728  PG_FREE_IF_COPY(geom, 0);
2729 
2730  if (result == -1) {
2731  PG_RETURN_NULL(); /*never get here */
2732  }
2733 
2734  PG_RETURN_BOOL(result);
2735 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1137
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
Definition: g_serialized.c:178
LWGEOM * geom
int lwgeom_is_simple(const LWGEOM *lwgeom)

Here is the call graph for this function: