PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ gserialized2_from_lwcollection()

static size_t gserialized2_from_lwcollection ( const LWCOLLECTION coll,
uint8_t *  buf 
)
static

Definition at line 1006 of file gserialized2.c.

1007 {
1008  size_t subsize = 0;
1009  uint8_t *loc;
1010  uint32_t i;
1011  int type;
1012 
1013  assert(coll);
1014  assert(buf);
1015 
1016  type = coll->type;
1017  loc = buf;
1018 
1019  /* Write in the type. */
1020  memcpy(loc, &type, sizeof(uint32_t));
1021  loc += sizeof(uint32_t);
1022 
1023  /* Write in the number of subgeoms. */
1024  memcpy(loc, &coll->ngeoms, sizeof(uint32_t));
1025  loc += sizeof(uint32_t);
1026 
1027  /* Serialize subgeoms. */
1028  for (i = 0; i < coll->ngeoms; i++)
1029  {
1030  if (FLAGS_GET_ZM(coll->flags) != FLAGS_GET_ZM(coll->geoms[i]->flags))
1031  lwerror("Dimensions mismatch in lwcollection");
1032  subsize = gserialized2_from_lwgeom_any(coll->geoms[i], loc);
1033  loc += subsize;
1034  }
1035 
1036  return (size_t)(loc - buf);
1037 }
static size_t gserialized2_from_lwgeom_any(const LWGEOM *geom, uint8_t *buf)
#define FLAGS_GET_ZM(flags)
Definition: liblwgeom.h:194
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
type
Definition: ovdump.py:42
lwflags_t flags
Definition: liblwgeom.h:563
uint32_t ngeoms
Definition: liblwgeom.h:566
uint8_t type
Definition: liblwgeom.h:564
LWGEOM ** geoms
Definition: liblwgeom.h:561
lwflags_t flags
Definition: liblwgeom.h:447

References LWGEOM::flags, LWCOLLECTION::flags, FLAGS_GET_ZM, LWCOLLECTION::geoms, gserialized2_from_lwgeom_any(), lwerror(), LWCOLLECTION::ngeoms, LWCOLLECTION::type, and ovdump::type.

Referenced by gserialized2_from_lwgeom_any().

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