Am 03.03.2011 20:11, schrieb Johann Gail:


Am 03.03.2011 13:35, schrieb Markus_g:
I Hope there is a way to turn it off. I like forests and national parks, etc coming in at zoom 16 so I can get the big picture on what's around. I think
it should be the style file that sets when things should be displayed.

At the moment there is no possibility to turn it of. I am working on a patch for it.


Here follows the patch.
Im not sure of the name of the option. I have called it --min-size-polygon=NUM. Maybe a better name would be --remove-small-polygons=NUM. Any suggestions for it?

If no option is set, then the default is zero, which means the same behaviour as before the 'small polygon patch'

Feel free to check it in into the trunk.

Regards,
Johann

Index: src/uk/me/parabola/mkgmap/build/MapBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/build/MapBuilder.java	(Revision 1878)
+++ src/uk/me/parabola/mkgmap/build/MapBuilder.java	(Arbeitskopie)
@@ -94,7 +94,6 @@
 	private static final int CLEAR_TOP_BITS = (32 - 15);
 	
 	private static final int MIN_SIZE_LINE = 1;
-	private static final int MIN_SIZE_POLYGON = 8;
 
 	private final java.util.Map<MapPoint,POIRecord> poimap = new HashMap<MapPoint,POIRecord>();
 	private final java.util.Map<MapPoint,City> cityMap = new HashMap<MapPoint,City>();
@@ -113,6 +112,7 @@
 	private String regionName;
 	private String regionAbbr;
 
+	private int minSizePolygon;
 	private double reducePointError;
 	private double reducePointErrorPolygon;
 	private boolean mergeLines;
@@ -135,6 +135,7 @@
 		countryAbbr = props.getProperty("country-abbr", countryAbbr);
 		regionName = props.getProperty("region-name", null);
 		regionAbbr = props.getProperty("region-abbr", null);
+ 		minSizePolygon = props.getProperty("min-size-polygon", 0);
 		reducePointError = props.getProperty("reduce-point-density", 2.6);
  		reducePointErrorPolygon = props.getProperty("reduce-point-density-polygon", -1);
 		if (reducePointErrorPolygon == -1)
@@ -931,7 +932,8 @@
 		if (enableLineCleanFilters && (res < 24)) {
 			filters.addFilter(new PreserveHorizontalAndVerticalLinesFilter());
 			filters.addFilter(new RoundCoordsFilter());
-			filters.addFilter(new SizeFilter(MIN_SIZE_POLYGON));
+			if (minSizePolygon > 0)
+				filters.addFilter(new SizeFilter(minSizePolygon));
 			//DouglasPeucker behaves at the moment not really optimal at low zooms, but acceptable.
 			//Is there an similar algorithm for polygons?
 			if(reducePointErrorPolygon > 0)
Index: resources/help/en/options
===================================================================
--- resources/help/en/options	(Revision 1878)
+++ resources/help/en/options	(Arbeitskopie)
@@ -188,6 +188,13 @@
 	Try to merge lines. This helps the simplify filter to straighten out
 	longer chunks at lower zoom levels. Decreases file size more.
 	Increases paint speed at low zoom levels.
+	At the moment this option causes routing errors. Use only if routing 
+	is not needed in your map.
+	
+--min-size-polygon=NUM
+  Removes all polygons smaller than NUM from the map.
+  This reduces map size and speeds up redrawing of maps. 
+  Recommended value is 8 to 15.
 
 Miscellaneous options:
 
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to