Closed almccon closed 8 years ago
Looking into the highway_shields table in Postgres for a New York state extract and I only see shields for interstates. Perhaps the SQL is not capturing the "ref" tag for other states? Looking into it further now.
So it looks as if the shields are showing up in other U.S. states & countries now. I checked Tokyo, New York state, and Mexico City.
One thing I've noticed is that we may want different widths for the default highway shield. Shields for Mexico City tend to overflow while those for Vancouver seem too large. Or perhaps for longer ref
strings we can shrink the text size slightly.
I just did a bunch of work creating multiple-sized highway shields for another map we're working on, mostly borrowing from openstreetmap-carto (see for example this elaborate script that produces a ton of similar shields of various sizes. Those shields get saved into a folder like this: https://github.com/gravitystorm/openstreetmap-carto/tree/master/symbols/shields
I can try porting some of that code over to this repo, or if you felt like diving into it you could try borrowing some code from openstreetmap-carto to accomplish the same effect.
that looks interesting @almccon, I'm open to testing them out. Do you happen to know which .mss
file contains the carto code for assigning the shields?
ah nevermind, found it: https://github.com/gravitystorm/openstreetmap-carto/blob/master/roads.mss#L2581
Looks like
select distinct char_length(ref) from highway_shields order by char_length;
typically returns 1 as the lowest and 7 being the largest value. However in Tokyo I noticed a 23 because someone edited ref
as being "Road joining 408 and 53", so we'd also have to exclude values from ref
> 7.
Think I've got it working so that we only render default tiles for non US interstates and that the default shield size changes based on the amount of text, ie: char_length(ref)
.
Here's Victoria, BC
And here's Seattle
Still need to test over-seas but think it's looking good so far.
closing for now.
I'm not sure why the default shield isn't showing up, but when I use extracts outside the US I don't get any highway shields, and when I use extracts of other US states, I don't get any of their state shields.