Re[postgis-users] place multiple polygons with one centroid

nicklas.aven at jordogskog.no nicklas.aven at jordogskog.no
Fri May 15 04:56:54 PDT 2009


Yes
 
That should be no problem. I tried with st_collect and it seems to return the centroid as expected. St_collect will be much faster than unioning all the polygons in groups.
 
But there is no guarantee that your point will be on any of your polygons depending on how they are placed in relation to eachother.
 
this should work
 

select st_centroid(st_collect(the_geom)) as the_geom from theTable group by plantation_name
 
/Nicklas


2009-05-15 benton101 wrote:


>Hi,
>
>I have a table that contains some 40000 records, these records represent
>plantation boundaries. Is it possible to replace multiple polygons grouped
>by plantation name for instance with one point. So say I have 40000 polygons
>and these represent 500 plantations, I would like the results to have 500
>records.
>
>Ben
>-- 
>View this message in context: http://www.nabble.com/Replace-multiple-polygons-with-one-centroid-tp23558002p23558002.html
>Sent from the PostGIS - User mailing list archive at Nabble.com.
>
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090515/c0aecf62/attachment.html>


More information about the postgis-users mailing list