#5647 closed defect (fixed)

Commit e85cd10 introduce a logic bug of ST_Covers

Reported by: Wenjing Owned by: pramsey
Priority: medium Milestone: PostGIS 3.4.2
Component: postgis Version: 3.4.x
Keywords: Cc:

Description

Consider the following statement:

SELECT ST_Covers(a1, a2) FROM ST_GeomFromText('MULTIPOLYGON(((1 0,0 1,-1 0,0 -1, 1 0)))') As a1, ST_GeomFromText('MULTIPOINT(EMPTY,(0 0)) ') As a2;
-- actual{f}, expected{t}

The result should be true, according to https://github.com/libgeos/geos/issues/988. It seems to be a regression bug.

git bisect helps find the introducing commit: e85cd10.

Using commit 66be3a6 to install PostGIS, the correct result can be obtained:

psql:script/simplify.sql:1: NOTICE:  lwgeom_api.c [352] called with n=0 and npoints=0
 st_covers 
-----------
 t
(1 row)

While when git checkout e85cd10, and install PostGIS, the incorrect result:

 st_covers 
-----------
 f
(1 row)

The version is the latest successful CI/CD build version.

 POSTGIS="3.5.0dev 3.4.0rc1-839-g61bc019eb" [EXTENSION] PGSQL="170" GEOS="3.13.0dev-CAPI-1.18.0" PROJ="8.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" LIBXML="2.9.13" (core procs from "3.5.0dev 3.4.0rc1-750-g89fb96385" need upgrade)

Change History (5)

comment:1 by robe, 11 months ago

pramsey, I guess this one is yours. Regression because of #5627.

comment:2 by Paul Ramsey <pramsey@…>, 10 months ago

In 43117da/git:

Handle empty components of MULTIPOINT in native point-in-polygon routines, references #5647

comment:3 by Paul Ramsey <pramsey@…>, 10 months ago

In 6f63337/git:

Fix behaviour in ST_Covers, references #5647;

comment:4 by Paul Ramsey <pramsey@…>, 10 months ago

In e64ae3b/git:

Fix ST_Covers mixed p-i-p case, references #5647

comment:5 by pramsey, 10 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.