logo separator

[mkgmap-dev] White stripes in the sea

From WanMil wmgcnfg at web.de on Wed Jan 2 18:47:22 GMT 2013

> On Wed, Jan 02, 2013 at 06:24:17AM -0800, GerdP wrote:
>> Are these errors normal?
>
> I would say yes. When using generate-sea=polygons, mkgmap will make a
> 'jigsaw puzzle' around each island in the natural=coastline polygon,
> using horizontal and vertical lines. Perhaps it could try to minimize
> the length of the lines, by using diagonal lines, attaching the islands
> to each other as a tree or graph, instead of attaching each island to
> the coastline.
>
> 	Marko

Marko,

I am quite sure you mixup generate-sea=polygons with 
generate-sea=multipolygon.

When using the polygon variant mkgmap creates a big sea rectangle 
covering the whole tile tagged with natural=sea and adds additionally 
all land polygons tagged with natural=land. So the land polygons covers 
the sea "background". You should not see any white line using this 
variant. The disadvantage is that you have a sea background so under 
each land polygon you also have a sea polygon.

When using generate-sea=multipolygon the land and sea areas are distinct 
because the sea and land areas are built up by one big multipolygon. And 
mkgmap cuts out the inner (land) parts by cutting the outer polygon into 
two halves by a horizontal or vertical cut. The mp algorithm favours 
cuts at multiples of 2^n which improved the artefacts.
Of course the whole algorithm can be improved but I didn't find a better 
solution which does not result in *very* *very* long calculations.

But that does not mean that someone else won't find a better solution. 
Some ideas:

1. Double short cut
An inner polygons could be cut out by adding the same short short twice 
to the outer polygon. I try some ASCII art:
MP looks like (o = outer, i = inner)
ooooooooooooooooo
o               o
o               o
o   iiii        o
o   i  i        o
o   iiii      ooo
o             o
o             o
ooooooooooooooo

Then we can add a short cut from o to i by adding the short cut and the 
lines of i to o. So o is going around i.
ooooooooooooooooo
o               o
o  oooooo       o
o  oiiiio       o
ooooi  io       o
ooooiiiio     ooo
o  oooooo     o
o             o
ooooooooooooooo


Up to now this doesn't work because all filters that are applied later 
use the java.awt.geom.Area class to cut polygons into two halves. And 
the Area class removes the short cut. So if the usage of Area could be 
removed this would be a possible solution (although I haven' tried if it 
looks better...)

2. Better multipolygon cuts
Instead of cutting the multipolygon by a complete vertical or horizontal 
cut one could cut out a short corner.

ooooooooooooooooo
o   o           o
o  oo           o
ooooiiii        o
o   i  i        o
o   iiii      ooo
o             o
o             o
ooooooooooooooo


So as a result:
When you want to remove the sea artefacts you must improve the 
multipolygon cutting.

WanMil



More information about the mkgmap-dev mailing list