[postgis] new Functions/ Function changes(Calculating centroids)

Dave Blasby dblasby at refractions.net
Fri Aug 3 09:34:36 PDT 2001


>  Do you consider concave polygons for calculating centroids? For some
> of them, centroids by "average location " maybe exist outside of
>  polygons.
> 
>  For multipolygons, "average all the points on all the outer rings"
> doesn't seem to always exist within multipolygons. If not, in some
> cases, centroids will exist within smaller ones of multipolygons. I
> don't think smaller polygon's centroid is representative  of
> multipolygon without any other info or knowledge, for example,
> Vancouver Island, which has Province capital, Victoria, in BC
> province .
> 
>  I think larger polygon should has a centroid within a multipolygon.
> 
>    How do you think?


Section 2.1.9.1 says "
Centroid( ):Point—The mathematical centroid for this Surface as a Point.
The result is not guaranteed to be on this Surface.
"

It also defines another function (Which I havent implemented yet),
"PointOnSurface( ):Point—A point guaranteed to be on this Surface."

And for the mulipolygon (2.1.11.1) cases;

Centroid( ):Point—The mathematical centroid for this MultiSurface. The
result is not guaranteed to be on this MultiSurface.

PointOnSurface( ):Point—A Point guaranteed to be on this MultiSurface.

Note that PointOnSurface(Multipolygon) can be obtained by finding the
PointOnSurface(Polygon) on the first polygon in the multipolygon.  


There are a few popular ways of finding a "centroid".  One is the
take-the-bounding-box-and-find-the-middle-of-it.  Another is to find the
averge-point location (which is what I do).  The third is to trianglate
the polygon, and take the weighted-average of the centres of all the
triangles.  None of them will always produce a point on the polygon. 
For example;


********************
 *                 *
   *               *
     *             *
       *           *
         *         *
           *       *
             *     *
               *   *
                *  *
               *   *
             *     *
           *       *
         *         *
       *           *
     *             *
   *               *
 *******************

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Small business owners...
Tell us what you think!
http://us.click.yahoo.com/vO1FAB/txzCAA/ySSFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list