logo separator

[mkgmap-dev] Land polygon from sea generator

From Adrian ar2988-os at yahoo.co.uk on Mon Jun 6 15:59:28 BST 2011

I have recently updated my setup to use a new version of mkgmap with
improvements to sea generation and indexing. I would like to
congratulate all involved for the great progress that has been made.

I made a map of Great Britain and France. It occupies 1.1GB and
comprises 184 tiles. I extracted the area I wanted from the Geofabrik
Europe extract. The mkgmap run took 52 min (Core 2 Duo 2.66GHz,
--max-jobs). I gave it 7GB of RAM and it used 4GB. [I am using Apple
Java 1.6. Previous releases simply stopped with an error if they ran out
of memory. The latest release appears to do something similar to virtual
memory, so it does not stop when it runs out of memory, but it becomes
extremely slow when it starts to swap to disk.]

I used generate-sea:multipolygon,extend-sea-sectors with mkgmap-r1955
(trunk) and the sea all seems to have been generated correctly. There
was just one place where a land polygon was missing, and so I got a
yellow background instead of white. Tile details from areas.list:
63240143: 2381824,49152 to 2439168,131072
#       : 51.108398,1.054688 to 52.338867,2.812500
This tile contained some white land and some yellow land. The yellow
area was around 51.9N 1.1E. It is the area south of the Stour estuary
including Clacton-on-Sea and Walton-on-the-Naze.

I inspected the coastline data of this tile in JOSM and I could not see
any problem with it. This is, however, a very complex coastline. The
coastline ways and nodes account for about one fifth of the data of the
tile. I think this coastline contains an excessive amount of detail.
There appears to have been a large-scale import from the Ordnance Survey
Vector Map and I suspect the data was not simplified before it was added
to OSM.

I have uploaded Ipswich.zip to files.mkgmap.org.uk/download. I would be
grateful if someone could look at why the land polygon was not
generated. The .zip contains: 143coast.osm.gz, which has just the
coastline elements from the aforementioned tile, my commands, style and
.TYP files, the details from areas.list, and the actual mkgmap command.

I tried to use osmosis to extract the coastline elements from the tile,
but osmosis could not touch the file produced by splitter, not even an
old version of osmosis which supports API 0.5. Osmosis complained that
the time stamps were missing. This is what I did instead:
1. Load the file produced by splitter, into JOSM. JOSM produces tens of
thousands of warnings but it opens the file. (I believe JOSM was
modified specifically to allow it to open splitter tiles.)
2. Use the search feature to select all elements tagged
natural=coastline.
3. Create a new data layer.
4. Merge the selection into the new layer.
5. Save the new layer as 143coast.osm. This file lacks the bounds data,
so...
6. Expand the file produced by splitter, to 63240143.osm.
7. Use a text editor to copy and paste the bounds element from
63240143.osm to 143coast.osm. (I was surprised that my text editor could
open a 100MB file, but it did. It took 0.5GB of RAM.)

During the run of mkgmap, three tiles produced errors like this:
SEVERE (MapSplitter): 63240175.osm.gz: Area too small to split at
http://www.openstreetmap.org/?mlat=52.03131&mlon=0.87899&zoom=17 (reduce
the density of points, length of lines, etc.)
With two of the tiles, I could not see any resulting defects in the map.
For the third tile -
63240175: 2381824,32768 to 2439168,49152
#       : 51.108398,0.703125 to 52.338867,1.054688
the only defect I could see was that at resolution 24, the land polygon
was missing in the part of the tile to the north of 52.03131N, the
latitude given in the error message.

This run of mkgmap also prompted other questions which I might raise as
separate threads.



More information about the mkgmap-dev mailing list