[postgis-devel] ST_PointOnSurface calculation

Martin Davis mtnclimb at gmail.com
Mon Feb 1 22:29:50 PST 2021


Yes, ST_PointOnSurface computes a point which is guaranteed to lie within a
polygon.  This is not the case for the centroid, which may lie outside a
polygon (e.g the centroid of a C-shaped polygon lies outside the polygon).

The description of the algorithm in the GIS-SE question is essentially
correct.

And yes, improving the documentation page would be good, as well as
providing some example diagrams.

On Mon, Feb 1, 2021 at 10:15 PM Paolo Cavallini <cavallini at faunalia.it>
wrote:

> Hi all,
> the description of the function is scanty. I always assumed it
> calculated the point within a polygon closest to the centorid, but I
> read it may not be so:
>
> https://gis.stackexchange.com/questions/76498/how-is-st-pointonsurface-calculated
> Is this confirmed?
> In case, I suggest describing it in the manpage.
> Thanks for any clarification.
> Cheers.
> --
> Paolo Cavallini
> www.faunalia.eu - QGIS.org
> training, support, development on QGIS, PostGIS and more
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20210201/9963463a/attachment.html>


More information about the postgis-devel mailing list