PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ gserialized2_from_lwcollection()

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

Definition at line 1008 of file gserialized2.c.

1009 {
1010  size_t subsize = 0;
1011  uint8_t *loc;
1012  uint32_t i;
1013  int type;
1014 
1015  assert(coll);
1016  assert(buf);
1017 
1018  type = coll->type;
1019  loc = buf;
1020 
1021  /* Write in the type. */
1022  memcpy(loc, &type, sizeof(uint32_t));
1023  loc += sizeof(uint32_t);
1024 
1025  /* Write in the number of subgeoms. */
1026  memcpy(loc, &coll->ngeoms, sizeof(uint32_t));
1027  loc += sizeof(uint32_t);
1028 
1029  /* Serialize subgeoms. */
1030  for (i = 0; i < coll->ngeoms; i++)
1031  {
1032  if (FLAGS_GET_ZM(coll->flags) != FLAGS_GET_ZM(coll->geoms[i]->flags))
1033  lwerror("Dimensions mismatch in lwcollection");
1034  subsize = gserialized2_from_lwgeom_any(coll->geoms[i], loc);
1035  loc += subsize;
1036  }
1037 
1038  return (size_t)(loc - buf);
1039 }
static size_t gserialized2_from_lwgeom_any(const LWGEOM *geom, uint8_t *buf)
#define FLAGS_GET_ZM(flags)
Definition: liblwgeom.h:180
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:577
uint32_t ngeoms
Definition: liblwgeom.h:580
uint8_t type
Definition: liblwgeom.h:578
LWGEOM ** geoms
Definition: liblwgeom.h:575
lwflags_t flags
Definition: liblwgeom.h:461

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: