At the moment there is a commandline switch (-reduce-point-density=xxx) which allows you to set the dp error distance for each call. It should be doable with nearly no effort to introduce a second option for polygon settings.

Just added a patch with an additional option 'reduce-point-density-polygon=xxx', which allows to set different dp settings for polygons.

This patch is for testing only, it is not be meant to be checked in.


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());

_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to