1134 LWGEOM *lwgeoms[2], *outlwg;
1135 uint32 type1, type2;
1139 POSTGIS_DEBUG(2,
"LWGEOM_collect called.");
1142 if ( PG_ARGISNULL(0) && PG_ARGISNULL(1) )
1146 if (PG_ARGISNULL(0))
1147 PG_RETURN_DATUM(PG_GETARG_DATUM(1));
1150 if (PG_ARGISNULL(1))
1151 PG_RETURN_DATUM(PG_GETARG_DATUM(0));
1153 gser1 = PG_GETARG_GSERIALIZED_P(0);
1154 gser2 = PG_GETARG_GSERIALIZED_P(1);
1160 elog(ERROR,
"Cannot ST_Collect geometries with differing dimensionality.");
1170 type1 = lwgeoms[0]->
type;
1171 type2 = lwgeoms[1]->
type;
1178 POSTGIS_DEBUGF(3,
" outtype = %d", outtype);
1192 PG_FREE_IF_COPY(gser1, 0);
1193 PG_FREE_IF_COPY(gser2, 1);
1195 PG_RETURN_POINTER(result);
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *s)
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_free(LWGEOM *geom)
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM can contain sub-geometries or not.
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define FLAGS_GET_ZM(flags)
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
void error_if_srid_mismatch(int srid1, int srid2)
void lwgeom_drop_srid(LWGEOM *lwgeom)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)