PostGIS 3.7.0dev-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 1009 of file gserialized2.c.

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