<div dir="ltr">Another thing to be aware of with ST_PointOnSurface is it can return a point that's on the boundary of polygon, but *not inside* the polygon, so that ST_Within(St_PointOnSurface(surface), surface) returns false.  That's bitten me before, but may be OK for your purposes.<div>
<br></div><div>       -Larry<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 2, 2014 at 1:38 PM, Åsmund Tokheim <span dir="ltr"><<a href="mailto:asmundto@gmail.com" target="_blank">asmundto@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>You can use st_closestpoint(geom, st_centroid(geom)) to make sure that the returned point is in most circumstances at or near the centroid, and always at least on the boundary of the polygon. While st_pointonsurface certainly will be faster, it will often choose a more random point on the surface.</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Åsmund</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 2, 2014 at 12:45 PM, Nicolas Ribot <span dir="ltr"><<a href="mailto:nicolas.ribot@gmail.com" target="_blank">nicolas.ribot@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Use st_pointOnSurface (<a href="http://postgis.net/docs/manual-2.1/ST_PointOnSurface.html" target="_blank">http://postgis.net/docs/manual-2.1/ST_PointOnSurface.html</a>)</div>

<span><font color="#888888"><div><br></div><div>Nicolas</div>

</font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On 2 May 2014 06:32, J.Alejandro Martinez Linares <span dir="ltr"><<a href="mailto:islanis@infomed.sld.cu" target="_blank">islanis@infomed.sld.cu</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi people, i need your help, i was using st_centroid to get a point that be inside a polygon butr st_centroid got a property  that is a problem to me, it returns a point that not always is inside the polygon, cause when the polygon has an irregular form, the point that st_centroid is outside the polygon, and i need a function that do a similar thing that st_centroid but i need that the point it returns always be inside the polygon, is there a function that do that?<br>




<br>
cheers.<br>
<br>
--<br>
<br>
Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas<br>




<br>
Infomed: <a href="http://www.sld.cu/" target="_blank">http://www.sld.cu/</a><br>
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-<u></u>bin/mailman/listinfo/postgis-<u></u>users</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>