Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace road shields with SVGs #694

Merged
merged 1 commit into from
Jul 4, 2014

Conversation

pnorman
Copy link
Collaborator

@pnorman pnorman commented Jul 3, 2014

Fixes #693
Fixes #680 (Or good enough for me to stop fiddling with sub-pixel positioning)
Fixes #203
Fixes #202 (mostly)
Fixes #146 (mostly)

Cross-reference #294 mapnik/mapnik#2020

Starts organization for #508

Replacing PNG shields with SVG ones is a first step in improving rendering of shields. It also allows for much easier customization. Unfortunately we have to specify the shield colours in the SVGs, as two colours are used - the shield colour and white. Even if there weren't two used, mapnik can't recolour a SVG in a ShieldSymbolizer.

To determine shield widths for a given number of characters the ref values in the planet were sorted by character and then road length was counted for each combination of characters. This found the most common ref values, which were then selected from for testing.

Motorway

Trunk

Primary

Secondary

Tertiary

Fixes gravitystorm#693
Fixes gravitystorm#680
Fixes gravitystorm#203
Fixes gravitystorm#202 (mostly)
Fixes gravitystorm#146 (mostly)

Cross-reference gravitystorm#294 mapnik/mapnik#2020

Starts organization for gravitystorm#508

Replace existing PNG road shields with new SVG ones. This allows for easier adjustment of colour and width as well as sharper high-resolution rendering.

At the same time, a number of other shield related bugs are fixed.

To aid in organization, a new shields directory is created.
@Zverik
Copy link
Contributor

Zverik commented Jul 4, 2014

As those shields are (hopefully) generated with a script, should it be included in this PR?
(great work, btw)

@pnorman
Copy link
Collaborator Author

pnorman commented Jul 4, 2014

As those shields are (hopefully) generated with a script

Hah. I wish.

Given that I need to consider another set of shields for #670, I might write a script. It could take a generic file and transform it with XSLT... or, because it's limited in scope, I could just write a shell script that takes in the appropriate widths, does math, and spits out a svg.

@pnorman
Copy link
Collaborator Author

pnorman commented Jul 4, 2014

Just to clarify, I don't suggest waiting on a script for merging this - the first thing I would do with the script is re-run it to get (hopefully) identical results to what I have now.

@Zverik
Copy link
Contributor

Zverik commented Jul 4, 2014

gravitystorm added a commit that referenced this pull request Jul 4, 2014
Replace road shields with SVGs
@gravitystorm gravitystorm merged commit fb1b287 into gravitystorm:master Jul 4, 2014
@pnorman pnorman deleted the svg_shield branch July 11, 2014 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants