PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ issimple()

Datum issimple ( PG_FUNCTION_ARGS  )

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

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

Referenced by ST_Equals().

2571 {
2572  GSERIALIZED *geom;
2573  LWGEOM *lwgeom_in;
2574  int result;
2575 
2576  POSTGIS_DEBUG(2, "issimple called");
2577 
2578  geom = PG_GETARG_GSERIALIZED_P(0);
2579 
2580  if ( gserialized_is_empty(geom) )
2581  PG_RETURN_BOOL(true);
2582 
2583  lwgeom_in = lwgeom_from_gserialized(geom);
2584  result = lwgeom_is_simple(lwgeom_in);
2585  lwgeom_free(lwgeom_in) ;
2586  PG_FREE_IF_COPY(geom, 0);
2587 
2588  if (result == -1) {
2589  PG_RETURN_NULL(); /*never get here */
2590  }
2591 
2592  PG_RETURN_BOOL(result);
2593 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1128
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:
Here is the caller graph for this function: