6

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.

geotheory
  • 526
  • 5
  • 17
  • Here is a simple library for DP: https://pypi.python.org/pypi/rdp/0.5 , but if you want to simplify shapefiles, first you have to convert .shp to array. – dmh126 Jun 03 '14 at 12:06
  • If you can tolerate java there is a preliminary support for Visvalingam-Whyatt in JTS http://sourceforge.net/p/jts-topo-suite/mailman/message/31765540/ – user30184 Jun 03 '14 at 12:27
  • this is not the same question, but the answer by @gene is more like what you need (using grass v.generalize) http://gis.stackexchange.com/questions/86250/algorithm-to-move-polygon-nodes-when-simplifying – radouxju Jun 03 '14 at 12:31
  • Thanks for comments, and apologies for late response. I'll look into these but keep the question open in case anyone else has any further contributions – geotheory Jun 17 '14 at 16:14

1 Answers1

1

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.

rusty
  • 41
  • 2