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

◆ encode_collection()

static Data__Geometry * encode_collection ( struct geobuf_agg_context ctx,
LWCOLLECTION lwcollection 
)
static

Definition at line 398 of file geobuf.c.

400{
401 int i, ngeoms;
402 Data__Geometry *geometry, **geometries;
403
404 geometry = galloc(DATA__GEOMETRY__TYPE__GEOMETRYCOLLECTION);
405
406 ngeoms = lwcollection->ngeoms;
407
408 if (ngeoms == 0)
409 return geometry;
410
411 geometries = palloc (sizeof (Data__Geometry *) * ngeoms);
412 for (i = 0; i < ngeoms; i++) {
413 LWGEOM *lwgeom = lwcollection->geoms[i];
414 Data__Geometry *geom = encode_geometry(ctx, lwgeom);
415 geometries[i] = geom;
416 }
417
418 geometry->n_geometries = ngeoms;
419 geometry->geometries = geometries;
420
421 return geometry;
422}
static Data__Geometry * galloc(Data__Geometry__Type type)
Definition geobuf.c:36
static Data__Geometry * encode_geometry(struct geobuf_agg_context *ctx, LWGEOM *lwgeom)
Definition geobuf.c:424
uint32_t ngeoms
Definition liblwgeom.h:580
LWGEOM ** geoms
Definition liblwgeom.h:575

References encode_geometry(), galloc(), LWCOLLECTION::geoms, and LWCOLLECTION::ngeoms.

Referenced by encode_geometry().

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