logo separator

[mkgmap-dev] precompiled sea

From Ticker Berkin rwb-mkgmap at jagit.co.uk on Wed Mar 18 10:34:01 GMT 2020

Hi Gerd

I was just going through the code and this is what I had so far:

The significant changes are in createInnerWays/createLandPolygons

r4389 createInnerWays extracts land/anticlockwise/islands from the
hitMap. It has some logical mistakes like a 50% chance of putting an
erroneous start/end point on an earlier edge from where the real land
is cut by the tile bounds; this is like a spike, but possibly going
round 3 corners and back!

Then, unless the only shoreline is an enclosed sea
(Caspian/Black/Dead/...?) or there are sea-sectors, it will generated a
sea background and MP.cutout all the land.

Otherwise it generates a land background with this as the MP relation
inner but probably no outers unless there are sea-sectors.

r4392 has similar behaviour and I was just getting to the bit that
you've found where addCorners needed fixing.

My version simplifies and fixes createLandPolygons and addCorners.

It also has other improvements:

If the tile doesn't have any real islands, make it land based and have
any encroaching sea as sea polygons.

If using option sea-sectors: 
- Put the triangles on the correct side of the coastline rather than
the 50% chance it had before.
- Don't force the background to land as an "inner" of the triangles
"outer"
- rather, if tile is land, show sea-triangle on the sea-side, if the
background is sea, show a land-triangle on the land-side.

There are a few other minor fixes and tidy-ups

Ticker 

On Wed, 2020-03-18 at 10:05 +0000, Gerd Petermann wrote:
> Hi Ticker,
> 
> OK, my results:
> The refactoring in r4382 introduced two bugs.
> With the partial revert in r4391 both bugs were fixed.
> With r4392 one bug was re-introduced.  :(
> I've attached a small patch for that.
> 
> Now I wonder if your longer patch fixes any other issues?
> 
> Gerd



More information about the mkgmap-dev mailing list