1226 LWGEOM **lwgeoms, *outlwg;
1232 ArrayIterator iterator;
1236 POSTGIS_DEBUG(2,
"LWGEOM_collect_garray called.");
1238 if (PG_ARGISNULL(0))
1242 array = PG_GETARG_ARRAYTYPE_P(0);
1243 nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array));
1246 " array is %d-bytes in size, %ld w/out header",
1248 ARR_SIZE(array) - ARR_OVERHEAD_NONULLS(ARR_NDIM(array)));
1250 POSTGIS_DEBUGF(3,
"LWGEOM_collect_garray: array has %d elements", nelems);
1260 lwgeoms = palloc(
sizeof(
LWGEOM *) * nelems);
1264 iterator = array_create_iterator(array, 0, NULL);
1266 while (array_iterate(iterator, &
value, &isnull))
1280 POSTGIS_DEBUGF(3,
"%s: geom %d deserialized", __func__,
count);
1288 if (lwgeoms[
count]->bbox)
1299 if (lwgeoms[
count]->bbox)
1326 array_free_iterator(iterator);
1328 POSTGIS_DEBUGF(3,
"LWGEOM_collect_garray: outtype = %d", outtype);
1341 PG_RETURN_POINTER(result);
int gbox_merge(const GBOX *new_box, GBOX *merge_box)
Update the merged GBOX to be large enough to include itself and the new box.
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
void gserialized_error_if_srid_mismatch_reference(const GSERIALIZED *g1, const int32_t srid2, const char *funcname)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
uint32_t lwtype_get_collectiontype(uint8_t type)
Given an lwtype number, what homogeneous collection can hold it?
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
LWCOLLECTION * lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
#define SRID_UNKNOWN
Unknown SRID value.
void lwgeom_drop_srid(LWGEOM *lwgeom)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)