<div dir="ltr"><div><div><br></div>Hi Arne,<br><br></div>Wow!<br><div><br>How do you handle the ref tags of provincial/national highway branches, like 1甲 and 1乙?<br></div><div>"甲" should bellow "1" in the shield, but Mapnik just puts them in the same line when using the default settings.<br>
</div><div><div class="gmail_extra">I have an ugly solution: Every branches have their own in style sheet and STATIC shield images.<br></div><div class="gmail_extra">There only tens of provincial branches in Taiwan, so this method is possible.<br>
</div><div class="gmail_extra">But this makes the style sheet file more difficult to maintenance.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I started to fix some ref tag near Taichung and Kaohsiung.<br>
</div><div class="gmail_extra">There are so many tags need to be fix.<br>So I use the offline edit function of JOSM to massive modification in the following steps:<br></div><div class="gmail_extra">1. Install waydownloader plug-ins.<br>
</div><div class="gmail_extra">2. Download a small area that covers highway from server.<br></div><div class="gmail_extra">3. Use waydownloader to download connected highways.<br></div><div class="gmail_extra">4. Repeat step 3 to complete all way segments<br>
</div><div class="gmail_extra">5. Save the data as file.<br></div><div class="gmail_extra">6. Use your favorite editor to replace the tags.<br></div><div class="gmail_extra">7. Don't forget to add "action='modify'" to the way you've modified.<br>
</div><div class="gmail_extra"></div><div class="gmail_extra">8. Open JOSM and open the file, then upload.<br></div><div class="gmail_extra"></div><div class="gmail_extra">The step 7 is important. Otherwise, JOSM won't know the way is modified ( and the changes won't be upload).<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">But do you have any elegant solutions for these cases? <br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Louis<br></div><div class="gmail_extra">
<br></div><div class="gmail_extra"><div class="gmail_quote">2013/4/12 Arne Goetje <span dir="ltr"><<a href="mailto:arne.goetje@gmail.com" target="_blank">arne.goetje@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Dear all,<br>
<br>
I'm currently in the process of hacking the rendering of Taiwan's<br>
highway shields into Mapnik, so that we can us it on our local<br>
rendering server. I have uploaded[1] an example screenshot of my local<br>
server's output as illustration how it may look like in future. (Don't<br>
worry,I will make it more beautiful. This is just a proof of concept.)<br>
<br>
However, in order for this to work properly, I need everyone's help to<br>
fix the 'ref' tags in the database.<br>
<br>
1. How the 'ref' tags are used:<br>
a. 'ref:en' and 'ref:zh'<br>
These tags are *never* rendered on the map! The /may/ be used by<br>
routing software to *announce* the turning directions to the driver.<br>
E.g. if 'ref:en'='Provincial Highway 4', the GPS routing software<br>
/may/ use this value to give directions, as in: "Turn right and follow<br>
$ref:en in 200 meters!"<br>
<br>
b. 'ref'<br>
This tag is rendered on the map *as is*. Mapnik and other<br>
applications *do not parse* the value and probably never will.<br>
Therefore we need to make sure that this value has a usable format.<br>
Some time ago we agreed already, that the old practice from putting<br>
'Fwy','Hwy' and English county abbreviations in this field (because<br>
the rendering software did not have Chinese support available at that<br>
time) should be changed.<br>
Now, for the highway shields to work we *must* update all 'ref' tags<br>
to the new tagging rules:<br>
* Freeways, Expressways and Highways: delete the 'Fwy' or 'Hwy'.<br>
E.g. 'Fwy 1' should become '1'.<br>
* Tertiary highways should have the Chinese county indicator and not<br>
the English abbreviation.<br>
E.g. 'TY48' should become '桃48'. Do not put spaces, dashes or<br>
other characters in it (e.g. 縣).<br>
<br>
c. 'ref' where multiple highways merge<br>
According to the OSM wiki, we should separate tag values with ';',<br>
like '1;4;110', where the three highways 1,4 and 110 share the same<br>
road. However, the ';' separator will not be parsed by the rendering<br>
engine, that means, the value '1;4;110' will appear exactly like this<br>
on the map. This *does not* work with the highway shields.<br>
Since we cannot parse this value in Mapnik, we need to put additional<br>
information into the database.<br>
<br>
I propose the following new tags:<br>
1. add a 'merged_highways' tag with a value of 1, 2, 3, or how many<br>
highways are merged on this way.<br>
2. add tags for each 'ref', like 'ref1', 'ref2', 'ref3', etc. with<br>
the correct values.<br>
<br>
Example:<br>
'highway'='primary'<br>
'name'='三民路二段 (Sec. 2, Sanmin Rd.)'<br>
'ref'='1;4;110'<br>
'ref:en'='Provincial Highways 1, 4 & Route 110'<br>
'ref:zh'='台1、4線、110' (or whatever better way to describe it)<br>
'merged_highways'='3'<br>
'ref1'='1'<br>
'ref2'='4'<br>
'ref3'='110'<br>
(Note: additional tags have been omitted in this example)<br>
<br>
This way, the default OSM map will behave like usual, but our map can<br>
properly render 3 highway shields next to each other. (The fact that<br>
'110' is a county highway and not a provincial highway can be<br>
determined by regular expressions in Mapnik.)<br>
<br>
So, please everyone help to clean up the 'ref' tags in the main OSM<br>
database:<br>
* remove 'Fwy', 'Hwy' and all white spaces<br>
* replace the English county indicators on Tertiary highways with<br>
their proper Chinese ones, remove spaces and dashes where not appropriate<br>
* Where merged highways exist, update them according to the example<br>
above, remove spaces, ensure the separator in 'ref' is a ';'.<br>
<br>
Happy mapping! :)<br>
<br>
Cheers and Thanks!<br>
Arne<br>
<br>
[1] <a href="http://people.linux.org.tw/~arne/OSM_Highway_Shields.png" target="_blank">http://people.linux.org.tw/~arne/OSM_Highway_Shields.png</a><br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.12 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
iQIcBAEBAgAGBQJRZ6R3AAoJENiwmJtstTzs2OoP/i1Xz8OLeRszli68nsAs7xYT<br>
aX/JalpOkYJmzNXfsOiwnQHiisIsDXaW2827L/QKaUdh4Ild/thYY436tVwL9I3k<br>
Os2R2ZgM04YNQA62lmY+og/9BdWSPhAW7/w8WedCXH9mqz0ifX3IgjE9iS5G6kxM<br>
XSDQFsuNzbkW4kpV625/gqRWo4id/o9Zg7q829kXxikDTjTPJwFFe0ruZdsUlTUW<br>
9xHKW7FrFGqqPw1CWl8qMaFe0ojbUvEQjN3opObendLjCsnd4yLMhrltJ1sXeD7x<br>
DSXH8omyeIOJPNXddsN9JxOYHtigsxgHG7z0mmWZo52VJHmTCJZBQfrBG7TZwGQy<br>
25IL7v0mkQOeT5mqLQQ1/zvyBb2YjCvKF3ZH0+lnscE+04PVlW/sxsMc5fuOi91o<br>
V0sVFz3dMAAWPoPbN9cxyqqg1UqgT9sEC3YTvAZREStWBX1BIQMUdq9eiXJDHT1C<br>
LiTMDau7EPzX0kfThzqkVgk+fm+rf3qQcHunKC37wOqqUOPSXoDF5v+QQvTcCHJG<br>
BsID6trP7YtDGP2pHbVic86WCFy1pnw43k47Btccji7nWaBeWeRfMHSn0I7kCWdR<br>
l7z/disu3cqinD83i63rwNjEVyt8aSv+nj0J5rB30fcM8BnAGHEsk58CamnZ1ivj<br>
aa8MUPgTUE3pIOJ/dyNu<br>
=ZC2+<br>
-----END PGP SIGNATURE-----<br>
<br>
_______________________________________________<br>
Talk-TW mailing list<br>
<a href="mailto:Talk-TW@openstreetmap.org">Talk-TW@openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/listinfo/talk-tw" target="_blank">http://lists.openstreetmap.org/listinfo/talk-tw</a><br>
</blockquote></div><br></div></div></div>