<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi WanMil,<br><br>> the address file is an include and you don't know what happens before. <br><div>> Maybe it is not set in the mkgmap style. But the address file is quite <br>> general and so it is probably used by other styles which might have some <br>> special rules before "include address" that set mkgmap:country.<br>> <br>> So I would recommend to leave it as it is (I think the style optimizer <br>> will reduce the performance drawbacks of the one additional <br>> mkgmap:country!=* ).<br><br>OK. I don't mind to have a few more simple rules, I just wanted to point out<br>that they will probably not produce the wanted result.<br><br>> <br>> I would like to use<br>> mkgmap:country!=* { set <br>> mkgmap:country='${mkgmap:admin_level2}'|'${addr:country}'|'${is_in:country}' <br>> }<br>> But that doesn't work because it is not allowed to use a != rule only. <br>> Maybe you have a good idea to tweak it so that it works in such a way.<br><br>OK, I'll have a look. Up to now I don't even know why it is not allowed.<br><br>> <br>> You are right that this assignment does not normalize the country codes <br>> within the styles. It would be good to add that.<br><br>OK. I'll try to code the style function. Sounds easy enough.<br><br>Gerd<br><br>> A function need to call Locator.getCountryISOCode(String). This returns <br>> the three letter ISO code. All values listed in the Locator.xml are <br>> accepted (name, ISO code, variants). Additionally it learns <br>> automatically all localization variants from the loaded bounds files. <br>> Just start at BoundaryLocationPreparer.parseTags(String).<br>> For all other values that are still not mapped the uppercase string is <br>> returned.<br>> <br>> At the moment mkgmap:country is normalized after the style file <br>> processing in the MapBuilder class. Just search for <br>> locator.getCountryISOCode(String).<br>> <br>> Ulrich<br>> <br>> <br>> <br>> > Hi all,<br>> ><br>> > the default style file inc/address starts with these three rules:<br>> > # first set the country code<br>> > mkgmap:country!=* & mkgmap:admin_level2=* { set<br>> > mkgmap:country='${mkgmap:admin_level2}' }<br>> > mkgmap:country!=* & addr:country=* { set mkgmap:country='${addr:country}' }<br>> > mkgmap:country!=* & is_in:country=* { set<br>> > mkgmap:country='${is_in:country}' }<br>> ><br>> > I found no code in the mkgmap java sources that sets mkgmap:country, so<br>> > the first rule<br>> > will always set mkgmap:country unless one manipulates the OSM data.<br>> ><br>> > The following rules evaluate mkgmap:country and expect the ISO 1366 code<br>> > with 3 characters, e.g. DEU<br>> > for Germany.<br>> > The wiki for tag addr:country says that it should contain the 2<br>> > character ISO code, e.g. DE for Germany.<br>> > The is_in:country tag contains the country name, not the iso code.<br>> ><br>> > I think we should remove the two useless rules unless someone finds a<br>> > working alternative.<br>> ><br>> > Gerd<br>> ><br>> ><br>> > _______________________________________________<br>> > mkgmap-dev mailing list<br>> > mkgmap-dev@lists.mkgmap.org.uk<br>> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev<br>> ><br>> <br>> _______________________________________________<br>> mkgmap-dev mailing list<br>> mkgmap-dev@lists.mkgmap.org.uk<br>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev<br></div>                                            </div></body>
</html>