some days ago someone asked, if it is possible to make the dp filter more aggressive. If you apply the attached patch, it comments out the default dp filter and activates the straight version of the dp filter. Its already in the code.

This version does not look at the nodes, it straightens out as far as possible. This could mean some inaccuracies at crossings.

In combination with the line merging filter (V8 simplify ways) it gaves real straightend motorway lines at low resolutions. Looks similar to the garmin maps.

Feel free to try it, it works really fine, but this patch should not made its way into the trunk. If you find it usefull, I will prepare a cleaner one.

What I would achive in future is a solution between the recent dp filter and this aggressive one. But this is outstanding work. Next week I will find less time to continue work.

Index: src/uk/me/parabola/mkgmap/filters/DouglasPeuckerFilter.java
--- src/uk/me/parabola/mkgmap/filters/DouglasPeuckerFilter.java	(Revision 1409)
+++ src/uk/me/parabola/mkgmap/filters/DouglasPeuckerFilter.java	(Arbeitskopie)
@@ -69,7 +69,7 @@
 //#if (Node version)
 //Dont touch Coords, which are nodes. 
 //So points at croosings will not be moved
-		// For now simplify all points, which are not nodes
+/*		// For now simplify all points, which are not nodes
 		// and no start and no end point
 		// Loop runs downwards, as the list length gets modified while running
 		int endIndex = coords.size()-1;
@@ -87,13 +87,14 @@
 		// Simplify the rest
 		douglasPeucker(coords, 0, endIndex, maxErrorDistance);
 //#else Straight version
 //Do the douglasPeucker on the whole line. 
 //Deletes more points, but may lead to incorrect diplay of crossings at given high error distances 
-		douglasPeucker(coords, 0, n, maxErrorDistance);
-	*/	
+		int endIndex = coords.size()-1;
+		douglasPeucker(coords, 0, endIndex, maxErrorDistance);
 		MapLine newline = line.copy();

mkgmap-dev mailing list

Reply via email to