PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ gserialized_from_lwcollection()

static size_t gserialized_from_lwcollection ( const LWCOLLECTION coll,
uint8_t buf 
)
static

Definition at line 1035 of file g_serialized.c.

1036 {
1037  size_t subsize = 0;
1038  uint8_t *loc;
1039  uint32_t i;
1040  int type;
1041 
1042  assert(coll);
1043  assert(buf);
1044 
1045  type = coll->type;
1046  loc = buf;
1047 
1048  /* Write in the type. */
1049  memcpy(loc, &type, sizeof(uint32_t));
1050  loc += sizeof(uint32_t);
1051 
1052  /* Write in the number of subgeoms. */
1053  memcpy(loc, &coll->ngeoms, sizeof(uint32_t));
1054  loc += sizeof(uint32_t);
1055 
1056  /* Serialize subgeoms. */
1057  for ( i=0; i<coll->ngeoms; i++ )
1058  {
1059  if (FLAGS_GET_ZM(coll->flags) != FLAGS_GET_ZM(coll->geoms[i]->flags))
1060  lwerror("Dimensions mismatch in lwcollection");
1061  subsize = gserialized_from_lwgeom_any(coll->geoms[i], loc);
1062  loc += subsize;
1063  }
1064 
1065  return (size_t)(loc - buf);
1066 }
static size_t gserialized_from_lwgeom_any(const LWGEOM *geom, uint8_t *buf)
#define FLAGS_GET_ZM(flags)
Definition: liblwgeom.h:153
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
type
Definition: ovdump.py:41
uint32_t ngeoms
Definition: liblwgeom.h:510
uint8_t type
Definition: liblwgeom.h:506
uint8_t flags
Definition: liblwgeom.h:507
LWGEOM ** geoms
Definition: liblwgeom.h:512
uint8_t flags
Definition: liblwgeom.h:400
unsigned int uint32_t
Definition: uthash.h:78
unsigned char uint8_t
Definition: uthash.h:79

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

Referenced by gserialized_from_lwgeom_any().

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