1211 LWGEOM **lwgeoms, *outlwg;
1217 ArrayIterator iterator;
1221 POSTGIS_DEBUG(2,
"LWGEOM_collect_garray called.");
1223 if ( PG_ARGISNULL(0) )
1227 array = PG_GETARG_ARRAYTYPE_P(0);
1228 nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array));
1230 POSTGIS_DEBUGF(3,
" array is %d-bytes in size, %ld w/out header",
1231 ARR_SIZE(array), ARR_SIZE(array)-ARR_OVERHEAD_NONULLS(ARR_NDIM(array)));
1233 POSTGIS_DEBUGF(3,
"LWGEOM_collect_garray: array has %d elements", nelems);
1243 lwgeoms = palloc(
sizeof(
LWGEOM*) * nelems);
1247 #if POSTGIS_PGSQL_VERSION >= 95 1248 iterator = array_create_iterator(array, 0, NULL);
1250 iterator = array_create_iterator(array, 0);
1253 while( array_iterate(iterator, &value, &isnull) )
1267 POSTGIS_DEBUGF(3,
"%s: geom %d deserialized", __func__, count);
1275 if ( lwgeoms[count]->bbox )
1288 if ( lwgeoms[count]->bbox )
1318 array_free_iterator(iterator);
1321 POSTGIS_DEBUGF(3,
"LWGEOM_collect_garray: outtype = %d", outtype);
1332 box, count, lwgeoms);
1336 PG_RETURN_POINTER(result);
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
int lwtype_get_collectiontype(uint8_t type)
Given an lwtype number, what homogeneous collection can hold it?
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void error_if_srid_mismatch(int srid1, int srid2)
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
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.
#define SRID_UNKNOWN
Unknown SRID value.
void lwgeom_drop_srid(LWGEOM *lwgeom)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)