Opened 5 years ago

Closed 5 years ago

Last modified 5 months ago

#990 closed defect (fixed)

Postgis topology tests are broken with GEOS master

Reported by: Algunenano Owned by: dbaston
Priority: major Milestone: 3.8.0
Component: Core Version: main
Severity: Significant Keywords:
Cc:

Description

Please see https://trac.osgeo.org/postgis/ticket/4514

A bisection indicates that https://github.com/libgeos/geos/commit/86d19e41441df9c2ee9683dbca3140541a3456d6 broke something in Postgis' topology tests but I haven't had time to investigate further.

Change History (5)

comment:1 by pramsey, 5 years ago

A PR to back out the broken part of that commit is here, hopefully we can figure out what's wrong first. Topology might have an error in it. The commit is a performance improvement, so if we can keep it that would be nice.

https://github.com/libgeos/geos/pull/233

comment:2 by pramsey, 5 years ago

The topology code runs a difference between two inputs and expects them to difference to EMPTY. In the test we are failing, we are returning NON-EMPTY results from the two inputs. Here are the two inputs:

A: LINESTRING(0 0,0 10,10 10,10 0,0 0)
B: GEOMETRYCOLLECTION Z (GEOMETRYCOLLECTION Z (MULTILINESTRING Z ((0 0 10,10 0 20),(10 0 20,10 10 30)),LINESTRING Z (0 10 20,10 10 30)),LINESTRING Z (0 0 10,0 10 20))

Here's the result of ST_Difference(A, B)

SELECT ST_AsText(ST_Difference(
  'LINESTRING(0 0,0 10,10 10,10 0,0 0)'::geometry, 
  'GEOMETRYCOLLECTION Z (GEOMETRYCOLLECTION Z (MULTILINESTRING Z ((0 0 10,10 0 20),(10 0 20,10 10 30)),LINESTRING Z (0 10 20,10 10 30)),LINESTRING Z (0 0 10,0 10 20))'::geometry
));

MULTILINESTRING Z ((0 0 10,0 10 20),(0 10 30,10 10 30),(10 0 20,0 0 20))

What? Now check this out... taking the 3D second input and forcing to 2D:

SELECT ST_AsText(ST_Difference(
  'LINESTRING(0 0,0 10,10 10,10 0,0 0)'::geometry, 
  ST_Force2D('GEOMETRYCOLLECTION Z (GEOMETRYCOLLECTION Z (MULTILINESTRING Z ((0 0 10,10 0 20),(10 0 20,10 10 30)),LINESTRING Z (0 10 20,10 10 30)),LINESTRING Z (0 0 10,0 10 20))'::geometry)
));

LINESTRING EMPTY

So, something in the new code has changed behaviour in the presence of 3D coordinates.

comment:3 by dbaston, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed by 9924c15fc0611e2e49d5665b1/git, forgot to reference in commit message.

comment:4 by Regina Obe <lr@…>, 5 months ago

In 47e56ee/git:

Add missing headers. Closes #990 for GEOS 3.9.5

comment:5 by Regina Obe <lr@…>, 5 months ago

In 23e07a5/git:

More missing cstdint headers
Closes #990, References #743

Note: See TracTickets for help on using tickets.