<div dir="auto">Really glad to see that someone is reviving this and actually taking the step to get it rendered. Frankly, I never understood why Phil didn't do this in the first place. I even mentioned this to him at the time (can't remember his response though).<div dir="auto"><br></div><div dir="auto">-Evin (compdude)</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018, 2:21 PM Kevin Kenny <<a href="mailto:kevin.b.kenny@gmail.com">kevin.b.kenny@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(I apologize in advance to the tile-serving community if this message<br>
is inappropriate. I see that traffic on that list is largely limited<br>
to highly specific technical discussions, but couldn't see a more<br>
appropriate forum.)<br>
<br>
For several years now, I've been using the support code for shaped<br>
shields in OSM, originally developed by Phil! Gold and Richard Weait,<br>
to render North American-style maps. A typical example can be found at<br>
<a href="https://kbk.is-a-geek.net/catskills/test4.html?la=41.4143&lo=-74.4233&z=14" rel="noreferrer noreferrer" target="_blank">https://kbk.is-a-geek.net/catskills/test4.html?la=41.4143&lo=-74.4233&z=14</a><br>
In that view, you can see distinct shields for Interstate, US, New<br>
York, and county routes, and at least one concurrence (New York 17M<br>
aligned with US 6). Incidentally, Phil's is the only renderer that<br>
I've seen that can make sense of cases like West Virginia's bizarre<br>
double route numbers, as seen in<br>
<a href="https://kbk.is-a-geek.net/catskills/test4.html?la=41.4143&lo=-74.4233&z=14" rel="noreferrer noreferrer" target="_blank">https://kbk.is-a-geek.net/catskills/test4.html?la=41.4143&lo=-74.4233&z=14</a><br>
.<br>
<br>
The visual distinction among highway shields is really necessary in<br>
North America, where there are so many different route networks<br>
overlaid.<br>
<br>
In the course of working with the code, I've made a number of changes<br>
and become seriously out of sync with the main development line, which<br>
appears to be moribund. (Phil! and Richard have not answered recent<br>
queries; I suspect that I have obsolete contact information, but the<br>
messages also have not been returned undelivered.)<br>
<br>
Accordingly, I've (quite reluctantly) created my own repository -<br>
<a href="https://github.com/kennykb/osm-shields" rel="noreferrer noreferrer" target="_blank">https://github.com/kennykb/osm-shields</a> - with material from the<br>
project. The shield templates to be found there are mostly those of<br>
Phil! (I added only a handful), but the code to manage shields is<br>
almost entirely new. Some significant changes are:<br>
<br>
The list of shields to be rendered is obtained from the database<br>
itself, rather than being predetermined by a configuration file for<br>
each network. This has the disadvantage that refs that are known to be<br>
problematic may be rendered (but in most cases they ought to be<br>
unsigned_ref). On the other hand, it has the distinct advantage that<br>
as mappers continue to create the route relations, the corresponding<br>
shields appear virtually automatically.<br>
<br>
The composition of shield clusters, rather than being handled by a<br>
stored procedure in the database, is done using a GroupSymbolizer in<br>
Mapnik. I suspect, given the dearth of discussion that I find in a<br>
Google query, that I'm the first user to attempt to use<br>
GroupSymbolizer with actual open-ended shield clusters, and therefore<br>
that I've trodden new ground in the path from database to renderer. I<br>
encourage developers who are interested in the GroupSymbolizer to read<br>
at least <a href="https://github.com/kennykb/osm-shields/wiki/Using-the-GroupSymbolizer" rel="noreferrer noreferrer" target="_blank">https://github.com/kennykb/osm-shields/wiki/Using-the-GroupSymbolizer</a><br>
- it has a number of tricks to structure the results in a way that the<br>
GroupSymbolizer can consume and that renders well. The disadvantage to<br>
using the GroupSymbolizer is that Phil!'s shield clusters were rather<br>
more attractive visually, since they were aligned to lie in the<br>
direction of a way. The advantage is that the current approach can run<br>
on an unpatched Mapnik, as opposed to Phil!'s original, which requires<br>
at least patching Mapnik to use a read/write connection to the<br>
database.<br>
<br>
Managing, reliably, the association between ways and the routes in<br>
which they participate requires a couple of database tables that a<br>
stock osm2pgsql does not produce. I would very much appreciate any<br>
commentary from developers of osm2pgsql and Mapnik, particularly,<br>
about the issues discussed in<br>
<a href="https://github.com/kennykb/osm-shields/wiki/Maintaining-the-association-between-ways-and-routes" rel="noreferrer noreferrer" target="_blank">https://github.com/kennykb/osm-shields/wiki/Maintaining-the-association-between-ways-and-routes</a><br>
What I'm currently doing works well for my own use, which is driven by<br>
daily updates to extracts at Geofabrik, but will obviously not scale<br>
to a whole planet and minutely updates.<br>
<br>
Finally, I'd really like to invite anyone with the necessary SVG<br>
skills to contribute shield graphics for the missing networks. If<br>
you're also a programmer and want to take a whack at the rest of the<br>
procedure in <a href="https://github.com/kennykb/osm-shields/wiki/Adding-new-networks" rel="noreferrer noreferrer" target="_blank">https://github.com/kennykb/osm-shields/wiki/Adding-new-networks</a>,<br>
and give me a pull request or ask for help, that would be even better,<br>
but even the artwork would be a time-saver.<br>
<br>
If you've got this far in reading, thanks! I know this was a long<br>
message, and I hope that I've not wasted too much of anyone's time.<br>
<br>
_______________________________________________<br>
Talk-us mailing list<br>
<a href="mailto:Talk-us@openstreetmap.org" target="_blank" rel="noreferrer">Talk-us@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/talk-us" rel="noreferrer noreferrer" target="_blank">https://lists.openstreetmap.org/listinfo/talk-us</a><br>
</blockquote></div>