Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a few multipolygons that have several hundred points in them. I'm looking to create less complex "thumbnails" polygons.

Naturally I'm attempting to use the simplify method, which is supposed to apply the Ramer-Douglas-Peucker algorithm. However, it doesn't seem to be working:

>>> m = Multipolygon.objects.get(id=1)
>>> m.geometry.num_points
>>> m.geometry.simplify(0).num_points
>>> m.geometry.simplify(1).num_points
>>> m.geometry.simplify(0.5).num_points
>>> m.geometry.simplify(10).num_points

I'm clearly missing something. When I simplify, I either get the original polygon back or an empty one, depending on the tolerance value that I use. How is the tolerance parameter supposed to work?

share|improve this question
up vote 7 down vote accepted

The tolerance value is specified in map units: if two points are within the snapping tolerance, they are collapsed. So if you have geographic coordinates, simplify(1) would collapse everything to the nearest degree. Try something like simplify(0.0001) to start, or smaller depending on the resolution of your input data.

You may also be interested in this snippet, which allows you to specify precision as a number of points to retain in the output geometry.

share|improve this answer
Thanks! All of my values are in lat/lng (wgs84), and nearby points are probably within 100m, so a tolerance of 1 degree is way too much! The snippet is great too, that was going to be my followup question. – Seth Aug 17 '10 at 4:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.