[postgis-users] Multi centroids
Paragon Corporation
lr at pcorp.us
Fri Dec 5 14:14:31 PST 2008
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: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Mike
Toews
Sent: Friday, December 05, 2008 4:55 PM
To: postgis-users at postgis.refractions.net
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
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list