stamen / terrain-classic

World-wide CartoCSS port of Stamen's classic terrain style
ISC License
144 stars 35 forks source link

add highway shields #10

Closed almccon closed 8 years ago

almccon commented 9 years ago

currently we have none

mojodna commented 9 years ago

I did some work on this in the CaliParks map that could be improved / repurposed:

https://github.com/stamen/parks-forward-map/blob/master/sql/highway_shields.sql https://github.com/stamen/parks-forward-map/blob/master/map.mss#L640-L690

(There are also versions for VT and OR on different branches.)

almccon commented 9 years ago

At minimum it would be a shame to lose the three types of shield we have now: Interstate, US, and California. screen shot 2015-08-24 at 4 07 21 pm

If we fall back to rectangles everywhere else, that's okay.

screen shot 2015-08-24 at 4 09 29 pm

Or maybe we just enable VT and OR too, if we can pull from CaliParks.

clhenrick commented 9 years ago

cartocss reference: https://github.com/mapbox/carto/blob/master/docs/latest.md#shield

clhenrick commented 9 years ago

also Dane gives good advice here: http://gis.stackexchange.com/questions/47985/tilemill-label-and-shield-are-overlapping-how-can-this-be-solved

clhenrick commented 9 years ago

cascadenik code for previous shield placement is here: https://github.com/Citytracking/Terrain/blob/master/mapnik/routes.mss#L1-L74

clhenrick commented 9 years ago

@almccon @mojodna looks like in the og terrain tiles that data generated from skeletron was used to render highway shields. Some fancy pg regex was then used to get the appropriate text to place on top of the shields as well as to create categories for displaying the correct shield png file.

Any ideas for how we might replicate this? I assume we will want to avoid any heavy data processing, ie: running skeletron for the whole OSM planet file.

mojodna commented 8 years ago

This is how I did it for the CaliParks map:

https://github.com/stamen/parks-forward-map/blob/master/sql/highway_shields.sql

https://github.com/stamen/parks-forward-map/blob/master/map.mss#L640-L690

clhenrick commented 8 years ago

adding the hwy shield layer to project.yml similarly to how it was done here: https://github.com/stamen/parks-forward-map/blob/master/project.yml#L727-L746

clhenrick commented 8 years ago

First pass at adding highway shields, so far so good: screen shot 2015-09-07 at 12 19 57 pm

screen shot 2015-09-07 at 12 20 14 pm

To get an idea of what the non-CA state shields may look like: screen shot 2015-09-07 at 12 23 13 pm

I'm also using the SVG icons when possible as they scale nicer / don't get pixellated. Will look into PNG icons for the other states once I've grabbed another OSM extract (eg: PDX)

almccon commented 8 years ago

Looking really good. Any idea what's happening with those odd drop-shadows around the non-CA shields? Are those svg rectangles?

almccon commented 8 years ago

Also, at the lower zooms (11 and 12) OG Terrain avoids showing shields for non-motorways. That avoids the situation in your first screenshot where you can't really see the road for CA-1 in Marin.

Actually, OG does something cutesy at zoom 12 with tiny, unlabeled California shields, but I don't think we need to bother replicating that. screen shot 2015-09-07 at 7 sep 4 25 11

almccon commented 8 years ago

Oh, actually, I'm wrong. Here is a case at z11 where it shows shields on highway 17 to Santa Cruz, even though it's not a motorway. Hmm, so I don't actually know what it's doing at that zoom.

screen shot 2015-09-07 at 7 sep 4 26 00

clhenrick commented 8 years ago

@almccon not sure about the drop shadows around the rectangle shields. Those are actually png files and not SVGs. Perhaps it makes sense to make a rectangle SVG icon for the default shield?

almccon commented 8 years ago

Yeah, probably. I bet the drop shadows are really just an aliasing artifact where the edges of the png not aligning well with rendered pixels. An SVG rectangle should solve that.

almccon commented 8 years ago

Trying to run this locally, and it seems like there's a highway_shields table in the database that's not getting created for me.

https://github.com/stamen/terrain-classic/blob/master/terrain-classic.yml#L914

clhenrick commented 8 years ago

Hey Alan, you need to run the SQL in sql/highway_shields.sql to generate that table. I was not sure how to add running that SQL code to the Makefile.

clhenrick commented 8 years ago
clhenrick commented 8 years ago

@almccon the default SVG shield rendering, okay to close this one?

screen shot 2015-09-14 at 8 01 43 pm

almccon commented 8 years ago

Yup, looks good to me!