[postgis-users] centroid calculation

David William Bitner david.bitner at gmail.com
Wed Jan 9 14:05:14 PST 2008


ST_pointonsurface() will return a point that is guaranteed to be on the
polygon.  I believe that this point is the point that is at a maximum
distance from any edge.  This may be more useful for your case than a
centroid.   There is no such thing as a logically correct "centroid", there
is only what a centroid *is* and what it is may not be on the surface of a
polygon.

On Jan 9, 2008 3:45 PM, Dylan Beaudette <dylan.beaudette at gmail.com> wrote:

> Hi,
>
> I have noticed that the ST_centroid() function will compute
> _geometrically_
> correct centroids, but will not always compute _logically_ correct
> centroids.
>
> For example, given two polygons defining hillslope position such that one
> polygon defines the "ridge" and another defines the "slope". These two
> polygons are roughly concentric and therefore the geometric centroid of
> the
> outermost polygon is computed to exist somewhere in the innermost polygon.
>
> Are there any known ways to make postgis return a logically correct
> centroid:
> i.e. in the presence of concentric polygons force the position the
> centroid
> to be within the correct polygon.
>
> Thanks!
>
> Dylan
>
> --
> Dylan Beaudette
> Soil Resource Laboratory
> http://casoilresource.lawr.ucdavis.edu/
> University of California at Davis
> 530.754.7341
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
************************************
David William Bitner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080109/37c67604/attachment.html>


More information about the postgis-users mailing list