[postgis-tickets] [SCM] PostGIS branch main updated. 3.2.0alpha1-48-g0394036

git at osgeo.org git at osgeo.org
Mon Oct 4 15:02:01 PDT 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, main has been updated
       via  0394036cae3713c3be970e06df4b725d4ba9c24b (commit)
      from  5a4a2a64f807addd641708ce54a6a38a85fa0c0d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0394036cae3713c3be970e06df4b725d4ba9c24b
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Oct 5 00:01:38 2021 +0200

    Have ST_DWithin with EMPTY operand always return false
    
    References #5008

diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index f6ef9ad..45265ce 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -743,6 +743,11 @@ Datum LWGEOM_dwithin(PG_FUNCTION_ARGS)
 
 	gserialized_error_if_srid_mismatch(geom1, geom2, __func__);
 
+	if (lwgeom_is_empty(lwgeom1) || lwgeom_is_empty(lwgeom2))
+	{
+		PG_RETURN_BOOL(false);
+	}
+
 	mindist = lwgeom_mindistance2d_tolerance(lwgeom1, lwgeom2, tolerance);
 
 	PG_FREE_IF_COPY(geom1, 0);
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index 72c597b..12a5d11 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1427,3 +1427,8 @@ FROM
     ) data;
 
 
+-- https://trac.osgeo.org/postgis/ticket/5008
+SELECT
+	'#5008',
+	ST_DWithin('POINT EMPTY', 'POINT(0 0)', 'Inf'),
+	ST_DWithin('POINT(1 1)', 'POLYGON EMPTY', 'Inf');
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index 2a3cb68..8af08eb 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -459,3 +459,4 @@ ERROR:  LWGEOM_addpoint: Invalid offset
 #4770.c|POINT(0 0)|300
 #4770.c|MULTIPOINT(0 0,1 1)|602
 #4799|{"type": "Feature", "geometry": {"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:25832"}},"coordinates":[359667,5651729]}, "properties": {"id": 1, "geom1": {"type":"Point","crs":{"type":"name","properties":{"name":"EPSG:3035"}},"coordinates":[4110471,3103061]}}}
+#5008|f|f

-----------------------------------------------------------------------

Summary of changes:
 postgis/lwgeom_functions_basic.c | 5 +++++
 regress/core/tickets.sql         | 5 +++++
 regress/core/tickets_expected    | 1 +
 3 files changed, 11 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list