I have a large number of 3D points that are stored as the postGIS Pointz type. I'd also like to create a geometry collection from these points, but I'm struggling to do it directly in SQL. I've tried the following, but this only puts one point into the geometry collection:
UPDATE public.geometry_collection
SET geometry_collection_data =
ST_ForceCollection(
(SELECT ALL object.geometric_point -- this is the pointz type
FROM object,point,geometry_collection
WHERE object.pk IN
(
SELECT object_pk
FROM point
WHERE point.geometry_collection_pk = geometry_collection.geometry_collection_pk
))
);
Is it possible to select pointz and insert the selection into a geometry collection column?