PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ gserialized_is_empty()

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 139 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(), LWGEOM_snaptogrid_pointoff(), overlaps(), pgis_union_geometry_array(), pointonsurface(), postgis_valid_typmod(), ST_Equals(), test_gserialized_is_empty(), topologypreservesimplify(), and touches().

140 {
141  uint8_t *p = (uint8_t*)g;
142  int isempty = 0;
143  assert(g);
145  p += 8; /* Skip varhdr and srid/flags */
146  if( FLAGS_GET_BBOX(g->flags) )
147  p += gbox_serialized_size(g->flags); /* Skip the box */
149  gserialized_is_empty_recurse(p, &isempty);
150  return isempty;
151 }
static size_t gserialized_is_empty_recurse(const uint8_t *p, int *isempty)
Definition: g_serialized.c:112
#define FLAGS_GET_BBOX(flags)
Definition: liblwgeom.h:126
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:416
uint8_t flags
Definition: liblwgeom.h:367
Here is the call graph for this function:
Here is the caller graph for this function: