PostGIS  2.1.10dev-r@@SVN_REVISION@@
int gserialized_is_empty ( const GSERIALIZED g)

Check if a GSERIALIZED is empty without deserializing first.

Only checks if the number of elements of the parent geometry is zero, will not catch collections of empty, eg: GEOMETRYCOLLECTION(POINT EMPTY)

Definition at line 140 of file g_serialized.c.

References GSERIALIZED::flags, FLAGS_GET_BBOX, gbox_serialized_size(), and gserialized_is_empty_recurse().

Referenced by boundary(), buffer(), centroid(), contains(), containsproperly(), convexhull(), coveredby(), covers(), crosses(), disjoint(), geography_bestsrid(), geography_distance(), geography_distance_tree(), geography_dwithin(), geography_segmentize(), geos_intersects(), hausdorffdistance(), hausdorffdistancedensify(), isring(), issimple(), isvalid(), LWGEOM_line_interpolate_point(), LWGEOM_snaptogrid(), overlaps(), pgis_union_geometry_array(), pointonsurface(), postgis_valid_typmod(), ST_Equals(), ST_UnaryUnion(), test_gserialized_is_empty(), topologypreservesimplify(), and touches().

141 {
142  uint8_t *p = (uint8_t*)g;
143  int isempty = 0;
144  assert(g);
145 
146  p += 8; /* Skip varhdr and srid/flags */
147  if( FLAGS_GET_BBOX(g->flags) )
148  p += gbox_serialized_size(g->flags); /* Skip the box */
149 
150  gserialized_is_empty_recurse(p, &isempty);
151  return isempty;
152 }
static size_t gserialized_is_empty_recurse(const uint8_t *p, int *isempty)
Definition: g_serialized.c:113
#define FLAGS_GET_BBOX(flags)
Definition: liblwgeom.h:108
size_t gbox_serialized_size(uint8_t flags)
Return the number of bytes necessary to hold a GBOX of this dimension in serialized form...
Definition: g_box.c:375
uint8_t flags
Definition: liblwgeom.h:339

Here is the call graph for this function:

Here is the caller graph for this function: