PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ gserialized1_from_lwcollection()

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

Definition at line 949 of file gserialized1.c.

950 {
951  size_t subsize = 0;
952  uint8_t *loc;
953  uint32_t i;
954  int type;
955 
956  assert(coll);
957  assert(buf);
958 
959  type = coll->type;
960  loc = buf;
961 
962  /* Write in the type. */
963  memcpy(loc, &type, sizeof(uint32_t));
964  loc += sizeof(uint32_t);
965 
966  /* Write in the number of subgeoms. */
967  memcpy(loc, &coll->ngeoms, sizeof(uint32_t));
968  loc += sizeof(uint32_t);
969 
970  /* Serialize subgeoms. */
971  for ( i=0; i<coll->ngeoms; i++ )
972  {
973  if (FLAGS_GET_ZM(coll->flags) != FLAGS_GET_ZM(coll->geoms[i]->flags))
974  lwerror("Dimensions mismatch in lwcollection");
975  subsize = gserialized1_from_lwgeom_any(coll->geoms[i], loc);
976  loc += subsize;
977  }
978 
979  return (size_t)(loc - buf);
980 }
static size_t gserialized1_from_lwgeom_any(const LWGEOM *geom, uint8_t *buf)
Definition: gserialized1.c:982
#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, gserialized1_from_lwgeom_any(), lwerror(), LWCOLLECTION::ngeoms, LWCOLLECTION::type, and ovdump::type.

Referenced by gserialized1_from_lwgeom_any().

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