<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
Hi,<br>
<br>
Recently I offered a good collegue/friend to create a map for his
Garmin GPS60 device of England. At first all seemed well, but then
he complained that the village he was going to on his next vacation
could not be found. The village was 'Chelsworth'.<br>
<br>
I looked into it, and managed to solve it. In the process I learned
3 things and I would like to share the info. It could very well be
that I overlooked something, or be completely wrong, so please
correct me where needed.<br>
<br>
1) Building Mkgmap/Splitter yourself with Eclipse/Ant. (Windows)<br>
To be able to run the build Jar's with Java SE Runtime
Environment 8 (<a class="moz-txt-link-freetext" href="https://www.java.com/nl/download/manual.jsp">https://www.java.com/nl/download/manual.jsp</a>)
I added release="8" to build.xml. For Mkgmap and splitter.<br>
<br>
<img src="cid:part1.vNCOQakp.fzXXLZsC@hotmail.com" alt="" class=""><br>
<br>
Note: Ant requires JRE 11+, so I installed that JDK and that
resulted in the runtime requirement of JRE 11 in the build Jar's,
without the release="8" parameter.<br>
<br>
2) Admin_level2 is required for setting the country, but that does
not work when you build the bound files yourself from a 'small'
region.<br>
<br>
I always thought it was best to create the bounds files myself using
the info on:
<a class="moz-txt-link-freetext" href="https://www.mkgmap.org.uk/news/2013/01/10/creating-pre-processed-boundaries">https://www.mkgmap.org.uk/news/2013/01/10/creating-pre-processed-boundaries</a><br>
The example shown, with 'europe.osm.pbf' does work very well indeed.
It wasn't until I tried this procedure with '<a href="http://download.geofabrik.de/europe/great-britain/england-latest.osm.pbf">england-latest.osm.pbf</a>'
that I found that the resulting bounds files are smaller, and
apparently dont contain all the info needed to set the Admin_level2
and thus Country.<br>
<br>
I tested this by adding debug lines like this in inc/address and
looking at the available tags.<br>
addr:city=Ipswich { echotags "Ipswich" } <br>
addr:village=Chelsworth { echotags "Chelsworth" } <br>
(It turns out that many places (cities/villages) in England have
addr:village set, although its use is discouraged. Confusing, but
handy if you want to debug.)<br>
<br>
To summarize: Either take the bounds files from <a class="moz-txt-link-freetext" href="https://www.thkukuk.de/osm/data/bounds-latest.zip">https://www.thkukuk.de/osm/data/bounds-latest.zip</a>.
Or if you want to create them yourself take a large area like
Europe.<br>
<br>
3) The supplied inc/address file from the default style does not
handle all villages/cities well in England. Solution: If level10 is
available take that value for city.<br>
<br>
According to <a class="moz-txt-link-freetext" href="https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative">https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative</a>
Level10 for England are civil parishes<br>
<br>
<img src="cid:part2.8B3jbM5w.JD7INKf9@hotmail.com" alt="" class=""><br>
<br>
<br>
Output from building the map using the debug lines in inc/address
from bullet 2. (You can see that now level2 is set correctly)<br>
<br>
Some points dont have a level10:<br>
Node generated from way 376991833 [addr:city=Ipswich,
addr:housenumber=9, addr:postcode=IP1 3SE, addr:street=Henley Road,
amenity=pub, building=yes, mkgmap:admin_level2=GBR,
mkgmap:admin_level4=England, mkgmap:admin_level6=Suffolk,
mkgmap:admin_level8=Ipswich, mkgmap:area2poi=true,
mkgmap:cache_area_size=35.823, mkgmap:label:1=The Greyhound,
name=The Greyhound] Ipswich<br>
<br>
But if they do, that value should be taken for mkgmap:city, and not
level8. Level8 (Babergh) is the district Chelsworth belongs to.<br>
Node 9352769232 [addr:city=Ipswich, addr:housenumber=24-26,
addr:postcode=IP7 7HU, addr:street=The Street,
addr:village=Chelsworth, amenity=pub, <b>mkgmap:admin_level10=Chelsworth</b>,
mkgmap:admin_level2=GBR, mkgmap:admin_level4=England,
mkgmap:admin_level6=Suffolk, mkgmap:admin_level8=Babergh,
mkgmap:label:1=The Peacock, name=The Peacock] Ipswich<br>
<br>
Node 9352769232 [addr:city=Ipswich, addr:housenumber=24-26,
addr:postcode=IP7 7HU, addr:street=The Street,
addr:village=Chelsworth, amenity=pub,<b>
mkgmap:admin_level10=Chelsworth</b>, mkgmap:admin_level2=GBR,
mkgmap:admin_level4=England, mkgmap:admin_level6=Suffolk,
mkgmap:admin_level8=Babergh, mkgmap:label:1=The Peacock, name=The
Peacock] Chelsworth<br>
<br>
My solution is to add these lines in inc/address, just before the
'common city rules' <br>
<br>
<img src="cid:part3.vup8BGfJ.rvzb9fPl@hotmail.com" alt="" class=""><br>
<br>
Copy&Paste version:<br>
# Great Britain. Many Towns/Villages have there names in level10,
not in level8<br>
# Todo: Maybe add mkgmap:admin_level4=England to selection?<br>
mkgmap:country=GBR & mkgmap:city!=* & mkgmap:admin_level10=*
{ set mkgmap:city='${mkgmap:admin_level10}' }<br>
<br>
Cheers Frank<br>
<br>
</body>
</html>