Terraced/pixellated coastline with --precomp-sea

Hello, I am trying to switch to --precomp-sea instead of generating the coastline directly from OSM data. For higher zoomlevels this works fine. For lower zoomlevels (scale in basecamp >=5km) the coastline appears heavily terraced/pixellated. Playing with parameters like poly reduction did not change this behaviour. Here's a screenshot <http://www.wanderreitkarte.de/download/coastline_steps.png> . The real coastline from OSM data is visible as a dotted line. The coastline generated from OSM at the same zoomlevel looks somewhat jagged from polygon reduction, but is not terraced in any way. mkgmap versions: 3366 and 3796 sea file downloaded from mkgmap page <http://osm2.pleiades.uni-wuppertal.de/sea/latest/sea.zip> , 13.2.17 command line: java -jar mkgmap.jar --tdbfile --preserve-element-order --precomp-sea=p:\Input\sea.zip --generate-sea -c osmc_options There are no sea parameters in the option file, poly reduction is at default levels. Any ideas? -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com.

After playing around some more I think I found the reason for the problem. It appears that there is a conflict between the --min-size-polygon= parameter and sea generation from the precompiled files. For larger Values of --min-size-polygon, the tearracing becomes worse. For smaller values it becomes better. It seems that the generated sea polygons are filtered one at a time by --min-size-polygon. Which is probably a bug. With the default setting for --generate-sea or an explicit --generate-sea=multipolygon, the sea is supposed to be generated as a multipolygon. It does not make sense to filter out individual parts of a multipolygon. Multipolygons on land are treated as a whole, and the same should be true for generated sea polys. But it looks like the --precomp-sea option creates many individual sea polygons, not a multipolygon as described in the documentation. I think the simple solution would be to not apply the --min-size-polygon filter to generated sea at all. A coastline multipolygon usually extends over large parts of the map, so it would be never filtered. -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi NopMap, please post the complete list of mkgmap options to make it easier to reproduce the problem. The default style contains this line: natural=sea { add mkgmap:skipSizeFilter=true; set mkgmap:drawLevel=2 } [0x32 resolution 10] which in fact tells mkgmap to skip the size filter for the polygons generated by precomp-sea. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von NopMap <ekkehart@gmx.de> Gesendet: Samstag, 18. Februar 2017 12:29:06 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Terraced/pixellated coastline with --precomp-sea After playing around some more I think I found the reason for the problem. It appears that there is a conflict between the --min-size-polygon= parameter and sea generation from the precompiled files. For larger Values of --min-size-polygon, the tearracing becomes worse. For smaller values it becomes better. It seems that the generated sea polygons are filtered one at a time by --min-size-polygon. Which is probably a bug. With the default setting for --generate-sea or an explicit --generate-sea=multipolygon, the sea is supposed to be generated as a multipolygon. It does not make sense to filter out individual parts of a multipolygon. Multipolygons on land are treated as a whole, and the same should be true for generated sea polys. But it looks like the --precomp-sea option creates many individual sea polygons, not a multipolygon as described in the documentation. I think the simple solution would be to not apply the --min-size-polygon filter to generated sea at all. A coastline multipolygon usually extends over large parts of the map, so it would be never filtered. -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, Gerd Petermann wrote
The default style contains this line: natural=sea { add mkgmap:skipSizeFilter=true; set mkgmap:drawLevel=2 } [0x32 resolution 10]
which in fact tells mkgmap to skip the size filter for the polygons generated by precomp-sea.
Thank you, that was the missing key information. My custom style does not contain any such line. After adding a similar rule to my style, I was able to get proper sea areas. But I was forced to use the 0x32 area like in your example. It was unused in my style and I never had a rule for it. First I tried 0x3C which I used for all large water bodies - including the generated sea polys - in the past, but then the sea polygons were disappearing again. It seems that multiple rules leading to the same Garmin object are somehow connected and the skipSizeFilter is somehow cancelled. I still do not understand why --generate-sea has worked without any rule like the one you posted and without using 0x32 for years, as long as the sea polys were generated from OSM data. Shouldn't the sea generator's output be the same, regarless of the source of input? -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi NopMap, I think you found an error in mkgmap. It has a routine which merges shapes with the same attributes. This routine ignores the mkgmap:skipSizeFilter. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von NopMap <ekkehart@gmx.de> Gesendet: Sonntag, 19. Februar 2017 20:51 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Terraced/pixellated coastline with --precomp-sea Hi Gerd, Gerd Petermann wrote
The default style contains this line: natural=sea { add mkgmap:skipSizeFilter=true; set mkgmap:drawLevel=2 } [0x32 resolution 10]
which in fact tells mkgmap to skip the size filter for the polygons generated by precomp-sea.
Thank you, that was the missing key information. My custom style does not contain any such line. After adding a similar rule to my style, I was able to get proper sea areas. But I was forced to use the 0x32 area like in your example. It was unused in my style and I never had a rule for it. First I tried 0x3C which I used for all large water bodies - including the generated sea polys - in the past, but then the sea polygons were disappearing again. It seems that multiple rules leading to the same Garmin object are somehow connected and the skipSizeFilter is somehow cancelled. I still do not understand why --generate-sea has worked without any rule like the one you posted and without using 0x32 for years, as long as the sea polys were generated from OSM data. Shouldn't the sea generator's output be the same, regarless of the source of input? -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi NopMap, Both precompiled and generated sea will produce polygons with natural=sea or natural=land by default, so your style probably contained a rule for one of them. With r3815 I've fixed one error regarding skipSizeFilter . I tried to reproduce your problem with r3814 by changing the default style to use 0x3c for natural=sea and found no problem unless I used an extreme value for the size filter like --min-size-polygon=300. Please check your options for this filter, see output for java -jar mkgmap.jar --help:options It shows: --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, default is 8. See also polygon-size-limits. --polygon-size-limits=limits code Allows to specify different min-size-polygon values for each resolution. Sample: --polygon-size-limits="24:12, 18:10, 16:8, 14:4, 12:2, 11:0" If a resolution is not given, mkgmap uses the value for the next higher one. For the given sample, resolutions 19 to 24 will use value 12, resolution 17 and 18 will use 10, and so on. Value 0 means to skip the size filter. Note that in resolution 24 the filter is not used. If these settings are extreme you should see problems with all large polygons. Hope this helps. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von NopMap <ekkehart@gmx.de> Gesendet: Sonntag, 19. Februar 2017 20:51:51 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Terraced/pixellated coastline with --precomp-sea Hi Gerd, Gerd Petermann wrote
The default style contains this line: natural=sea { add mkgmap:skipSizeFilter=true; set mkgmap:drawLevel=2 } [0x32 resolution 10]
which in fact tells mkgmap to skip the size filter for the polygons generated by precomp-sea.
Thank you, that was the missing key information. My custom style does not contain any such line. After adding a similar rule to my style, I was able to get proper sea areas. But I was forced to use the 0x32 area like in your example. It was unused in my style and I never had a rule for it. First I tried 0x3C which I used for all large water bodies - including the generated sea polys - in the past, but then the sea polygons were disappearing again. It seems that multiple rules leading to the same Garmin object are somehow connected and the skipSizeFilter is somehow cancelled. I still do not understand why --generate-sea has worked without any rule like the one you posted and without using 0x32 for years, as long as the sea polys were generated from OSM data. Shouldn't the sea generator's output be the same, regarless of the source of input? -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I definitely did not have a regular rule for natural=sea in my style. I need to check whether there was a rule added by code in my tooling. (or in mkgmap code) Is the observation correct, that the SeaGenerator creates many simple polygons, individually tagged as natural=sea, but not connected by a multipolygon? The command line description claims that the generator would use multipolygons, but I believe that is not true. -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi NopMap, yes, docu is not correct here reg. the combination of options --precomp-sea and --generate-sea. The precompiled sea data (sea.zip) from e.g. http://www.mkgmap.org.uk/download/mkgmap.html doesn't contain type=multipilygon relations. It contains pbf files with (generated) ways with the tags natural=sea or natural=land. I think that the creation of the data in sea.zip also doesn't involve any multipolygon code. I think the docu is correct when you don't use --precomp-sea, but the combinations --precomp-sea=sea.zip --precomp-sea=sea.zip --generate-sea --precomp-sea=sea.zip --generate-sea=multipolygon all give the same result (single ways, no multipolygons). I have no idea why WanMil (the initial coder) documented it that way. I see no need to combine the two options, not even to set a different tag for land. I assume it was done for backward compatibility. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von NopMap <ekkehart@gmx.de> Gesendet: Mittwoch, 22. Februar 2017 07:58:00 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Terraced/pixellated coastline with --precomp-sea I definitely did not have a regular rule for natural=sea in my style. I need to check whether there was a rule added by code in my tooling. (or in mkgmap code) Is the observation correct, that the SeaGenerator creates many simple polygons, individually tagged as natural=sea, but not connected by a multipolygon? The command line description claims that the generator would use multipolygons, but I believe that is not true. -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I have tried mkgmap-r3819 now. I can confirm that it works properly with multiple rules for the same garmin type and mixed skipFilter values. I also switched to using --precomp-sea alone. The docs are pretty misleading in this point. :-( Maps look nice now. Thanks for the support. bye, Nop -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Nop, okay, that leaves me puzzled because I have no idea how your produced the original problem. Maybe you looked at the overview map (press Ctrl+G and Basecamp shows something like "basemap only" ) Anyhow, good to hear that the problem is solved :-) Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von NopMap <ekkehart@gmx.de> Gesendet: Donnerstag, 23. Februar 2017 21:32:40 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Terraced/pixellated coastline with --precomp-sea I have tried mkgmap-r3819 now. I can confirm that it works properly with multiple rules for the same garmin type and mixed skipFilter values. I also switched to using --precomp-sea alone. The docs are pretty misleading in this point. :-( Maps look nice now. Thanks for the support. bye, Nop -- View this message in context: http://gis.19327.n8.nabble.com/Terraced-pixellated-coastline-with-precomp-se... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (2)
-
Gerd Petermann
-
NopMap