Opened 3 years ago
Last modified 3 years ago
#1081 reopened defect
TopologyPreservingSimplifier / GEOSTopologyPreserveSimplify on Windows
Reported by: | Mike Taves | Owned by: | |
---|---|---|---|
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 , 3 years ago
comment:2 by , 3 years ago
Milestone: | 3.9.0 → 3.10.0 |
---|
comment:3 by , 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 , 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 , 3 years ago
Fixed by efe09d6/git
See also #732
comment:6 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 by , 3 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:9 by , 3 years ago
Priority: | blocker → major |
---|
FWIW My Mingw-w64 build Windows seems fine. So not all windows, assume just VC++ compiled and possibly specific versions.
Using GEOS as of yesterday branch (also tested with one from a month ago).
yields consistently