Index: DouglasPeuckerFilter.java
===================================================================
--- DouglasPeuckerFilter.java	(revision 4688)
+++ DouglasPeuckerFilter.java	(working copy)
@@ -40,7 +40,36 @@
 	@Override
 	public void init(FilterConfig config) {
 		this.resolution = config.getResolution();
-		this.maxErrorDistance = filterDistance * (1<< config.getShift());
+		if (resolution == 23) {
+			this.maxErrorDistance = filterDistance * (1<< config.getShift()); }
+		if (resolution == 22) {
+			this.maxErrorDistance = filterDistance * 3 * (1<< config.getShift()); }
+		if (resolution == 22) {
+			this.maxErrorDistance = filterDistance * 4 * (1<< config.getShift()); }
+		if (resolution == 21) {
+			this.maxErrorDistance = filterDistance * 4 * (1<< config.getShift()); }
+		if (resolution == 20) {
+			this.maxErrorDistance = filterDistance * 5 * (1<< config.getShift()); }
+		if (resolution == 19) {
+			this.maxErrorDistance = filterDistance * 6 * (1<< config.getShift()); }
+		if (resolution == 18) {
+			this.maxErrorDistance = filterDistance * 6 * (1<< config.getShift()); }
+		if (resolution == 17 {
+			this.maxErrorDistance = filterDistance * 7 * (1<< config.getShift()); }
+		if (resolution == 16) {
+			this.maxErrorDistance = filterDistance * 7 * (1<< config.getShift()); }
+		if (resolution == 15) {
+			this.maxErrorDistance = filterDistance * 8 * (1<< config.getShift()); }
+		if (resolution == 14) {
+			this.maxErrorDistance = filterDistance * 8 * (1<< config.getShift()); }
+		if (resolution == 13 {
+			this.maxErrorDistance = filterDistance * 9 * (1<< config.getShift()); }
+		if (resolution == 12) {
+			this.maxErrorDistance = filterDistance * 9 * (1<< config.getShift()); }
+		if (resolution == 11) {
+			this.maxErrorDistance = filterDistance * 10 * (1<< config.getShift()); }
+		if (resolution == 10) {
+			this.maxErrorDistance = filterDistance * 10 * (1<< config.getShift()); }
 	}
 
 	/**
@@ -58,7 +87,7 @@
 			next.doFilter(element);
 			return;
 		}
-
+		
 		MapLine line = (MapLine) element;
 
 		List<Coord> points = line.getPoints();
