postgresql - PostGIS: How to Create a Geometry Collection from a set of Pointz? - Geographic Information Systems Stack Exchange


i have large number of 3d points stored postgis pointz type. i'd create geometry collection these points, i'm struggling directly in sql. i've tried following, puts 1 point geometry collection:

update public.geometry_collection set geometry_collection_data =      st_forcecollection(         (select object.geometric_point -- pointz type         object,point,geometry_collection         object.pk in             (             select object_pk              point             point.geometry_collection_pk = geometry_collection.geometry_collection_pk     ))  ); 

is possible select pointz , insert selection geometry collection column?

i think want this,

update public.geometry_collection set geometry_collection_data = (   select st_collect(object.geometric_point)   object   inner join point     on point.geometry_collection_pk = geometry_collection.geometry_collection_pk   cross join geometry_collection ); 

that gets things multipoint z, if want geometrycollection z wrap again in st_forcecollection, this..

select st_astext(st_forcecollection(st_collect(pt))) ( values   (st_makepoint(0,0,0)),   (st_makepoint(0,0,0)) ) t(pt);                         st_astext                         --------------------------------------------------------  geometrycollection z (point z (0 0 0),point z (0 0 0)) (1 row) 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -