[postgis-users] Point inside a polygon
Steve.Toutant at inspq.qc.ca
Steve.Toutant at inspq.qc.ca
Mon May 5 08:10:09 PDT 2014
Having a centroid outside a polygon is a common situation, even with valid
geometries.
Depending of use case, I use ST_PointOnSurface when
ST_Within(St_Centroid(surface), surface) returns false
steve
Rémi Cura <remi.cura at gmail.com>@lists.osgeo.org
Envoyé par : postgis-users-bounces at lists.osgeo.org
2014-05-05 07:09
Veuillez répondre à
PostGIS Users Discussion <postgis-users at lists.osgeo.org>
A
PostGIS Users Discussion <postgis-users at lists.osgeo.org>
cc
Objet
Re: [postgis-users] Point inside a polygon
Hmm your problem is not about a function, is about using invalid
geometries !
Why simply don't fix your geometry?
you must do it anyway if you want to use PostGIS
without strange bugs.
Use http://postgis.refractions.net/docs/ST_MakeValid.html
Cheers,
Rémi-C
2014-05-03 15:51 GMT+02:00 Larry Reeder <lnreeder at gmail.com>:
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.
-Larry
On Fri, May 2, 2014 at 1:38 PM, Åsmund Tokheim <asmundto at gmail.com> wrote:
Hi
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.
Åsmund
On Fri, May 2, 2014 at 12:45 PM, Nicolas Ribot <nicolas.ribot at gmail.com>
wrote:
Hi,
Use st_pointOnSurface (
http://postgis.net/docs/manual-2.1/ST_PointOnSurface.html)
Nicolas
On 2 May 2014 06:32, J.Alejandro Martinez Linares <islanis at infomed.sld.cu>
wrote:
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?
cheers.
--
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
Infomed: http://www.sld.cu/
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140505/44e5a3d5/attachment.html>
More information about the postgis-users
mailing list