Mike, I think what you may want is SELECT gid, field1, field2, ST_Collect(the_centroid) As multicentroid FROM (SELECT gid, field1,field2, ST_Centroid((ST_Dump(the_geom)).geom) As the_centroid FROM sometable ) As foo GROUP BY gid, field1, field2
Hope that helps, Regina -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Toews Sent: Friday, December 05, 2008 4:55 PM To: [email protected] Subject: [postgis-users] Multi centroids Hi, Is there a simple way to extract the multiple centroids as MULTIPOINT geometries from MULTI* objects (i.e., ST_MULTICENTROID(geometry) )? The ST_CENTROID function only returns POINT geometries. (An example application of this is to initially place CAD labels for MULTIPOLYGON features, since it appears that AutoCAD is not smart enough to place these properly, and need manual adjustment to avoid label conflicts. I have always been baffled by the purpose of multipoints until now.) I'm guessing this isn't a built-in function and the solution will be a custom SQL or PL/pgSQL function. Thanks for any help/ideas. -Mike _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
