[postgis-devel] Strange behavior with empty geometries GROUP BY

Regina Obe lr at pcorp.us
Wed Sep 13 09:13:12 PDT 2017


Pierre,

FYI this behavior recently  changed in PostGIS 2.4.0 as a result of Paul's
fixings.

Regarding this thread -
https://lists.osgeo.org/pipermail/postgis-devel/2017-September/026425.html


So now:

  WITH polys AS (
  SELECT 1 id, ST_GeomFromText('MULTIPOLYGON(((251000 5243597.61702128,
                                               251038 5243558,
                                               251056 5243527,
                                               251057.227272727 5243500,
                                               251000 5243500,
                                               251000 5243597.61702128)),
                                             ((251021 5243690,
                                               251000 5243681.87096774,
                                               251000 5243750,
                                               251250 5243750,
                                               251250 5243749.86206897,
                                               251196 5243694,
                                               251168 5243687,
                                               251021 5243690)))') geom
  UNION ALL
  SELECT 2 id, ST_GeomFromText('POLYGON((251000 5243681.87096774,
                                         251021 5243690,
                                         251168 5243687,
                                         251196 5243694,
                                         251250 5243749.86206897,
                                         251250 5243598.15,
                                         251167.008064516 5243500,
                                         251057.227272727 5243500,
                                         251056 5243527,
                                         251038 5243558,
                                         251000 5243597.61702128,
                                         251000 5243681.87096774))') geom
) SELECT ST_AsText(geom)
  FROM polys
  GROUP BY geom;

Testing on: POSTGIS="2.4.0dev r15701" PGSQL="100" GEOS="3.6.2-CAPI-1.10.2
4d2925d" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.2.1, released
2017/06/23" LIBXML="2.7.8" LIBJSON="0.12" RASTER



 
st_astext
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
---------------------------------------------------
 POLYGON((251000 5243681.87096774,251021 5243690,251168 5243687,251196
5243694,251250 5243749.86206897,251250 5243598.15,251167.008064516
5243500,251057.227272727 5243500,251056 5243527,251038 5243558,251000
5243597.61702128,251000 5243681.87096774))
 MULTIPOLYGON(((251000 5243597.61702128,251038 5243558,251056
5243527,251057.227272727 5243500,251000 5243500,251000
5243597.61702128)),((251021 5243690,251000 5243681.87096774,251000
5243750,251250 5243750,251250 5243749.86206897,251196 5243694,251168
5243687,251021 5243690)))
(2 rows)






More information about the postgis-devel mailing list