#1004: Simplify method provides wrong result ------------------------+--------------------------- Reporter: kamad3 | Owner: geos-devel@… Type: defect | Status: new Priority: minor | Milestone: Component: Default | Version: 3.8.0 Severity: Unassigned | Resolution: Keywords: simplify | ------------------------+---------------------------
Comment (by mdavis): Copying the comments on the GDAL ticket for posterity: There's a few things going on here. * The bad output is caused by GEOS trying to rectify an invalid output polygon from simplification by using {{{buffer(0)}}}. Obviously that trick doesn't always work... ( {{{buffer}}} sometimes keeps the "wrong" lobe of a self-crossing polygon) * QGIS appears to be using the GEOS {{{TopologyPreservingSimplifier}}}, which preserves topology by not simplifying vertices which would cause invalid output. * The PostGIS {{{ST_Simplify}}} uses an internal implementation which can produce invalid output. But it also offers {{{ST_SimplifyPreserveTopology}}}. * In JTS there is a flag on {{{DouglasPeuckerSimplifier}}} which allows skipping the area-topology-fixing step. This will give the same output as PostGIS {{{ST_Simplify}}}. Unfortunately the GEOS code doesn't have this flag. My suggestion for dealing with this is: * The method of forcing valid polygonal output for {{{Simplify}}} is problematic, and no simple fix is obvious. So for now this hack should probably be disabled. Either the flag should be added, or (more simply) {{{Simplify}}} should be changed to change its default behaviour. * If valid output is required then either use {{{TopologyPreservingSimplifier}}} or {{{MakeValid}}} -- Ticket URL: <https://trac.osgeo.org/geos/ticket/1004#comment:2> GEOS <http://trac.osgeo.org/geos> GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
_______________________________________________ geos-devel mailing list geos-devel@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/geos-devel