Just created a patch for it.
Thilo Hannemann schrieb:
The problem with the roads is that the SizeFilter is called for lines as well
as for polygons. But the call to the filter is in two different places in
mkgmap/build/MapBuilder.java. So if you make the MIN_SIZE a parameter and use
different values for lines and polygons you won't have any holes in the roads
at all and can set MIN_SIZE to a bigger value for the polygons.
Regards
Thilo
Am 08.01.2010 um 15:52 schrieb Felix Hartmann:
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)
@@ -91,6 +91,9 @@
public class MapBuilder implements Configurable {
private static final Logger log = Logger.getLogger(MapBuilder.class);
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>();
@@ -883,7 +886,7 @@
LayerFilterChain filters = new LayerFilterChain(config);
if (enableLineCleanFilters && (res < 24)) {
filters.addFilter(new RoundCoordsFilter());
- filters.addFilter(new SizeFilter());
+ filters.addFilter(new SizeFilter(MIN_SIZE_LINE));
if(reducePointError > 0)
filters.addFilter(new DouglasPeuckerFilter(reducePointError));
}
@@ -921,7 +924,7 @@
LayerFilterChain filters = new LayerFilterChain(config);
if (enableLineCleanFilters && (res < 24)) {
filters.addFilter(new RoundCoordsFilter());
- filters.addFilter(new SizeFilter());
+ filters.addFilter(new SizeFilter(MIN_SIZE_POLYGON));
//DouglasPeucker behaves at the moment not really optimal at low zooms, but acceptable.
//Is there an similar algorithm for polygons?
if(reducePointError > 0)
Index: src/uk/me/parabola/mkgmap/filters/SizeFilter.java
===================================================================
--- src/uk/me/parabola/mkgmap/filters/SizeFilter.java (Revision 1473)
+++ src/uk/me/parabola/mkgmap/filters/SizeFilter.java (Arbeitskopie)
@@ -24,13 +24,16 @@
*/
public class SizeFilter implements MapFilter {
- // Minsize==1 may cause small holes in QLandkarte, but does not at etrex!
- private static final int MIN_SIZE = 1;
+ private int size;
private int minSize;
+
+ public SizeFilter(int s) {
+ size = s;
+ }
public void init(FilterConfig config) {
- minSize = MIN_SIZE * (1<<config.getShift());
+ minSize = size * (1<<config.getShift());
}
/**
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev