[postgis-users] st_centroid Points not on Polygon

Sufficool, Stanley ssufficool at rov.sbcounty.gov
Mon May 4 07:41:14 PDT 2009


Ah yes, a classic case of RTFM. 
 
Is this acceptable behavior for this function? Could PostGIS deal with
this internally to do a post process st_pointonsurface when the centroid
is not within the polygon.
 
For now I guess I will just write a wrapper function for ( CASE WHEN
st_within(st_centroid(), poly) then st_centroid() else
st_pointonsurface() END )

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Paragon Corporation
Sent: Friday, May 01, 2009 3:22 PM
To: 'PostGIS Users Discussion'
Subject: RE: [postgis-users] st_centroid Points not on Polygon


Stan,
ah and here is proof.
 
http://postgis.refractions.net/documentation/manual-svn/ST_Centroid.html
 
Leo

  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Sufficool, Stanley
Sent: Friday, May 01, 2009 4:53 PM
To: PostGIS Users Discussion
Subject: [postgis-users] st_centroid Points not on Polygon


I'm sure I ran across this in the forums a year ago, but:
 
Is the st_centroid function guaranteed to return a point that lies on
the polygon? I have instances when my display doe not place it on the
polygon when using st_centroid(st_intersection(the_geom, <WKT BBOX>));
 
Thanks in advance.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090504/60f4c1d5/attachment.html>


More information about the postgis-users mailing list