[postgis-users] Centroid 'Within'

Doug_Newcomb at fws.gov Doug_Newcomb at fws.gov
Wed Jun 22 12:48:09 PDT 2011


Sheara,
        That would depend on the shape of the polygon.  A polygon in the 
shape of a "C" would have a centroid point  inside the curve of the "C", 
but not inside the polygon.  Perhaps you want to find the centroid first 
and then find the closest point on the polygon boundary to that point ( 
after testing whether the point is within the polygon)?


Doug


Doug Newcomb 
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb at fws.gov
---------------------------------------------------------------------------------------------------------
The opinions I express are my own and are not representative of the 
official policy of the U.S.Fish and Wildlife Service or Dept. of the 
Interior.   Life is too short for undocumented, proprietary data formats.



"Sheara Cohen" <Sheara at calthorpe.com> 
Sent by: postgis-users-bounces at postgis.refractions.net
06/22/2011 03:18 PM
Please respond to
PostGIS Users Discussion <postgis-users at postgis.refractions.net>


To
<postgis-users at postgis.refractions.net>
cc

Subject
[postgis-users] Centroid 'Within'






Hi All – I’m wondering if anyone has figured out a solution to converting 
a polygon file to a centroid point file that produces centroids within the 
polygons. Obviously, ST_Centroid doesn’t produce centroids within the 
polygon. And ST_PointOnSurface produces a point within that is only sort 
of centroid-ish…
 
Any ideas would be great. Thank you!
 
~ Sheara
 
Sheara Cohen
Planner
C A L T H O R P E  A S S O C I A T E S
2095 ROSE STREET, SUITE 201, BERKELEY, CALIFORNIA, 94709 USA

 _______________________________________________
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/20110622/9643110b/attachment.html>


More information about the postgis-users mailing list