[Talk-TW] Taiwan Highway Shields rendering

Louis Liu pttdog於gmail.com
Fri 4月 12 07:17:59 UTC 2013


Hi Arne,

Wow!

How do you handle  the ref tags of provincial/national highway branches,
like 1甲 and 1乙?
"甲" should bellow "1" in the shield, but Mapnik just puts them in the same
line when using the default settings.
I have an ugly solution: Every branches have their own in style sheet and
STATIC shield images.
There only tens of provincial branches in Taiwan, so this method is
possible.
But this makes the style sheet file more difficult to maintenance.

I started to fix some ref tag near Taichung and Kaohsiung.
There are so many tags need to be fix.
So I use the offline edit function of JOSM to massive modification in the
following steps:
1. Install waydownloader plug-ins.
2. Download a small area that covers highway from server.
3. Use waydownloader to download connected highways.
4. Repeat step 3 to complete all way segments
5. Save the data as file.
6. Use your favorite editor to replace the tags.
7. Don't forget to add "action='modify'" to the way you've modified.
8. Open JOSM and open the file, then upload.
The step 7 is important. Otherwise, JOSM won't know the way is modified (
and the changes won't be upload).

But do you have any elegant solutions for these cases?

Louis

2013/4/12 Arne Goetje <arne.goetje at gmail.com>

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dear all,
>
> I'm currently in the process of hacking the rendering of Taiwan's
> highway shields into Mapnik, so that we can us it on our local
> rendering server. I have uploaded[1] an example screenshot of my local
> server's output as illustration how it may look like in future. (Don't
> worry,I will make it more beautiful. This is just a proof of concept.)
>
> However, in order for this to work properly, I need everyone's help to
> fix the 'ref' tags in the database.
>
> 1. How the 'ref' tags are used:
>         a. 'ref:en' and 'ref:zh'
>         These tags are *never* rendered on the map! The /may/ be used by
> routing software to *announce* the turning directions to the driver.
> E.g. if 'ref:en'='Provincial Highway 4', the GPS routing software
> /may/ use this value to give directions, as in: "Turn right and follow
> $ref:en in 200 meters!"
>
>         b. 'ref'
>         This tag is rendered on the map *as is*. Mapnik and other
> applications *do not parse* the value and probably never will.
> Therefore we need to make sure that this value has a usable format.
> Some time ago we agreed already, that the old practice from putting
> 'Fwy','Hwy' and English county abbreviations in this field (because
> the rendering software did not have Chinese support available at that
> time) should be changed.
> Now, for the highway shields to work we *must* update all 'ref' tags
> to the new tagging rules:
>         * Freeways, Expressways and Highways: delete the 'Fwy' or 'Hwy'.
>           E.g. 'Fwy 1' should become '1'.
>         * Tertiary highways should have the Chinese county indicator and
> not
> the English abbreviation.
>           E.g. 'TY48' should become '桃48'. Do not put spaces, dashes or
> other characters in it (e.g. 縣).
>
>         c. 'ref' where multiple highways merge
>         According to the OSM wiki, we should separate tag values with ';',
> like '1;4;110', where the three highways 1,4 and 110 share the same
> road. However, the ';' separator will not be parsed by the rendering
> engine, that means, the value '1;4;110' will appear exactly like this
> on the map. This *does not* work with the highway shields.
> Since we cannot parse this value in Mapnik, we need to put additional
> information into the database.
>
> I propose the following new tags:
>         1. add a 'merged_highways' tag with a value of 1, 2, 3, or how many
> highways are merged on this way.
>         2. add tags for each 'ref', like 'ref1', 'ref2', 'ref3', etc. with
> the correct values.
>
> Example:
>         'highway'='primary'
>         'name'='三民路二段 (Sec. 2, Sanmin Rd.)'
>         'ref'='1;4;110'
>         'ref:en'='Provincial Highways 1, 4 & Route 110'
>         'ref:zh'='台1、4線、110' (or whatever better way to describe it)
>         'merged_highways'='3'
>         'ref1'='1'
>         'ref2'='4'
>         'ref3'='110'
> (Note: additional tags have been omitted in this example)
>
> This way, the default OSM map will behave like usual, but our map can
> properly render 3 highway shields next to each other. (The fact that
> '110' is a county highway and not a provincial highway can be
> determined by regular expressions in Mapnik.)
>
> So, please everyone help to clean up the 'ref' tags in the main OSM
> database:
>         * remove 'Fwy', 'Hwy' and all white spaces
>         * replace the English county indicators on Tertiary highways with
> their proper Chinese ones, remove spaces and dashes where not appropriate
>         * Where merged highways exist, update them according to the example
> above, remove spaces, ensure the separator in 'ref' is a ';'.
>
> Happy mapping! :)
>
> Cheers and Thanks!
> Arne
>
> [1] http://people.linux.org.tw/~arne/OSM_Highway_Shields.png
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQIcBAEBAgAGBQJRZ6R3AAoJENiwmJtstTzs2OoP/i1Xz8OLeRszli68nsAs7xYT
> aX/JalpOkYJmzNXfsOiwnQHiisIsDXaW2827L/QKaUdh4Ild/thYY436tVwL9I3k
> Os2R2ZgM04YNQA62lmY+og/9BdWSPhAW7/w8WedCXH9mqz0ifX3IgjE9iS5G6kxM
> XSDQFsuNzbkW4kpV625/gqRWo4id/o9Zg7q829kXxikDTjTPJwFFe0ruZdsUlTUW
> 9xHKW7FrFGqqPw1CWl8qMaFe0ojbUvEQjN3opObendLjCsnd4yLMhrltJ1sXeD7x
> DSXH8omyeIOJPNXddsN9JxOYHtigsxgHG7z0mmWZo52VJHmTCJZBQfrBG7TZwGQy
> 25IL7v0mkQOeT5mqLQQ1/zvyBb2YjCvKF3ZH0+lnscE+04PVlW/sxsMc5fuOi91o
> V0sVFz3dMAAWPoPbN9cxyqqg1UqgT9sEC3YTvAZREStWBX1BIQMUdq9eiXJDHT1C
> LiTMDau7EPzX0kfThzqkVgk+fm+rf3qQcHunKC37wOqqUOPSXoDF5v+QQvTcCHJG
> BsID6trP7YtDGP2pHbVic86WCFy1pnw43k47Btccji7nWaBeWeRfMHSn0I7kCWdR
> l7z/disu3cqinD83i63rwNjEVyt8aSv+nj0J5rB30fcM8BnAGHEsk58CamnZ1ivj
> aa8MUPgTUE3pIOJ/dyNu
> =ZC2+
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Talk-TW mailing list
> Talk-TW at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk-tw
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk-tw/attachments/20130412/4c91ac0d/attachment.html>


More information about the Talk-TW mailing list