logo separator

[mkgmap-dev] Maintaining generated sea polygons

From Marko Mäkelä marko.makela at iki.fi on Fri May 21 07:14:10 BST 2010

On Thu, May 20, 2010 at 10:57:54PM -0700, NopMap wrote:
>Therefore my question: Would it be possible to save the generated sea 
>polygons to disk in osm format so an intact set of polygons can be 
>re-used with future osm data? That way it could be ensured that future 
>updates will have the same, correct sea polygons and not be randomly 
>broken by temporary inconsistencies in the osm data.

I've found this command useful:

osmosis --rx finland.osm.bz2 --tf accept-ways natural=coastline 
--used-node --wx finland-coastline.osm

The resulting file is small enough to be loaded to JOSM. I have also 
done something similar with boundary=administrative.

>Storing the image files and using them as a seperate map layer is not a 
>solution as older Garmin devices are really cumbersome with layers or 
>cannot handle multiple layers at all - and the map is for an older 
>device.

Sorry, I can't help there. A couple of months ago, I tried merging some 
additional coastline to finland.osm, but it did not work for me. I did 
not investigate further, but instead decided to patch the data (move the 
end nodes of the coastline in the map extract to the tile boundary, 
creating ugly vertical or horizontal lines).  Like this:

bzip2 -dc "$OSM_BZ2"|
perl -e \
'my $del=0;
while(<>){
     $del=1 if (/<relation.* version="1".* user="usm78-gis"/);
     s/(<node id="28954644".*lat=)"60\.51564"/$1"59.326172"/;
     s/(<node id="29193143".*lon=)"24\.12826"/$1"19.072266"/;
     print unless $del;
     $del=0 if m|</relation>|;
}' > "$OSM"

This one also gets rid of generated, slightly erroneous landuse 
multipolygons in Russia. I used to use a similar technique for omitting 
incomplete coastline sections (sea islands), but I fixed that by editing 
the Geofabrik cutting polygon. It took a few iterations, but Frederik 
Ramm was patient with me.

The coastline of Finland seems to be pretty static; I can't remember 
when I last saw a generate-sea warning. There has been a tempest in 
teapot regarding converting lakes away from natural=coastline. When I 
get around to it, I should convert the last big lake (Päijänne) to 
natural=water multipolygons.

	Marko



More information about the mkgmap-dev mailing list