PostGIS  2.3.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 153 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(), is_gserialized_from_datum_empty(), isring(), issimple(), isvalid(), LWGEOM_line_interpolate_point(), LWGEOM_snaptogrid(), LWGEOM_snaptogrid_pointoff(), overlaps(), pgis_union_geometry_array(), pointonsurface(), postgis_valid_typmod(), ST_Equals(), ST_MinimumBoundingCircle(), ST_MinimumBoundingRadius(), test_gserialized_is_empty(), topologypreservesimplify(), and touches().

154 {
155  uint8_t *p = (uint8_t*)g;
156  int isempty = 0;
157  assert(g);
159  p += 8; /* Skip varhdr and srid/flags */
160  if( FLAGS_GET_BBOX(g->flags) )
161  p += gbox_serialized_size(g->flags); /* Skip the box */
163  gserialized_is_empty_recurse(p, &isempty);
164  return isempty;
165 }
static size_t gserialized_is_empty_recurse(const uint8_t *p, int *isempty)
Definition: g_serialized.c:126
#define FLAGS_GET_BBOX(flags)
Definition: liblwgeom.h:141
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:451
uint8_t flags
Definition: liblwgeom.h:382
Here is the call graph for this function:
Here is the caller graph for this function: