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

◆ gserialized1_from_lwcollection()

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

Definition at line 948 of file gserialized1.c.

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

Referenced by gserialized1_from_lwgeom_any().

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