PostGIS  2.5.0beta1dev-r@@SVN_REVISION@@

◆ issimple()

Datum issimple ( PG_FUNCTION_ARGS  )

Definition at line 2572 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().

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