It occurs to me that, depending on what you want, you might try averaging the points to get a median, since you don't have a shape, and thus no concept of area to produce a centroid.<br><br>i.e. add them all up and divide by the number of points.<br>
<br><div class="gmail_quote">On Mon, Sep 14, 2009 at 3:28 PM, Paul Ramsey <span dir="ltr"><<a href="mailto:pramsey@cleverelephant.ca">pramsey@cleverelephant.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Faster than creating a multipoint is to recognize that ST_Centroid()<br>
is just going to return the center of the bbox of the collection<br>
anyways, so you can replace it with.<br>
<br>
SELECT ST_Centroid(ST_Extent(point_geom)) FROM pb_statistics WHERE pg_debit =1;<br>
<br>
If you want to do it the hard way, then:<br>
<br>
SELECT ST_Centroid(ST_Collect(point_geom)) FROM pb_statistics WHERE pg_debit =1;<br>
<font color="#888888"><br>
P.<br>
</font><div><div></div><div class="h5"><br>
On Mon, Sep 14, 2009 at 12:24 PM, Dustin Butler <<a href="mailto:dustin@intrcomm.net">dustin@intrcomm.net</a>> wrote:<br>
> Hello,<br>
><br>
> Trying to figure out how to find center using a collection of points.  For<br>
> example something like this which doesn't work but you get the idea.<br>
><br>
> SELECT ST_AsText(ST_Centriod(SELECT point_geom FROM pb.pb_statistics WHERE<br>
> pb_debit=1));<br>
><br>
> I think I need to make a multipoint geom out of the points and pass that but<br>
> haven't figure out yet.<br>
><br>
> Thanks,<br>
> Dustin Butler<br>
> Intrcomm Technology<br>
><br>
> Skype: dustinbutler<br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Cheers!<br>Rick<br><br>