Opened 3 years ago

Last modified 3 years ago

#1081 reopened defect

TopologyPreservingSimplifier / GEOSTopologyPreserveSimplify on Windows

Reported by: Mike Taves Owned by: geos-devel@…
Priority: major Milestone: 3.11.0
Component: Unit Tests Version: main
Severity: Unassigned Keywords:
Cc:

Description

As discussed on mail list: https://lists.osgeo.org/pipermail/geos-devel/2020-November/009856.html

With GEOS 3.9.0beta1 for Windows, both C++ and C API versions of TopologyPreservingSimplifier and GEOSTopologyPreserveSimplify, respectively, provide sometimes random incorrect results.

In the test suite, this can be run using the command:

test_geos_unit "geos::simplify::TopologyPreservingSimplifier"

which will fail most of the time for test 14, but not always. Similar behavior can be found using a simple C or C++ program that uses geos.dll and geos_c.dll.

With Shapely:

from shapely import wkt, geos

print(geos.geos_version_string)
g = wkt.loads('MULTILINESTRING((0 0, 50 0, 70 0, 80 0, 100 0), (0 0, 50 1, 60 1, 100 0))')
simplified = g.simplify(10.0, preserve_topology=True)
print(simplified.wkt)

Using a stable GEOS build, this is the expected result:

3.8.0-CAPI-1.13.1
MULTILINESTRING ((0 0, 100 0), (0 0, 50 1, 100 0))

while using geos_c.dll/geos.dll built from 3.9.0beta1 only shows the incorrect result:

3.9.0-CAPI-1.14.0
MULTILINESTRING ((0 0, 100 0), (0 0, 100 0))

A PostGIS equivalent is be:

SELECT ST_AsText(ST_SimplifyPreserveTopology(
    'MULTILINESTRING((0 0, 50 0, 70 0, 80 0, 100 0), (0 0, 50 1, 60 1, 100 0))', 10.0));

which returns mostly the incorrect result, but sometimes the correct result. Fun!


This appears to be a Windows-only issue, which may have been introduced between 4 to 6 months ago. It is difficult to pin-down an exact commit from the AppVeyor build history, as it was obscured by an unrelated preceding error in the CI workflow.

Change History (9)

comment:1 by robe, 3 years ago

FWIW My Mingw-w64 build Windows seems fine. So not all windows, assume just VC++ compiled and possibly specific versions.

POSTGIS="3.1.0alpha3 3.1.0alpha2-164-gd2d5c9f98" [EXTENSION] PGSQL="130" GEOS="3.9.0-CAPI-1.14.0" PROJ="7.1.1" LIBXML="2.9.9" LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.5.0 (Internal)"

Using GEOS as of yesterday branch (also tested with one from a month ago).

 SELECT ST_AsText(ST_SimplifyPreserveTopology(
     'MULTILINESTRING((0 0, 50 0, 70 0, 80 0, 100 0), (0 0, 50 1, 60 1, 100  0))', 10.0));  
	 

yields consistently

MULTILINESTRING((0 0,100 0),(0 0,50 1,100 0))

comment:2 by pramsey, 3 years ago

Milestone: 3.9.03.10.0

comment:3 by Mike Taves, 3 years ago

Agree to push milestone to later, but I suggest to skip this test for MSVC for now to get green lights for a few CI builds.

comment:4 by Mike Taves, 3 years ago

See https://git.osgeo.org/gitea/geos/geos/pulls/113 to disable a small component only for MSVC. This is intended to be a temporary measure until this issue is properly resolved.

comment:5 by mdavis, 3 years ago

Last edited 3 years ago by mdavis (previous) (diff)

comment:6 by mdavis, 3 years ago

Resolution: fixed
Status: newclosed

comment:7 by mdavis, 3 years ago

Resolution: fixed
Status: closedreopened

comment:8 by robe, 3 years ago

Milestone: 3.10.03.11.0

Retargeting in prep for GEOS 3.10.0 release

comment:9 by robe, 3 years ago

Priority: blockermajor
Note: See TracTickets for help on using tickets.