PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum ST_IsCollection ( PG_FUNCTION_ARGS  )

Definition at line 2121 of file lwgeom_functions_basic.c.

References gserialized_get_type(), and lwtype_is_collection().

2122 {
2123  GSERIALIZED *geom;
2124  int type;
2125  size_t size;
2126 
2127  /* Pull only a small amount of the tuple, enough to get the type. */
2128  /* header + srid/flags + bbox? + type number */
2129  size = VARHDRSZ + 8 + 32 + 4;
2130 
2131  geom = (GSERIALIZED*)PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, size);
2132 
2133  type = gserialized_get_type(geom);
2134  PG_RETURN_BOOL(lwtype_is_collection(type));
2135 }
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
Definition: g_serialized.c:56
LWGEOM * geom
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
Definition: lwgeom.c:955

Here is the call graph for this function: