[geos-devel] [GEOS] #1081: TopologyPreservingSimplifier / GEOSTopologyPreserveSimplify on Windows
GEOS
geos-trac at osgeo.org
Tue Dec 1 15:05:00 PST 2020
#1081: TopologyPreservingSimplifier / GEOSTopologyPreserveSimplify on Windows
------------------------+--------------------------
Reporter: Mike Taves | Owner: geos-devel@…
Type: defect | Status: new
Priority: blocker | Milestone: 3.9.0
Component: Unit Tests | Version: master
Severity: Unassigned | Keywords:
------------------------+--------------------------
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.
--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1081>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
More information about the geos-devel
mailing list