PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ gserialized1_is_empty()

int gserialized1_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 203 of file gserialized1.c.

204 {
205  uint8_t *p = (uint8_t*)g;
206  int isempty = 0;
207  assert(g);
208 
209  p += 8; /* Skip varhdr and srid/flags */
210  if(gserialized1_has_bbox(g))
211  p += gserialized1_box_size(g); /* Skip the box */
212 
213  gserialized1_is_empty_recurse(p, &isempty);
214  return isempty;
215 }
int gserialized1_has_bbox(const GSERIALIZED *gser)
Check if a GSERIALIZED has a bounding box without deserializing first.
Definition: gserialized1.c:89
static size_t gserialized1_box_size(const GSERIALIZED *g)
Definition: gserialized1.c:63
static size_t gserialized1_is_empty_recurse(const uint8_t *p, int *isempty)
Definition: gserialized1.c:176

References gserialized1_box_size(), gserialized1_has_bbox(), and gserialized1_is_empty_recurse().

Referenced by gserialized_is_empty(), and test_gserialized1_is_empty().

Here is the call graph for this function:
Here is the caller graph for this function: