[postgis-devel] When did ST_BuildArea change

Sandro Santilli strk at kbt.io
Mon Oct 5 13:10:05 PDT 2020


Big problem. ST_Polygonize also affected:

strk=# select ST_AsTExt(ST_Polygonize('GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0)),POLYGON((4 -2,6 -2,6 12,4 12,4 -2)))'::geometry));
                                         st_astext
--------------------------------------------------------------------------------------------
 GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0)),POLYGON((4 -2,4
12,6 12,6 -2,4 -2)))
(1 row)

strk=# select ST_AsTExt(ST_BuildArea('GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0)),POLYGON((4 -2,6 -2,6 12,4 12,4 -2)))'));
                                st_astext
--------------------------------------------------------------------------
 POLYGON((0 0,0 10,4 10,4 12,6 12,6 10,10 10,10 0,6 0,6 -2,4 -2,4 0,0
0))
(1 row)

On Mon, Oct 05, 2020 at 03:21:16PM -0400, Regina Obe wrote:
> I noticed this before but came across it again.
> 
>  
> 
> http://postgis.net/docs/manual-dev/ST_BuildArea.html
> 
>  
> 
> At the time I created this page which I am guessing was like circa 2008
> 
>  
> 
> This query created a gaping hole.  Now it doesn't so the docs are wrong
> 
>  
> 
> SELECT ST_BuildArea(ST_Collect(line,circle))
> 
> FROM (SELECT
> 
>     ST_Buffer(
> 
>         ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)),
> 
>                 5)  As line,
> 
>     ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;
> 
>  
> 
> --this creates the same gaping hole
> 
> --but using linestrings instead of polygons
> 
> SELECT ST_BuildArea(
> 
>     ST_Collect(ST_ExteriorRing(line),ST_ExteriorRing(circle))
> 
>     )
> 
> FROM (SELECT ST_Buffer(
> 
>     ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190))
> 
>         ,5)  As line,
> 
>     ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;
> 
>  
> 
> Docs say this:
> 
>  
> 
> 
> 
>  
> 
> But when I run in pgAdmin4 I get this:
> 
>  
> 
>  
> 
> 
> 
>  
> 
> Does anyone know when this behavior changed and why?  I'm assuming it is a
> GEOS change, so cc'ing GEOS dev as well.
> 
>  
> 
> More depressing is my signature symmetric podded Bee Hive on this page
> (circa 2010(
> 
>  
> 
> http://postgis.net/docs/manual-dev/ST_LongestLine.html
> 
>  
> 
> Which looked like this (minus the longest line of course) - beautiful isn't
> it?
> 
>  
> 
>  
> 
> 
> 
>  
> 
> Now looks like a shadow of its former self
> 
>  
> 
> 
> 
>  
> 
>  
> 
>  
> 
>  
> 
> Thanks,
> 
> Regina
> 






> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list