PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ issimple()

Datum issimple ( PG_FUNCTION_ARGS  )

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

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