PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ gserialized2_from_lwcollection()

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

Definition at line 1039 of file gserialized2.c.

1040{
1041 size_t subsize = 0;
1042 uint8_t *loc;
1043 uint32_t i;
1044 int type;
1045
1046 assert(coll);
1047 assert(buf);
1048
1049 type = coll->type;
1050 loc = buf;
1051
1052 /* Write in the type. */
1053 memcpy(loc, &type, sizeof(uint32_t));
1054 loc += sizeof(uint32_t);
1055
1056 /* Write in the number of subgeoms. */
1057 memcpy(loc, &coll->ngeoms, sizeof(uint32_t));
1058 loc += sizeof(uint32_t);
1059
1060 /* Serialize subgeoms. */
1061 for (i = 0; i < coll->ngeoms; i++)
1062 {
1063 if (FLAGS_GET_ZM(coll->flags) != FLAGS_GET_ZM(coll->geoms[i]->flags))
1064 lwerror("Dimensions mismatch in lwcollection");
1065 subsize = gserialized2_from_lwgeom_any(coll->geoms[i], loc);
1066 loc += subsize;
1067 }
1068
1069 return (size_t)(loc - buf);
1070}
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
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, and LWCOLLECTION::type.

Referenced by gserialized2_from_lwgeom_any().

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