[postgis-users] Unexpected behaviour in ST_Buffer

satoshi satoshich at gmail.com
Tue Mar 7 23:26:35 PST 2023


Hello, there is a behaviour that I didn't expect with ST_Buffer.

Using ST_Buffer on any LINESTRING with a start point the same as the end
point, for on example this circle:
SELECT ST_Buffer('SRID=4326;LINESTRING(
  15.209907 48.3882267,
  15.2098971 48.3882238,
  15.2098892 48.3882189,
  15.2098842 48.3882126,
  15.2098826 48.3882055,
  15.2098846 48.3881985,
  15.20989 48.3881923,
  15.2098982 48.3881877,
  15.2099082 48.3881851,
  15.209919 48.3881848,
  15.2099288 48.3881868,
  15.2099372 48.3881907,
  15.2099433 48.3881962,
  15.2099465 48.3882026,
  15.2099465 48.3882095,
  15.2099432 48.3882159,
  15.209937 48.3882214,
  15.2099281 48.3882254,
  15.2099177 48.3882272,
  15.209907 48.3882267
)'::geography, 7.0);


In Postgis version 2.5, the result was an area encircling the input circle,
with a radius 7 meters bigger than the input. This is what I would expect.

However, in Postgis version 3.3, the result is a ring that appears to be 7
meters wide and does not include the input polygon. I think this behaviour
only happens when the radius passed to ST_Buffer is bigger than the radius
of the input LINESTRING.

Considering what the docs say: "ST_Buffer: Computes a POLYGON or
MULTIPOLYGON that represents all points whose distance from a
geometry/geography is less than or equal to a given distance." This to me
appears to be a bug. For example, the point that is exactly in the center
of the circle should be included as it is within 7 meters, instead it is
not included in the output in Postgis version 3.3.

Could somebody comment on this and let me know why this would happen (if
not a bug)?

Thank you,
Dario
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20230308/06699d70/attachment.htm>


More information about the postgis-users mailing list