logo separator

[mkgmap-dev] Problems with sea in overview map

From Gerd Petermann GPetermann_muenchen at hotmail.com on Wed May 19 08:06:49 BST 2021

Hi all,

I've identified a few problems with the handling of natural=sea in areas with lots of islands, e.g. coast of Norway. Thouands of rather small polygons are created, esp. when also natual=land is rendered. 
1. Typical tiles are rather large, they span several precompiled sea tiles if --precomp-sea=sea.zip is used. As of now, the polygons from different sea-tiles are never merged. This might be improved to reduce file size and possibly also improve rendering
2. Even at resolution 12 the curent code distributes the thousands of tiles into multiple sub divisions before ShapeMerger is executed for each subdiv. Shapes (polygons) are only merged when the number of points for one shape stays inside the IMG limit of 256 points, so the merger cannot do much.
3. Douglas-Peucker (DP) filter is used for the merged shapes which contain holes. This gives weird results because the invisible lines which connect the holes are causing heavy self-intersections at low resolutions. I think this is one reason for white triangles in the sea.

I am experimenting with these ideas:
- At low resolutions the ShapeMerger could merge more so that shapes with more than > 256 points are produced, assuming that DP filter will remove many of them. Not sure if this works with shapes that have holes.
- At low resolutions it is likely/wanted that small islands disappear, so we should remove those first, together with the lines that connect them with the outer ring.
- The simplified sea polygons without holes should be merged as much as possible before using any filter, maybe DP should be executed first on the merged shapes so that fever subdivs are created.

Each method has its own effects and I'm searching for the best combination and order. 

A lot of this is only possible because we now have Tickers code that allows multipolygon splitting without using java.awt.geom.Area.intersect() . Tickers code in ShapeSplitter seems to be able to handle the holes properly. 

Gerd




More information about the mkgmap-dev mailing list