logo separator

[mkgmap-dev] mkgmap-dev Digest, Vol 153, Issue 40 Resolution 23 raster problems

From Andrzej Popowski popej at poczta.onet.pl on Sun Apr 25 16:47:33 BST 2021

Hi,

maybe 10m contours are too dense for this area?

Please try attached patch. I have moved D-P simplification before 
rounding of coordination. This should preserve shape of the line a bit 
better. I'm not sure if this is a safe modification, but it seems to works.

I haven't found, where is done simplification of lines at resolution 24. 
Angle fixer probably works on roads only or I don't understand this code 
correctly.

-- 
Best regards,
Andrzej
-------------- next part --------------
Index: MapBuilder.java
===================================================================
--- MapBuilder.java	(revision 4677)
+++ MapBuilder.java	(working copy)
@@ -1188,10 +1188,10 @@
 		
 		LayerFilterChain filters = new LayerFilterChain(config);
 		if (enableLineCleanFilters && (res < 24)) {
+			if(reducePointError > 0)
+				filters.addFilter(new DouglasPeuckerFilter(reducePointError));
 			filters.addFilter(new RoundCoordsFilter());
 			filters.addFilter(new SizeFilter(MIN_SIZE_LINE));
-			if(reducePointError > 0)
-				filters.addFilter(new DouglasPeuckerFilter(reducePointError));
 		}
 		filters.addFilter(new LineSplitterFilter());
 		filters.addFilter(new RemoveEmpty());
@@ -1243,6 +1243,8 @@
 		LayerFilterChain filters = new LayerFilterChain(config);
 		filters.addFilter(new PolygonSplitterFilter());
 		if (enableLineCleanFilters && (res < 24)) {
+			if(reducePointErrorPolygon > 0)
+				filters.addFilter(new DouglasPeuckerFilter(reducePointErrorPolygon));
 			filters.addFilter(new RoundCoordsFilter());
 			int sizefilterVal =  getMinSizePolygonForResolution(res);
 			if (sizefilterVal > 0)
@@ -1249,8 +1251,6 @@
 				filters.addFilter(new SizeFilter(sizefilterVal));
 			//DouglasPeucker behaves at the moment not really optimal at low zooms, but acceptable.
 			//Is there an similar algorithm for polygons?
-			if(reducePointErrorPolygon > 0)
-				filters.addFilter(new DouglasPeuckerFilter(reducePointErrorPolygon));
 		}
 		filters.addFilter(new RemoveObsoletePointsFilter());
 		filters.addFilter(new RemoveEmpty());


More information about the mkgmap-dev mailing list