splitter: problems rendering int. borders

I’m trying to build a cyclemap of the Netherlands and have a problem rendering the International borders correctly.

First step: downloaded an extract (http://hypercube.telascience.org/planet/planet-nl-latest.osm.gz) of the Netherlands with some extra border areas of Germany and Belgium.

After unpacking the file I split it into smaller sections:
java -Xmx1024m -jar splitter.jar --max-nodes=750000 --mapid=10010001 --description=osm_nl planet-nl-latest.osm

The result after processing the tiles with mkgmap I get this map:

The international border shows gaps and weird laps between the tiles. A lot of the border isnt rendered at all.
How can I solve this?

Another problem is that the NE part of the NL’s is flooded, I understand that mkgmap can’t handle some coastlines very well.

Have you checked that your source file (planet-nl-latest.osm.gz) contains all the border lines intact? I have experience from Geofabrik’s planet extracts. The one for Finland is apparently using a cutting polygon that includes some small areas of neighbour countries and excludes some of Finland. You could write a Perl script or something that extracts only the border lines from the source file, and load that file to JOSM.

Another problem with Geofabrik (and maybe your data source as well) is that it is using Osmosis options that do not preserve relations or coastlines at borders. Mkgmap works with rectangular tiles. If the coastlines stop before the tile border, flooding will be likely.

Flooding usually happens when the coastline doesn’t extend to the edge of the tile. mkgmap cannot guess where the coastline is, so you end up with flooding. You can either edit the OSM file to ensure that the coastline extends to the edge, or trim the tile border so it lines up with the edge of the coastline. You can also try using the --generate-sea=extend-sea-sectors,close-gaps=x option, where x is a number (in metres) that tells mkgmap to fill small gaps in the coastline and extend-sea-sectors tells mkgmap to extend coastlines to reach the edge of the tile.

Thanks, but I don’t know how to check the border within the .osm file. I use Merkaartor which can’t handle those large osm data. I’m not familiair with josm nor writing perl scripts, sorry.
The only thing I can try is using the europe.osm.bz2 map from Geofabrik and split it up in the same sections and see what the results are.

Editing the osm file is no option unfortunately, my computer crashes with large osm tiles. I haven’t tried the close-gaps option, maybe this will work together with the europe.osm extract.
Btw, your website is very informative, learned a lot how to build a osm garmin map with mkgmap!

I’ve tried now
–generate-sea=multipolygon,no-sea-sectors

(the option close-gaps=2000 or more didn’t seem to do anything; I tried no-mp/polygon, with or without sea sectors, without result)

With multipolygon on, now the land is visible but the Waddensea in the NE of Groningen went also dry.
Didn’t try the europe.osm extract yet, it takes too much time to process the tiles.

The borders are still a mystery to me. I downloaded the complete relations of the international and provincial borders with Merkaartor, and saved them as osm file.

I had to remove the borders around some enclaves in the South (Baarle Hertog/Baarle Nassau, partly Belgium territory within NL’s) because they messed up the borders a lot.

When I processed the borders.osm file with mkgmap (with those enclaves), there were several error wanrings like
“SEVERE (Polyline): Subdivision shift is 0 and its centre is at …” and a lot of horizontal and vertical borderlines within the country appeared.

Is there a special patch for mkgmap to render those multipolygons? (Because in this case it was not caused by splitter, I used the complete relation).

Without those enclaves I made a separate border img file of the whole country and included it later with the other processed tiles (I rendered them without provincial and national borders). Now it looks like this:

Did you try --generate-sea=no-mp,extend-sea-sectors? This option generally works flawlessly for me.

Yes! That did the trick, thanks a lot Charlie!

result of --generate-sea=no-mp,extend-sea-sectors

The border multipolygon problem still remains, here an example of a very small enclave of Belgium in The Netherlands. I removed the International/regional/provincial borders around that ‘island’ only kept the municipality borders (Baarle Hertog / Baarle Nassau)

http://www.openstreetmap.org/?lat=51.4223&lon=4.89031&zoom=15&layers=B000FTF
http://www.openstreetmap.org/browse/way/27964804

It is part of an exclave relation, how to render that?

Looks like this when rendered on my mapsource map. The grey dotted straight vertical/horizontal border lines don’t belong there.


I’m no expert on borders/multi-polygons. I have noticed similar problems myself (including the SEVERE subdivision shift error) when rendering UK and Italian borders, but generally ignore it as I have mkgmap set up to only render the borders at the lowest resolution levels (12-18) so they disappear when I zoom in. It might be worth your while posting a question to the mkgmap-dev email list and ask WanMil (who has done a lot of work on multipolygons recently) to take a look for you.

Thanks, I will have a look on that list and will probably post more questions there.

For those who want to take a look at my map, it can be downloaded now at
this page:

https://sites.google.com/site/openfietsmap/

I analysed the multipolygon more closely and narrowed the problem of rendering down to one relation of Baarle Nassau, where

A = one big outer ring (the Dutch municipality of Baarle-Nassau),
B1, B2 = some islands inside (Belgium territory, role=inner)
C= Within some of those islands there are polygons (Dutch, role=outer)

It goes wrong with those outer polygons within the inner polygons.

Simplification looks like this, the two vertical border lines are not supposed to be there:

The relation can be found at http://betaplace.emaitie.de/webapps.relation-analyzer/analyze.jsp?relationId=47798
There are no gaps or faults within the relation as far as I can see.