Datum force_2d(PG_FUNCTION_ARGS);
Datum force_3d(PG_FUNCTION_ARGS);
+Datum force_collection(PG_FUNCTION_ARGS);
Datum combine_bbox(PG_FUNCTION_ARGS);
CREATE FUNCTION force_3d(GEOMETRY) RETURNS GEOMETRY
AS '@MODULE_FILENAME@' LANGUAGE 'c' with (isstrict);
+-------- cause geometry to be represented as a geometry collection
+
+CREATE FUNCTION force_collection(GEOMETRY) RETURNS GEOMETRY
+ AS '@MODULE_FILENAME@' LANGUAGE 'c' with (isstrict);
-------- GiST support functions
}
+//force the geometry to be a geometrycollection type
+PG_FUNCTION_INFO_V1(force_collection);
+Datum force_collection(PG_FUNCTION_ARGS)
+{
+ GEOMETRY *geom = (GEOMETRY *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
+ geom->type = COLLECTIONTYPE;
+ PG_RETURN_POINTER(geom);
+}