1130 LWGEOM *lwgeoms[2], *outlwg;
1131 uint32 type1, type2;
1135 POSTGIS_DEBUG(2,
"LWGEOM_collect called.");
1138 if ( PG_ARGISNULL(0) && PG_ARGISNULL(1) )
1142 if (PG_ARGISNULL(0))
1143 PG_RETURN_DATUM(PG_GETARG_DATUM(1));
1146 if (PG_ARGISNULL(1))
1147 PG_RETURN_DATUM(PG_GETARG_DATUM(0));
1149 gser1 = PG_GETARG_GSERIALIZED_P(0);
1150 gser2 = PG_GETARG_GSERIALIZED_P(1);
1156 elog(ERROR,
"Cannot ST_Collect geometries with differing dimensionality.");
1166 type1 = lwgeoms[0]->
type;
1167 type2 = lwgeoms[1]->
type;
1174 POSTGIS_DEBUGF(3,
" outtype = %d", outtype);
1188 PG_FREE_IF_COPY(gser1, 0);
1189 PG_FREE_IF_COPY(gser2, 1);
1191 PG_RETURN_POINTER(result);
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?
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM can contain sub-geometries or not.
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 lwgeom_free(LWGEOM *geom)
#define FLAGS_GET_ZM(flags)
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.
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
void lwgeom_drop_srid(LWGEOM *lwgeom)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
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)...