Now I have been using this patch a long time and , and it really works
fine. It applies the DP filter against polygons with a different
agressiveness than for lines. This is really useful because strong DP
filter against lines looks really bad, while for polygons the visual
quality is degraded less.
I currently use /--reduce-point-density=4 and
-reduce-point-density-polygon=8/
This is perfect for older GPS like etrex to have speed improvements but
no drop in visual quality. Also in Mapsource / Qlandkarte GT this works
very well. For Oregon or Dakota I would use something like 2.6 (default
current behavior) and 5.2
Archived Discussion can be found here:
http://www.mail-archive.com/[email protected]/msg04260.html
Patch by Johan Gail, working very well since then. (well only that it's
not yet set in the help file, so I have to use --x in front of the option)
I added a part2 -- to add the option to the help file, and allow it to
be used without --x on the mkgmap call.
Index: src/uk/me/parabola/mkgmap/build/MapBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/build/MapBuilder.java (Revision 1473)
+++ src/uk/me/parabola/mkgmap/build/MapBuilder.java (Arbeitskopie)
@@ -110,6 +110,7 @@
private String regionAbbr;
private double reducePointError;
+ private double reducePointErrorPolygon;
private boolean mergeLines;
private int locationAutofillLevel;
@@ -131,6 +132,9 @@
regionName = props.getProperty("region-name", null);
regionAbbr = props.getProperty("region-abbr", null);
reducePointError = props.getProperty("reduce-point-density", 2.6);
+ reducePointErrorPolygon = props.getProperty("reduce-point-density-polygon", -1);
+ if (reducePointErrorPolygon == -1)
+ reducePointErrorPolygon = reducePointError;
mergeLines = props.containsKey("merge-lines");
makePOIIndex = props.getProperty("make-poi-index", false);
@@ -924,8 +928,8 @@
filters.addFilter(new SizeFilter());
//DouglasPeucker behaves at the moment not really optimal at low zooms, but acceptable.
//Is there an similar algorithm for polygons?
- if(reducePointError > 0)
- filters.addFilter(new DouglasPeuckerFilter(reducePointError));
+ if(reducePointErrorPolygon > 0)
+ filters.addFilter(new DouglasPeuckerFilter(reducePointErrorPolygon));
}
filters.addFilter(new PolygonSplitterFilter());
filters.addFilter(new RemoveEmpty());Index: help/en/options
===================================================================
--- help/en/options (revision 1871)
+++ help/en/options (working copy)
@@ -177,9 +177,13 @@
NUM is the maximal allowed error distance, by which the resulting
way may differ from the original one.
This distance gets shifted with lower zoom levels.
- Recommended setting is 10, this should lead to only small differences
- (Default is 2.6, which should lead to invisible changes)
+ Recommended setting is 4, this should lead to only small differences
+ (Default is 2.6, which should lead to invisible changes)
+--reduce-point-density-polygon=NUM
+ Allows to set the maximal allowed error distance for the DP algorythm
+ to be applied against polygons. Recommended setting is 8.
+
--merge-lines
Try to merge lines. This helps the simplify filter to straighten out
longer chunks at lower zoom levels. Decreases file size more.
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev