[GIS] Competing approaches to line & polygon simplification

algorithmgeneralizationpythonrsimplify

There seems to be a few theoretical options around at the moment for geometric simplification. Douglas–Peucker seems the most established, followed by Visvalingam's approach (used by d3.js). Now there's the relatively new 'Robust Douglas-Peucker' (Pallero?) method. I'm not clear what the relative merits are of these, and I've not had much luck finding libraries for the latter two in open-source environments (R, Python, etc) that would enable me to test them out.

So this question is primarily what open-source libraries can anyone point to for alternatives to the classic (but often problematic for topology preservation) Douglas–Peucker. But I think it would also be really useful to have any comments from people with experience of the relative strengths of these approaches, and any links to relevant resources discussing these.

Best Answer

The Java Topology Suite includes a TopologyPreservingSimplifier. The code does not include a reference for the implementation, beyond stating that it operates in a similar manner to Douglas-Peucker, with additional constraints on altering the topology.

This functionality has made it into the Java-to-C++ translation of JTS, libgeos, which is further exposed to python in the excellent Shapely python library.

I've had good luck with the topology preserving simplifier when operating on polygons with holes in tricky but non-diabolical inputs.

Of course there are nuances in the simplification requirements based on the application. For instance, in simplifying shorelines for a hydrodynamic model (my application), peninsulas are important to retain but small inlets can be eliminated. In this case, an approach which worked fairly well was along the lines of

shore_simple=shore.buffer(-tolerance).buffer(tolerance)

which can also be accomplished using Shapely, or most any GIS program for that matter. I'm not suggesting this as a general (or efficient!) approach, but instead to say that not all methods are equally suited to all applications.

Related Question