1289 LWGEOM **lwgeoms, *outlwg;
1295 ArrayIterator iterator;
1299 POSTGIS_DEBUG(2,
"LWGEOM_collect_garray called.");
1301 if (PG_ARGISNULL(0))
1305 array = PG_GETARG_ARRAYTYPE_P(0);
1306 nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array));
1309 " array is %d-bytes in size, %ld w/out header",
1311 ARR_SIZE(array) - ARR_OVERHEAD_NONULLS(ARR_NDIM(array)));
1313 POSTGIS_DEBUGF(3,
"LWGEOM_collect_garray: array has %d elements", nelems);
1323 lwgeoms = palloc(
sizeof(
LWGEOM *) * nelems);
1327 iterator = array_create_iterator(array, 0, NULL);
1329 while (array_iterate(iterator, &
value, &isnull))
1343 POSTGIS_DEBUGF(3,
"%s: geom %d deserialized", __func__,
count);
1351 if (lwgeoms[
count]->bbox)
1362 if (lwgeoms[
count]->bbox)
1389 array_free_iterator(iterator);
1391 POSTGIS_DEBUGF(3,
"LWGEOM_collect_garray: outtype = %d", outtype);
1402 result = geometry_serialize(outlwg);
1404 PG_RETURN_POINTER(
result);
char result[OUT_DOUBLE_BUFFER_SIZE]
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)