<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=789123814-04052009><FONT face=Arial color=#0000ff size=2>Ah 
yes, a classic case of RTFM. </FONT></SPAN></DIV>
<DIV><SPAN class=789123814-04052009><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789123814-04052009><FONT face=Arial color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=789123814-04052009><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=789123814-04052009><FONT face=Arial color=#0000ff size=2>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 
)</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
  face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> 
  postgis-users-bounces@postgis.refractions.net 
  [mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of 
  </B>Paragon Corporation<BR><B>Sent:</B> Friday, May 01, 2009 3:22 
  PM<BR><B>To:</B> 'PostGIS Users Discussion'<BR><B>Subject:</B> RE: 
  [postgis-users] st_centroid Points not on Polygon<BR><BR></FONT></DIV>
  <DIV dir=ltr align=left><SPAN class=156482122-01052009><FONT face=Arial 
  color=#0000ff size=2>Stan,</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=156482122-01052009><FONT face=Arial 
  color=#0000ff size=2>ah and here is proof.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=156482122-01052009><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN class=156482122-01052009><FONT face=Arial 
  color=#0000ff size=2><A 
  href="http://postgis.refractions.net/documentation/manual-svn/ST_Centroid.html">http://postgis.refractions.net/documentation/manual-svn/ST_Centroid.html</A></FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=156482122-01052009><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN> </DIV>
  <DIV dir=ltr align=left><SPAN class=156482122-01052009><FONT face=Arial 
  color=#0000ff size=2>Leo</FONT></SPAN></DIV><BR>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> 
  postgis-users-bounces@postgis.refractions.net 
  [mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of 
  </B>Sufficool, Stanley<BR><B>Sent:</B> Friday, May 01, 2009 4:53 
  PM<BR><B>To:</B> PostGIS Users Discussion<BR><B>Subject:</B> [postgis-users] 
  st_centroid Points not on Polygon<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV><SPAN class=331285020-01052009><FONT face=Arial size=2>I'm sure I ran 
  across this in the forums a year ago, but:</FONT></SPAN></DIV>
  <DIV><SPAN class=331285020-01052009><FONT face=Arial 
  size=2></FONT></SPAN> </DIV>
  <DIV><SPAN class=331285020-01052009><FONT face=Arial size=2>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>));</FONT></SPAN></DIV>
  <DIV><SPAN class=331285020-01052009></SPAN><SPAN 
  class=331285020-01052009><FONT face=Arial size=2></FONT></SPAN> </DIV>
  <DIV><SPAN class=331285020-01052009><FONT face=Arial size=2>Thanks in 
  advance.</FONT></SPAN></DIV></BLOCKQUOTE></BODY></HTML>