Travel Mapping

Web Design Discussion => General Web Design Discussion => Topic started by: Quidditch33 on June 15, 2016, 02:34:31 pm

Title: Clinched Routes Highway Shields
Post by: Quidditch33 on June 15, 2016, 02:34:31 pm
Dear viewer,

As of right now, some of the shields on the clinched routes screen are just white squares with the number and the state abbreviation on the top. In the future, will the shields that are currently white become what the actual state highway shields are?

Thanks,
Title: Re: Clinched Routes Highway Shields
Post by: Jim on June 15, 2016, 03:41:10 pm
I have no plans to enhance the shield generator, but welcome contributions from anyone who'd like to do so.
Title: Re: Clinched Routes Highway Shields
Post by: si404 on June 15, 2016, 04:39:39 pm
European systems with cartouches or rectangle shields that shouldn't be too hard.

alakt - yellow with black text (no prefix)
alavt - red with white text (no prefix)
albsh - blue with white text
andcg - red with white text
armm - blue with white text
auta - blue with white text
auts - blue with white text
azem - blue with white text
bela - white with black text
belb - white with black text
belr - white with black text
bgri - blue with white text
biha - green with white text
blrm - red with white text
bgra - green with white text
bgri - blue with white text (no prefix)
bgrii - blue with white text (no prefix)
cism - blue with white text
czed - red with white text (no prefix)
dnkpr - yellow with black text (no prefix, 'O' part of number)
eure - green with white text (all regions)
espa - blue with white text
estt - red with white text (no prefix)
finkt - yellow with black text (no prefix)
finvt - red with white text (no prefix)
fraa - red with white text
fran - red with white text
frht - blue with white text
geos - green with white text (georgian alphabet prefix: ს)
glpn - red with white text
gufn - red with white text
irln - green with yellow text
kaza - green with white text
kgzem - blue with white text (cyrillic ЭМ prefix)
ltua - red with white text
luxa - blue with white text
luxb - red with white text
luxn - red with white text
lvaa - red with white text
mltt - blue with white text (no prefix)
mnem - blue with white text
mtqa - red with white text
mtqn - red with white text
ncle - red with white text
nclt - red with white text
nlda - red with white text
nldn0 - yellow with black text
norrv - green with white text (no prefix)
pola - red with white text
pols - red with white text
poldk - red with white text (no prefix)
prta - blue with white text
pyft - red with white text
reun - red with white text
rksn - red with white text
rusm - blue with white text
srba - green with white text (no prefix)
srbb - yellow with black text (no prefix)
spmn - red with white text
svkd - red with white text
svkr - red with white text
svki - blue with white text (no prefix)
svng - yellow with black text (no prefix)
svnh - blue with white text
swer - blue with white text
ukrm - blue with white text
wlft - red with white text
Title: Re: Clinched Routes Highway Shields
Post by: michih on June 15, 2016, 04:48:25 pm
deua - blue with white text
deub - yellow with black text

:)
Title: Re: Clinched Routes Highway Shields
Post by: Quidditch33 on June 15, 2016, 05:01:54 pm
I have no plans to enhance the shield generator, but welcome contributions from anyone who'd like to do so.
Thank you for responding.
Title: Re: Clinched Routes Highway Shields
Post by: si404 on June 15, 2016, 06:45:58 pm
deua - blue with white text
Not a rectangle though - it has the lozenge shape.
(https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Bundesautobahn_1_number.svg/200px-Bundesautobahn_1_number.svg.png)
Title: Re: Clinched Routes Highway Shields
Post by: michih on June 16, 2016, 06:38:59 am
deua - blue with white text
Not a rectangle though - it has the lozenge shape.
(https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Bundesautobahn_1_number.svg/200px-Bundesautobahn_1_number.svg.png)

Ok, but deub is a rectangle (with rounded edges) :)

(https://upload.wikimedia.org/wikipedia/commons/8/80/Bundesstraße_1_number.svg)
Title: Re: Clinched Routes Highway Shields
Post by: SSOWorld on July 07, 2016, 07:26:01 pm
One should be able to splice svgs from Wikimedia Commons by digit for the US national and state routes.  These are public domain as the MUTCD defines them (by proxy to each state) - similar to how old CHM's setup was.
Title: Re: Clinched Routes Highway Shields
Post by: theFXexpert on January 04, 2017, 10:44:00 pm
Made some shields for FL, NY, PA, and SC. https://github.com/TravelMapping/Web/pull/122

There is also a bug where state routes located in a different state have additional text printed with the route number in the shield. https://github.com/TravelMapping/Web/issues/121
Title: Re: Clinched Routes Highway Shields
Post by: theFXexpert on January 06, 2017, 07:39:05 pm
Added KS, MI, MN, MO, NE (doesn't include links/spurs), NV, OH, UT, and WY shields to the pull request.
Title: Re: Clinched Routes Highway Shields
Post by: mapcat on January 06, 2017, 07:59:06 pm
Thanks for doing this!
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 06, 2017, 09:55:15 pm
I'll see if I can get these on the site tonight.  If not, when I get home over the weekend.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 06, 2017, 10:31:58 pm
And they're live.  The ones I checked looked great, thanks!
Title: Re: Clinched Routes Highway Shields
Post by: yakra on January 07, 2017, 12:06:51 am
*that sound Homer Simpson makes when he sees a donut*
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 07, 2017, 12:47:33 pm
I added MA/ME (both states use the same shield): https://github.com/TravelMapping/Web/pull/123

What are people using to minify? I used svgminify.com, but I assume there's some other method. So far I'm just pulling the shields from Wikimedia Commons, changing the number to ***NUMBER***, changing the fonts to 2014, and minifying.
Title: Re: Clinched Routes Highway Shields
Post by: theFXexpert on January 07, 2017, 01:35:56 pm
My process has been to take a commons SVG and open it in Inkscape. Save it as an optimized SVG. Then I use Notepad++ to manually strip any other unnecessary items. I wasn't aware an SVG minifier existed.
I then copy the code to the clinched.php page with Chrome's inspect element tools to check if the numbers looks alright. I usually adjust the font size to an appropriate looking size with Notepad++. It's important to add ' like so: font-family="'Roadgeek 2014 Series D'" otherwise the font won't render.

I was looking at your commits; the changes to shieldgen.php are not necessary since essentially the same code is executed in the default case. I also have an upcoming change to that file that will handle 4-digit shields in a more modular fashion.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 07, 2017, 02:23:57 pm
This is excellent.  Please be sure to keep credits.php up to date with any new sources, which of course need to be ones that permit our project to reuse/derive.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 07, 2017, 02:46:23 pm
This is excellent.  Please be sure to keep credits.php up to date with any new sources, which of course need to be ones that permit our project to reuse/derive.

Should we list the shield templates? Unlike most Wikimedia images, these are licensed public domain since they are MUTCD, so no attribution is necessary.

We may run into trouble on some of the US toll road logos (only on Wikipedia under fair use) and a few random countries (Mexico, Australia). Most of Europe uses some form of text on a solid rectangle, and Commons has some imitation shields for Canada that don't include the copyrighted elements.
Title: Re: Clinched Routes Highway Shields
Post by: theFXexpert on January 07, 2017, 07:45:13 pm
I also have an upcoming change to that file that will handle 4-digit shields in a more modular fashion.
Now submitted -> https://github.com/TravelMapping/Web/pull/124

Also includes HI, NM, OR, and SD shields.
Title: Re: Clinched Routes Highway Shields
Post by: mapcat on January 07, 2017, 08:27:00 pm
How should we handle Tennessee? One design for all routes, or should we develop some additional code to identify routes as always primary, always secondary, and both?
Title: Re: Clinched Routes Highway Shields
Post by: mvak36 on January 07, 2017, 11:52:23 pm
Added KS, MI, MN, MO, NE (doesn't include links/spurs), NV, OH, UT, and WY shields to the pull request.

Thank You for doing that. I like it a lot. ;D
Title: Re: Clinched Routes Highway Shields
Post by: mvak36 on January 07, 2017, 11:59:57 pm
Added KS, MI, MN, MO, NE (doesn't include links/spurs), NV, OH, UT, and WY shields to the pull request.

How about these for the Links and Spurs?
https://en.wikipedia.org/wiki/List_of_Nebraska_Connecting_Link,_Spur,_and_Recreation_Highways#/media/File:N_LINK_Blank.svg
https://en.wikipedia.org/wiki/List_of_Nebraska_Connecting_Link,_Spur,_and_Recreation_Highways#/media/File:N_SPUR_Blank.svg

I got them from https://en.wikipedia.org/wiki/List_of_Nebraska_Connecting_Link,_Spur,_and_Recreation_Highways
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 08, 2017, 04:44:04 am
I tried to figure out how it works. Here's my first shield: https://github.com/TravelMapping/Web/pull/126/commits/b26024db8dcbf5a149bba9dea13fd8fccac30a2f.

1. Downloaded a desired orginal file from wikimedia (https://upload.wikimedia.org/wikipedia/commons/8/80/Bundesstra%C3%9Fe_1_number.svg) (here, German Bundesstraße 1) to your local machine.
2. Upload the file to http://www.svgminify.com/
3. Press "Start"
4. Press "Download resulting SVG"
5. Open "result.svg" on my local machine with a text editor, e.g. Notepad++

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" height="120px" width="200px" version="1.1" viewBox="-100 0 200 120">
<g fill-rule="evenodd">
<rect rx="22.2" ry="22.2" height="120" width="200" y="0" x="-100" fill="#F0CA00"/>
<rect rx="18" ry="18" height="112" width="192" y="4.25" x="-95.8"/>
<rect rx="11" ry="11" height="97.5" width="178" y="11.2" x="-88.8" fill="#F0CA00"/>
<path id="PfadE" d="m-0.069 94.2v-57.2l-9.6 7v-10.3l9.6-6.9h9.7v67.4h-9.7z"/>
</g>
</svg>

6. Figure out (trial and error) the line representing the number to be deleted (deleting lines and preview in web browser by saving and double-clicking of the file or use "Launch in..." feature of Notepad++). The line to be deleted is:

Code: [Select]
<path id="PfadE" d="m-0.069 94.2v-57.2l-9.6 7v-10.3l9.6-6.9h9.7v67.4h-9.7z"/>
7. Add the following lines within <g></g> (fill element must contain the color required for drawing the number):

Code: [Select]
<text letter-spacing="0px" text-anchor="middle" word-spacing="0px" text-align="center" font-size="425px" line-height="125%" y="492.5" x="299.90381" font-family="&apos;Roadgeek 2014 Series D&apos;" fill="#ffffff"><tspan y="492.5" x="299.90381">***NUMBER***</tspan></text>
8. Check file in web browser.

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" height="120px" width="200px" version="1.1" viewBox="-100 0 200 120">
<g fill-rule="evenodd">
<rect rx="22.2" ry="22.2" height="120" width="200" y="0" x="-100" fill="#F0CA00"/>
<rect rx="18" ry="18" height="112" width="192" y="4.25" x="-95.8"/>
<rect rx="11" ry="11" height="97.5" width="178" y="11.2" x="-88.8" fill="#F0CA00"/>
<text letter-spacing="0px" text-anchor="middle" word-spacing="0px" text-align="center" font-size="425px" line-height="125%" y="492.5" x="299.90381" font-family="&apos;Roadgeek 2014 Series D&apos;" fill="#ffffff"><tspan y="492.5" x="299.90381">***NUMBER***</tspan></text>
</g>
</svg>

9. Rename file to "template_deub.svg" (bold = system name)
10. Upload to GitHub web repository "shields" folder
11. Hope and pray because I've no idea if it will work... :)
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 08, 2017, 10:40:19 am
I tried to figure out how it works. Here's my first shield: https://github.com/TravelMapping/Web/pull/126/commits/b26024db8dcbf5a149bba9dea13fd8fccac30a2f.

1. Downloaded a desired orginal file from wikimedia (https://upload.wikimedia.org/wikipedia/commons/8/80/Bundesstra%C3%9Fe_1_number.svg) (here, German Bundesstraße 1) to your local machine.
2. Upload the file to http://www.svgminify.com/
3. Press "Start"
4. Press "Download resulting SVG"
5. Open "result.svg" on my local machine with a text editor, e.g. Notepad++

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" height="120px" width="200px" version="1.1" viewBox="-100 0 200 120">
<g fill-rule="evenodd">
<rect rx="22.2" ry="22.2" height="120" width="200" y="0" x="-100" fill="#F0CA00"/>
<rect rx="18" ry="18" height="112" width="192" y="4.25" x="-95.8"/>
<rect rx="11" ry="11" height="97.5" width="178" y="11.2" x="-88.8" fill="#F0CA00"/>
<path id="PfadE" d="m-0.069 94.2v-57.2l-9.6 7v-10.3l9.6-6.9h9.7v67.4h-9.7z"/>
</g>
</svg>

6. Figure out (trial and error) the line representing the number to be deleted (deleting lines and preview in web browser by saving and double-clicking of the file or use "Launch in..." feature of Notepad++). The line to be deleted is:

Code: [Select]
<path id="PfadE" d="m-0.069 94.2v-57.2l-9.6 7v-10.3l9.6-6.9h9.7v67.4h-9.7z"/>
7. Add the following lines within <g></g> (fill element must contain the color required for drawing the number):

Code: [Select]
<text letter-spacing="0px" text-anchor="middle" word-spacing="0px" text-align="center" font-size="425px" line-height="125%" y="492.5" x="299.90381" font-family="&apos;Roadgeek 2014 Series D&apos;" fill="#ffffff"><tspan y="492.5" x="299.90381">***NUMBER***</tspan></text>
8. Check file in web browser.

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" height="120px" width="200px" version="1.1" viewBox="-100 0 200 120">
<g fill-rule="evenodd">
<rect rx="22.2" ry="22.2" height="120" width="200" y="0" x="-100" fill="#F0CA00"/>
<rect rx="18" ry="18" height="112" width="192" y="4.25" x="-95.8"/>
<rect rx="11" ry="11" height="97.5" width="178" y="11.2" x="-88.8" fill="#F0CA00"/>
<text letter-spacing="0px" text-anchor="middle" word-spacing="0px" text-align="center" font-size="425px" line-height="125%" y="492.5" x="299.90381" font-family="&apos;Roadgeek 2014 Series D&apos;" fill="#ffffff"><tspan y="492.5" x="299.90381">***NUMBER***</tspan></text>
</g>
</svg>

9. Rename file to "template_deub.svg" (bold = system name)
10. Upload to GitHub web repository "shields" folder
11. Hope and pray because I've no idea if it will work... :)

If there's a file marked "template" available, that's what you want to use, such as those in https://commons.wikimedia.org/wiki/Category:Highway_shield_templates. That has the route number not saved as a path already, which makes the process easier.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 08, 2017, 10:42:14 am
The changes in the pull requests submitted recently for shield generation are now live on the site.  I've spot tested and all seems good so far.
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 08, 2017, 12:00:12 pm
The changes in the pull requests submitted recently for shield generation are now live on the site.  I've spot tested and all seems good so far.

'Germany Bundesstraßen' shield doesn't work: http://tm.teresco.org/shields/clinched.php?u=michih&cort=traveled :(
Only B1 to B9 are replaced but w/o number.

I think I've mistaken white and black. fill="#ffffff" --> fill="#000000" (I'll change it) but the number is not visible at all...
Some regions have 2 svg files. What's "_wide"? Are these used for routes with more than 1 digit? How do I have to modify the svg file?
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 08, 2017, 12:08:47 pm
If there's a file marked "template" available, that's what you want to use, such as those in https://commons.wikimedia.org/wiki/Category:Highway_shield_templates. That has the route number not saved as a path already, which makes the process easier.

There is one (> click < (https://commons.wikimedia.org/wiki/File:Bundesstra%C3%9Fennummer_Vorlage.png)) but it's quite old. For instance, the color (yellow) is a little bit different.
Title: Re: Clinched Routes Highway Shields
Post by: theFXexpert on January 08, 2017, 01:40:32 pm
How should we handle Tennessee? One design for all routes, or should we develop some additional code to identify routes as always primary, always secondary, and both?
A good question.
Option 1 would just be to use the primary shield for everything.

Option 2 would be to use both, but would require that:
    A: The shield generator check against a list of route numbers and spit out the appropriate shield(s) This item will probably take the most work.
    B: Support the display of more than one shield in the hb and the clinched.php page. It looks like all that will need to be done would be to simply put the 2nd shield in the same span element and adjust the width on the hb page. What needs to be figured out is how to return two shields at once with php.

Added KS, MI, MN, MO, NE (doesn't include links/spurs), NV, OH, UT, and WY shields to the pull request.

How about these for the Links and Spurs?
https://en.wikipedia.org/wiki/List_of_Nebraska_Connecting_Link,_Spur,_and_Recreation_Highways#/media/File:N_LINK_Blank.svg
https://en.wikipedia.org/wiki/List_of_Nebraska_Connecting_Link,_Spur,_and_Recreation_Highways#/media/File:N_SPUR_Blank.svg

I got them from https://en.wikipedia.org/wiki/List_of_Nebraska_Connecting_Link,_Spur,_and_Recreation_Highways

I knew about the templates, I haven't done them yet since they require extra programming to filter out the prefix and display the appropriate shield. Same with Texas loops and spurs; which also needs to account for NASA 1.

'Germany Bundesstraßen' shield doesn't work: http://tm.teresco.org/shields/clinched.php?u=michih&cort=traveled :(
Only B1 to B9 are replaced but w/o number.

I think I've mistaken white and black. fill="#ffffff" --> fill="#000000" (I'll change it) but the number is not visible at all...
Some regions have 2 svg files. What's "_wide"? Are these used for routes with more than 1 digit? How do I have to modify the svg file?
Check the x, y, and font-size attributes and make sure the numbers are centered on the shield.

The program requires a wide shield for route numbers larger than 2 characters. Otherwise the default is used. In this case, you can just copy the SVG and rename it with "_wide".
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 08, 2017, 02:41:39 pm
CHM had the capability to display multiple shields for the same route, and cycled through them when displayed.  One example:

http://cmap.m-plex.com/hb/hwymap.php?sys=cantch&rg=all&gr=p&r=on.tchott&showint=0&dl=0 (http://cmap.m-plex.com/hb/hwymap.php?sys=cantch&rg=all&gr=p&r=on.tchott&showint=0&dl=0)
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 08, 2017, 03:03:07 pm
Check the x, y, and font-size attributes and make sure the numbers are centered on the shield.
The program requires a wide shield for route numbers larger than 2 characters. Otherwise the default is used. In this case, you can just copy the SVG and rename it with "_wide".

Thanks. My "text line template" had totally difference positions, the text was far away from the shield... I think I got it and have submitted svg and _wide.svg file.

Is it possible to use different fonts? Any limit?
Title: Re: Clinched Routes Highway Shields
Post by: mapcat on January 08, 2017, 04:12:46 pm
CHM had the capability to display multiple shields for the same route, and cycled through them when displayed.  One example:

http://cmap.m-plex.com/hb/hwymap.php?sys=cantch&rg=all&gr=p&r=on.tchott&showint=0&dl=0 (http://cmap.m-plex.com/hb/hwymap.php?sys=cantch&rg=all&gr=p&r=on.tchott&showint=0&dl=0)

Thanks--I forgot about that. I think this would be the nicest solution for Tennessee, although it would require the most work. I'd be willing to put together the list of route attributes (P, S, & P/S) if theFXexpert thinks it's doable.
Title: Re: Clinched Routes Highway Shields
Post by: theFXexpert on January 09, 2017, 07:54:55 pm
Is it possible to use different fonts? Any limit?
The fonts available are listed in the roadgeek.css file -> http://tm.teresco.org/fonts/roadgeek.css

CHM had the capability to display multiple shields for the same route, and cycled through them when displayed.  One example:

http://cmap.m-plex.com/hb/hwymap.php?sys=cantch&rg=all&gr=p&r=on.tchott&showint=0&dl=0 (http://cmap.m-plex.com/hb/hwymap.php?sys=cantch&rg=all&gr=p&r=on.tchott&showint=0&dl=0)

Thanks--I forgot about that. I think this would be the nicest solution for Tennessee, although it would require the most work. I'd be willing to put together the list of route attributes (P, S, & P/S) if theFXexpert thinks it's doable.
CHM uses animated GIF images for multi shield routes which is different from the SVGs that we have been using so far. What I have been thinking so far was to simply display both shields side-by-side at once. To replicate the CHM way, both SVGs will need to be loaded and then change which shield is displayed using javascript. As for how the route list would be incorporated, this is the pseudocode I have in mind for shieldgen.php:
Code: [Select]
switch ( $routeNum ) {
    // Primary routes
    case : 5
    case : 8
    case : 19 // etc...
    usePrimaryShield();
    break;

    // Secondary routes
    case : 234
    case : 138
    case : 493 // etc...
    useSecondaryShield();
    break;

    // Both Primary and Secondary routes
    case : 2
    case : 56
    case : 87 // etc...
    useBothShields();
    break;
}
A limitation with this code would be if a route is discontinuous and uses different shields. Say one segment is only primary while the other is only secondary. It would display both when only one for each respective segment is desired.
Title: Re: Clinched Routes Highway Shields
Post by: mapcat on January 09, 2017, 09:27:48 pm
A limitation with this code would be if a route is discontinuous and uses different shields. Say one segment is only primary while the other is only secondary. It would display both when only one for each respective segment is desired.

That would be the case for TN8 (and possibly others). But wouldn't it also read the root in the process, and be able to differentiate tn008 (primary) from tn008cha (secondary)? At least it shouldn't be difficult to overcome on route pages such as http://tm.teresco.org/hb/?u=mapcat&r=tn.tn008 (http://tm.teresco.org/hb/?u=mapcat&r=tn.tn008), right?
Title: Re: Clinched Routes Highway Shields
Post by: rickmastfan67 on January 10, 2017, 01:24:13 am
Option 2 would be to use both, but would require that:
    A: The shield generator check against a list of route numbers and spit out the appropriate shield(s) This item will probably take the most work.
    B: Support the display of more than one shield in the hb and the clinched.php page. It looks like all that will need to be done would be to simply put the 2nd shield in the same span element and adjust the width on the hb page. What needs to be figured out is how to return two shields at once with php.

I personally would love to see something like 'Option 2B' for states like Pennsylvania and Florida to deal with the special 'toll' highway shields that are used.  PA-43, PA-66, FL-414, FL-528 are just a few examples that use the default 'state' shield, and a special 'toll' shield for different segments, but are all one file here on the site.  We would also need to code in the 'toll' shields to be the default for routes like PA-576, & FL-417 which are solely 'toll' highways.
Title: Re: Clinched Routes Highway Shields
Post by: theFXexpert on January 10, 2017, 10:29:32 am
That would be the case for TN8 (and possibly others). But wouldn't it also read the root in the process, and be able to differentiate tn008 (primary) from tn008cha (secondary)? At least it shouldn't be difficult to overcome on route pages such as http://tm.teresco.org/hb/?u=mapcat&r=tn.tn008 (http://tm.teresco.org/hb/?u=mapcat&r=tn.tn008), right?
Forgive me. I didn't take a closer look before posting. The route pages call a generate function in shieldgen.php to echo the shield. The generate function performs an SQL query that returns all attributes of the route that it's generating for. I assume it includes the abbreviation and that can be used.

Option 2 would be to use both, but would require that:
    A: The shield generator check against a list of route numbers and spit out the appropriate shield(s) This item will probably take the most work.
    B: Support the display of more than one shield in the hb and the clinched.php page. It looks like all that will need to be done would be to simply put the 2nd shield in the same span element and adjust the width on the hb page. What needs to be figured out is how to return two shields at once with php.

I personally would love to see something like 'Option 2B' for states like Pennsylvania and Florida to deal with the special 'toll' highway shields that are used.  PA-43, PA-66, FL-414, FL-528 are just a few examples that use the default 'state' shield, and a special 'toll' shield for different segments, but are all one file here on the site.  We would also need to code in the 'toll' shields to be the default for routes like PA-576, & FL-417 which are solely 'toll' highways.
List items A and B weren't options, just requirements needed to implement option 2. But yes I have been thinking that this would be a good way to implement toll shields too.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 10, 2017, 08:20:13 pm
Recent pull requests are merged and live on the main site.  It looks like some things aren't good.  deua and usadc shields both didn't work.
Title: Re: Clinched Routes Highway Shields
Post by: bejacob on January 10, 2017, 08:49:25 pm
Recent pull requests are merged and live on the main site.  It looks like some things aren't good.  deua and usadc shields both didn't work.

Also eure.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 10, 2017, 09:30:31 pm
It seems to be some sizing problem. I'm still looking at usadc.

usala(1) is also broken but I've figured out what the issue is (it's usala1, not usala)

Edit: seems to be that the viewbox is missing: https://css-tricks.com/scale-svg/
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 10, 2017, 09:44:49 pm
DC and LA fixes are up.
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 11, 2017, 01:46:14 pm
Recent pull requests are merged and live on the main site.  It looks like some things aren't good.  deua and usadc shields both didn't work.

Also eure.

Sorry, I've never made svg files before. Scaling failed because of missing viewbox attributes. Should be fixed with my latest pull request. Dunno why it was automatically in the deub file but not in any other file...

If it works fine, I'll add more European shields soon.

Edit: Ah, rschen7754 had the same problem :)
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 11, 2017, 04:04:09 pm
I've added:

auta
autb
auts
chea
cheh
deua
deub
eure
ltua
ltuk

I still have problems with autb, chea and cheh. The prefix is not removed but I don't understand why.

@Jim: I've added the relevant code to shieldgen.php with my latest pull request. Have you really updated the file?

I've removed some *_wide.svg file, e.g. eure_wide (http://tm.teresco.org/shields/template_eure_wide.svg) because I thought they are no longer necessary (identical with the normal svg file). However, they are still online.

@ALL: It explains why it looked like everything is fine with deua and eure but it should be like it's for chea, cheh or autb. If there're more than 2 digits, the default shield should be used.
I don't know why the normal svg files, e.g. "template_chea.svg", are not loaded. Shieldgen.php looks fine. Is only code from shieldgen.php relevant for selecting the svg files?


@ALL: Could there be any problem if the svg uses "mm" instead of px? https://upload.wikimedia.org/wikipedia/commons/b/b0/Autocesta_A1.svg
"mm" is not yet used in our svg files. I've tried to replace mm by px but it doesn't work (much smaller and text doesn't match). Any idea?
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 11, 2017, 05:40:10 pm
@Jim: I've added the relevant code to shieldgen.php with my latest pull request. Have you really updated the file?

Don't think I had - did it now so the latest should be up.
Title: Re: Clinched Routes Highway Shields
Post by: bejacob on January 11, 2017, 09:17:15 pm
Not sure if everything is fixed, but it appears all the ones I've clinched are good.

Great work by all.  :)
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 12, 2017, 01:51:27 pm
http://tm.teresco.org/shields/clinched.php?u=michih&cort=clinched&reload=true

'Switzerland Autobahnen / Autoroutes' didn't work correct 2 hours ago. For instance, A9 is loaded twice. The first shield displayed "9" text, the second one "A9". Some shields were default. I've enabled "Disable Caching (slows loading) and it works for all chea shields correct now (I've loaded it more than 10 times with disabled caching).

eure was correct 2 hours ago but the text is not displayed anymore since I've disabled caching for the first time. It's no longer working in the HB too.

autb and cheh had partially text only 2 hours ago. But no shield has text now ("traveled only" must be selected). Same in HB.

I have a minor "bug" in shieldgen.php (forgot that some autb routes begin with L) but I cannot see any other problem on my end. No idea what's going on....
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 12, 2017, 03:52:15 pm
I've enabled "Disable Caching (slows loading) and it works for all chea shields correct now.
eure was correct 2 hours ago but the text is not displayed anymore since I've disabled caching for the first time. It's no longer working in the HB too.

I've checked it for 4 other users and it's always the same behavior: Minimum 1 chea shield is not replaced (default bk/wh instead of wh/rd) and some eure texts are displayed. After selecting "disable cache", all chea shields work but no eure text is displayed any more.

It's identical with FF or IE. That means, I "changed" the behavior only once with FF and it's identical when I load it with IE now.

How does the cache work, is the cache on my end or on the site? Do I generally change the behavior by selecting "disable cache" or is it just on my computer? Can anyone reproduce the same behavior?
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 12, 2017, 04:08:24 pm
There is a cache on the site, which I manually clear out each time updated code or svg files come in.  I'll do that again now just to be safe.  It would be nice to add some code that automatically regenerates shields if the PHP code or any svg template has been changed.
Title: Re: Clinched Routes Highway Shields
Post by: Thing342 on January 12, 2017, 05:54:15 pm
As the original author of the shield generator, allow me to provide some clarity:

There is a cache on the site, which I manually clear out each time updated code or svg files come in.  I'll do that again now just to be safe.  It would be nice to add some code that automatically regenerates shields if the PHP code or any svg template has been changed.
The php function used to generate the shield has a force_reload parameter, which regenerates the cached version if set to true. It's used in low-volume applications (i.e. the Highway Browser, where you only need to display one shield)

--

The "easy" (code-wise) way to accomplish systems with alternate / multiple shieldstyles would be to simply create separate systems for the portions using the alternate shields (ie FL Toll routes, TN secondary routes). However, that (and just straight checking against a list of route numbers) would take a large amount of work. My proposed solution for this would involve adding a tags field (allowing OSM-like tags) to each system .csv file and storing it as a new column in the "routes" table in the database. Take usafl.csv, for example:
Code: [Select]
system;region;route;banner;city;abbrev;root;tags;
(tags separated by commas)
...
usafl;FL;FL397;;;;fl.fl397;;
usafl;FL;FL400;;;;fl.fl400;;
usafl;FL;FL401;;;;fl.fl401;;
usafl;FL;FL404;;;;fl.fl404;;
usafl;FL;FL405;;;;fl.fl405;;
usafl;FL;FL406;;;;fl.fl406;;
usafl;FL;FL407;;;;fl.fl407;;
usafl;FL;FL408;;;;fl.fl408;toll=yes;
usafl;FL;FL408;Spr;;;fl.fl408spr;
usafl;FL;FL414;;;;fl.fl414;toll=yes;
usafl;FL;FL415;;;;fl.fl415;;
usafl;FL;FL416;;;;fl.fl416;;
usafl;FL;FL417;;;;fl.fl417;toll=yes;
usafl;FL;FL419;;;;fl.fl419;;
usafl;FL;FL421;;;;fl.fl421;;
usafl;FL;FL423;;;;fl.fl423;;
usafl;FL;FL424;;;;fl.fl424;;
usafl;FL;FL426;;;;fl.fl426;;
usafl;FL;FL429;;;;fl.fl429;toll=yes;
usafl;FL;FL430;;;;fl.fl430;;
usafl;FL;FL434;;;;fl.fl434;;
usafl;FL;FL435;;;;fl.fl435;;
usafl;FL;FL436;;;;fl.fl436;;
usafl;FL;FL437;;;;fl.fl437;;
...
The shield generator would then be able to give the routes marked with "toll=yes" the toll shield. This seems like the most straightforward way and would minimize the amount of duplication needed.

--

The most foolproof method I've found for making shields is:
1. Download shield SVG from Wikimedia commons;
2. Edit shield in inkscape to turn into a template, with ***NUMBER*** in place of the route number;
3. Save as "Optimized SVG" with the name "template_{system name}(_wide, _wide4).svg";
4. Copy to /Web/shields;
5. Wash, rinse, repeat.
Title: Re: Clinched Routes Highway Shields
Post by: yakra on January 12, 2017, 06:06:21 pm
Quote
Can anyone reproduce the same behavior?
It's looking fine on my end. :-\
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 12, 2017, 08:24:57 pm
As the original author of the shield generator, allow me to provide some clarity:

There is a cache on the site, which I manually clear out each time updated code or svg files come in.  I'll do that again now just to be safe.  It would be nice to add some code that automatically regenerates shields if the PHP code or any svg template has been changed.
The php function used to generate the shield has a force_reload parameter, which regenerates the cached version if set to true. It's used in low-volume applications (i.e. the Highway Browser, where you only need to display one shield)

--

The "easy" (code-wise) way to accomplish systems with alternate / multiple shieldstyles would be to simply create separate systems for the portions using the alternate shields (ie FL Toll routes, TN secondary routes). However, that (and just straight checking against a list of route numbers) would take a large amount of work. My proposed solution for this would involve adding a tags field (allowing OSM-like tags) to each system .csv file and storing it as a new column in the "routes" table in the database. Take usafl.csv, for example:
Code: [Select]
system;region;route;banner;city;abbrev;root;tags;
(tags separated by commas)
...
usafl;FL;FL397;;;;fl.fl397;;
usafl;FL;FL400;;;;fl.fl400;;
usafl;FL;FL401;;;;fl.fl401;;
usafl;FL;FL404;;;;fl.fl404;;
usafl;FL;FL405;;;;fl.fl405;;
usafl;FL;FL406;;;;fl.fl406;;
usafl;FL;FL407;;;;fl.fl407;;
usafl;FL;FL408;;;;fl.fl408;toll=yes;
usafl;FL;FL408;Spr;;;fl.fl408spr;
usafl;FL;FL414;;;;fl.fl414;toll=yes;
usafl;FL;FL415;;;;fl.fl415;;
usafl;FL;FL416;;;;fl.fl416;;
usafl;FL;FL417;;;;fl.fl417;toll=yes;
usafl;FL;FL419;;;;fl.fl419;;
usafl;FL;FL421;;;;fl.fl421;;
usafl;FL;FL423;;;;fl.fl423;;
usafl;FL;FL424;;;;fl.fl424;;
usafl;FL;FL426;;;;fl.fl426;;
usafl;FL;FL429;;;;fl.fl429;toll=yes;
usafl;FL;FL430;;;;fl.fl430;;
usafl;FL;FL434;;;;fl.fl434;;
usafl;FL;FL435;;;;fl.fl435;;
usafl;FL;FL436;;;;fl.fl436;;
usafl;FL;FL437;;;;fl.fl437;;
...
The shield generator would then be able to give the routes marked with "toll=yes" the toll shield. This seems like the most straightforward way and would minimize the amount of duplication needed.

--

The most foolproof method I've found for making shields is:
1. Download shield SVG from Wikimedia commons;
2. Edit shield in inkscape to turn into a template, with ***NUMBER*** in place of the route number;
3. Save as "Optimized SVG" with the name "template_{system name}(_wide, _wide4).svg";
4. Copy to /Web/shields;
5. Wash, rinse, repeat.

You have to make sure that the checkbox to leave the viewbox settings is enabled when you save as Optimized SVG, or you will get the sizing issues that I had earlier.
Title: Re: Clinched Routes Highway Shields
Post by: the_spui_ninja on January 15, 2017, 12:19:00 am
This seems like the most straightforward way and would minimize the amount of duplication needed.
Would this also work for the usanes system, as the links have a slightly different shield than the spurs?
Title: Re: Clinched Routes Highway Shields
Post by: yakra on January 16, 2017, 02:40:38 pm
I didn't see any notice here about the usanh shields. Thanks for including them.
ME NH113B (http://tm.teresco.org/hb/index.php?u=yakra&r=me.nh113b) shield looks fine.
ME NH153 (http://tm.teresco.org/hb/index.php?u=yakra&r=me.nh153) looks oogy. :)

In general, are there plans to remove the state abbreviation from "out-of-state" state route segments?
more (http://tm.teresco.org/hb/index.php?u=yakra&r=ct.ny120agre) examples (http://tm.teresco.org/hb/index.php?u=yakra&r=nh.me113cha)
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 16, 2017, 08:59:48 pm
I didn't see any notice here about the usanh shields. Thanks for including them.
ME NH113B (http://tm.teresco.org/hb/index.php?u=yakra&r=me.nh113b) shield looks fine.
ME NH153 (http://tm.teresco.org/hb/index.php?u=yakra&r=me.nh153) looks oogy. :)

In general, are there plans to remove the state abbreviation from "out-of-state" state route segments?
more (http://tm.teresco.org/hb/index.php?u=yakra&r=ct.ny120agre) examples (http://tm.teresco.org/hb/index.php?u=yakra&r=nh.me113cha)

It is noted at https://github.com/TravelMapping/Web/issues/121.
Title: Re: Clinched Routes Highway Shields
Post by: Griffith on January 21, 2017, 03:15:51 pm
I've enabled "Disable Caching (slows loading) and it works for all chea shields correct now.
eure was correct 2 hours ago but the text is not displayed anymore since I've disabled caching for the first time. It's no longer working in the HB too.

I've checked it for 4 other users and it's always the same behavior: Minimum 1 chea shield is not replaced (default bk/wh instead of wh/rd) and some eure texts are displayed. After selecting "disable cache", all chea shields work but no eure text is displayed any more.

It's identical with FF or IE. That means, I "changed" the behavior only once with FF and it's identical when I load it with IE now.

How does the cache work, is the cache on my end or on the site? Do I generally change the behavior by selecting "disable cache" or is it just on my computer? Can anyone reproduce the same behavior?

I have the same issue. I tried FF, Safari and Opera on a variety of devices and on all of them the autb, cheh, and eure shields are blank.
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 21, 2017, 04:22:59 pm
Thanks. It's a generally issue and I cannot fix it. I could remove the svg files so that the numbers are shown again.
Title: Re: Clinched Routes Highway Shields
Post by: theFXexpert on January 21, 2017, 04:59:32 pm
Thanks. It's a generally issue and I cannot fix it. I could remove the svg files so that the numbers are shown again.
Submitted something that will hopefully fix it. https://github.com/TravelMapping/Web/pull/143/commits/b0f8f69f60a851654f745c74845ab5842c1db0a7
The $routeNum variable in the autb, cheh, and eure cases never got the route numbers from the database ($row['route']) and just replaced ***NUMBER*** with an empty string.
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 22, 2017, 03:49:53 am
Thanks. It's a generally issue and I cannot fix it. I could remove the svg files so that the numbers are shown again.
Submitted something that will hopefully fix it. https://github.com/TravelMapping/Web/pull/143/commits/b0f8f69f60a851654f745c74845ab5842c1db0a7
The $routeNum variable in the autb, cheh, and eure cases never got the route numbers from the database ($row['route']) and just replaced ***NUMBER*** with an empty string.

Thanks :) However, it's still the same. autb, cheh and eure don't work. $routeNum works fine for other systems.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 22, 2017, 03:30:37 pm
I think I did not pull down the merged code before installing.  I did that now and I think things are a little better.
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 22, 2017, 03:57:42 pm
Thanks, I think all my shields work now except the 3-digit autb, e.g.: http://tm.teresco.org/hb/?r=aut.b100. What's different to 2-digit B roads? A different (wider) svg file is loaded but the same code is processed.


Edit: I've checked the link of my post and... IT'S WORKING NOW ::)
Edit2: Got it (https://github.com/TravelMapping/Web/commit/0e72d17e95ad715eadc2e42cd4468f800ea9efb5)!


Again, when do I have to use "$routeNum" and "row['route']"?
Title: Re: Clinched Routes Highway Shields
Post by: theFXexpert on January 22, 2017, 05:00:56 pm
Again, when do I have to use "$routeNum" and "row['route']"?
For each case in the switch statement, $row['route'] has to be used or stored in a variable (which is usually $routeNum) at least once. This takes the route number from the database:
$routeNum = $row['route'];

or if letters need to be filtered out:
$routeNum = str_replace("US", "", $row['route']);

Whenever $routeNum is used later in the case block, it will contain the route number without the text. So if there are other characters that need to be filtered you can just use str_replace() on $routeNum from then on.
Title: Re: Clinched Routes Highway Shields
Post by: michih on January 23, 2017, 02:25:41 pm
Shame on me... I should think instead of blind copy-paste... Sorry!
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on February 06, 2017, 12:26:27 am
How should we handle foreign (i.e. non-US) copyright for the shields?

This isn't something we generally have to worry about for most countries, because either the government explicitly releases the shields into public domain, or it's a colored rectangle with text that you can't copyright.

Example: https://en.wikipedia.org/wiki/File:Australian_national_highway_template.svg. The file was created by an American, is hosted on American servers, and under US copyright law cannot be copyrighted since it is too simple (the threshold of originality in the US is very high - see the more complex images at https://commons.wikimedia.org/wiki/Commons:Threshold_of_originality#United_States that are considered public domain). However, Australian copyright law differs and it would be considered copyrighted in Australia.
Title: Re: Clinched Routes Highway Shields
Post by: Duke87 on March 14, 2017, 09:14:49 pm
Firstly, I would think that as a US-based site US law would govern.

Secondly, I would think that the use of a route shield to refer to the route in question would have to fall under fair use even if the design itself is copyrighted (presumably to prevent its use in other contexts, e.g. Route 22 Pizza can't use Route 22 shields on their sign).
Title: Re: Clinched Routes Highway Shields
Post by: oscar on March 14, 2017, 10:48:35 pm
I would think that usually the worst that can possibly happen is a request/demand for us to take down our route marker images.

Countries like North Korea might be another story. Since I think shields are "nice but not necessary" (actually, just from my standpoint, not very important at all), I think we can not bother doing shields for such countries.
Title: Re: Clinched Routes Highway Shields
Post by: the_spui_ninja on March 15, 2017, 12:13:09 am
Countries like North Korea might be another story.
Does North Korea even have a signed highway system?
Title: Re: Clinched Routes Highway Shields
Post by: si404 on March 15, 2017, 07:51:55 am
Does North Korea even have a signed highway system?
It has Asian highways, but otherwise no.
Title: Re: Clinched Routes Highway Shields
Post by: mariethefoxy on July 23, 2017, 11:26:10 pm
Any updates on the shield generation, common systems like the Quebec Autoroutes still use generic shields
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on July 24, 2017, 02:23:40 am
Any updates on the shield generation, common systems like the Quebec Autoroutes still use generic shields

I added a few last week but am still waiting for them to be pushed out (canab, mexd, twnf, cannf).

For Quebec, the SVG template on Wikimedia Commons https://commons.wikimedia.org/wiki/File:Quebec_Autoroute_template.svg is missing the design at the top (see https://commons.wikimedia.org/wiki/File:Quebec_Autoroute_920.svg for an example). I could manually add it (or manually make any shield that's missing a template on Wikimedia Commons), but that would take more time than I have at the present.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on July 24, 2017, 10:04:45 am
I added a few last week but am still waiting for them to be pushed out (canab, mexd, twnf, cannf).

Should be live on site now.  Sorry about the delay.  I saw the pull request at an inconvenient time, then forgot to go back and merge and install.
Title: Re: Clinched Routes Highway Shields
Post by: mapcat on July 24, 2017, 12:05:58 pm
@rschen7754: thanks for all the work you put in on this.

Does Wikimedia Commons not have templates for Arkansas and Puerto Rico, or for the Nebraska links & spurs? Maybe I'm not sure how all the shields on the various Wikipedia pages for those routes were produced, but most of the individual Wikipedia route pages show shields.

Those seem to be the only ones missing from the US at this point.

Also, there's an issue with the Alberta routes showing AB## on the shield instead of just the number.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on July 24, 2017, 02:42:30 pm
@rschen7754: thanks for all the work you put in on this.

Does Wikimedia Commons not have templates for Arkansas and Puerto Rico, or for the Nebraska links & spurs? Maybe I'm not sure how all the shields on the various Wikipedia pages for those routes were produced, but most of the individual Wikipedia route pages show shields.

Those seem to be the only ones missing from the US at this point.

Also, there's an issue with the Alberta routes showing AB## on the shield instead of just the number.

I'll put in a pull request to fix AB soon. I'm hoping to spin up my own test instance to catch stuff like this soon, but haven't gotten the chance yet (and it will probably have to wait until my next hardware upgrade).

Unfortunately it seems that a lot of people don't upload their templates once they are done creating the shields (especially non-US/Canada shields). Looking at my notes PR had no template, and Nebraska links/spurs have a different font size for their suffixed route letters (I think Arkansas was in that category too). "No template" doesn't mean they can't be made, but it would take some extra work (which is possible - I believe that's how michich made some of the European ones). The different font sizes would probably also require some extra PHP knowhow, enough to where I would prefer to be able to test my code first rather than make Jim repeatedly upload it after discovering it doesn't work.
Title: Re: Clinched Routes Highway Shields
Post by: michih on July 24, 2017, 04:20:58 pm
I believe that's how michich made some of the European ones

Yes, wikimedia svg files for Europe are often crap and it was easier to make own svg files. However, European signs are much simpler than US or Canadian signs (usually just a frame and a number).

My files are also sometimes not good though...
Title: Re: Clinched Routes Highway Shields
Post by: Eth on August 15, 2017, 08:38:46 am
[...]and Nebraska links/spurs have a different font size for their suffixed route letters (I think Arkansas was in that category too). [...] The different font sizes would probably also require some extra PHP knowhow, enough to where I would prefer to be able to test my code first rather than make Jim repeatedly upload it after discovering it doesn't work.

This, I assume, would also affect Georgia's state auxiliaries, right? Shields for those currently display simply as their parent route, leading me to do a double-take every time I visit my clinched routes page and see GA 3 on there (though it links correctly to the far, far shorter GA 3 Connector). For what it's worth, the templates on Commons do include the banner text.
Title: Re: Clinched Routes Highway Shields
Post by: the_spui_ninja on August 15, 2017, 07:04:25 pm
Those seem to be the only ones missing from the US at this point.
Guam too, since that's under the US umbrella. I think they have a template already made too: https://commons.wikimedia.org/wiki/File:Guam_route_marker_blank.svg (https://commons.wikimedia.org/wiki/File:Guam_route_marker_blank.svg)
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on August 16, 2017, 02:09:24 pm
[...]and Nebraska links/spurs have a different font size for their suffixed route letters (I think Arkansas was in that category too). [...] The different font sizes would probably also require some extra PHP knowhow, enough to where I would prefer to be able to test my code first rather than make Jim repeatedly upload it after discovering it doesn't work.

This, I assume, would also affect Georgia's state auxiliaries, right? Shields for those currently display simply as their parent route, leading me to do a double-take every time I visit my clinched routes page and see GA 3 on there (though it links correctly to the far, far shorter GA 3 Connector). For what it's worth, the templates on Commons do include the banner text.

I think so. I would prefer to take care of these cases with shields rather than have the incorrect ones (though others may think differently).

Those seem to be the only ones missing from the US at this point.
Guam too, since that's under the US umbrella. I think they have a template already made too: https://commons.wikimedia.org/wiki/File:Guam_route_marker_blank.svg (https://commons.wikimedia.org/wiki/File:Guam_route_marker_blank.svg)

Unfortunately that template is missing the text.

On a related note: I don't have the spreadsheet I was using, but I think we would be able to get shields for cannb if the system was split (see http://tm.teresco.org/forum/index.php?topic=2171.msg7316#msg7316)
Title: Re: Clinched Routes Highway Shields
Post by: yakra on August 16, 2017, 04:34:09 pm
On a related note: I don't have the spreadsheet I was using, but I think we would be able to get shields for cannb if the system was split (see http://tm.teresco.org/forum/index.php?topic=2171.msg7316#msg7316)
Nice. If you are or someone else is thinking of making shields and waiting on me to make the split, I can go ahead and do so.
I'm not familiar with how the shield generation code works, but I've no doubt that 3 systems for 3 shield types would be more easily doable than 3 shield types for 1 system.
Shall I go ahead and make the split?
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on August 17, 2017, 10:00:13 pm
On a related note: I don't have the spreadsheet I was using, but I think we would be able to get shields for cannb if the system was split (see http://tm.teresco.org/forum/index.php?topic=2171.msg7316#msg7316)
Nice. If you are or someone else is thinking of making shields and waiting on me to make the split, I can go ahead and do so.
I'm not familiar with how the shield generation code works, but I've no doubt that 3 systems for 3 shield types would be more easily doable than 3 shield types for 1 system.
Shall I go ahead and make the split?

You can go ahead, but there's no rush at least on my end - it might be a while before I get to it.
Title: Re: Clinched Routes Highway Shields
Post by: rickmastfan67 on August 18, 2017, 04:50:14 am
Hope there's a way for us to figure out in future to show 2 shields for FL routes that have both 'toll' and non-toll segments since I'm getting really close to finishing the set and to send it to preview mode. :)
Title: Re: Clinched Routes Highway Shields
Post by: Bickendan on August 20, 2017, 04:38:23 am
Hope there's a way for us to figure out in future to show 2 shields for FL routes that have both 'toll' and non-toll segments since I'm getting really close to finishing the set and to send it to preview mode. :)
This would be very useful for the Oregon Highways set I'm going to be drafting soon.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on August 20, 2017, 01:34:55 pm
Hope there's a way for us to figure out in future to show 2 shields for FL routes that have both 'toll' and non-toll segments since I'm getting really close to finishing the set and to send it to preview mode. :)
This would be very useful for the Oregon Highways set I'm going to be drafting soon.

There are other systems where this would be needed, such as the aforementioned usapr, and some of the UK/Ireland routes where some parts are motorways and some are not.
Title: Re: Clinched Routes Highway Shields
Post by: si404 on August 20, 2017, 01:53:45 pm
some of the UK/Ireland routes where some parts are motorways and some are not.
Those have been two separate systems since before I took over (I split the Ax(M) routes from the M routes in GB & NI).

However, A roads (ignoring Ax(M)s) can be signed with black text on white (non-primary) or yellow text on green (primary). All Jersey's are primary, but elsewhere many are entirely primary, many are entirely non primary and many have parts that are primary and parts that are non-primary.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on August 20, 2017, 04:01:46 pm
Just put in a pull request for usaar (currently part of usansf) and mtqn (the same as fran). Some others might come later this week.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on August 20, 2017, 05:22:46 pm
Just put in a pull request for usaar (currently part of usansf) and mtqn (the same as fran). Some others might come later this week.

These are live on the main site.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on August 20, 2017, 05:26:08 pm
Arkansas ones are showing as "000A".
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on August 20, 2017, 05:36:21 pm
Arkansas ones are showing as "000A".

I think this last pull request should do the trick. Probably time to set up my dev instance to catch these errors...
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on August 22, 2017, 02:17:08 pm
usaar is fixed, and canqca is now live.
Title: Re: Clinched Routes Highway Shields
Post by: mapcat on August 22, 2017, 07:10:09 pm
The AR numbers are offset slightly (on AR 151, at least), and the 3-digit canqca numbers aren't all the same size: 1, 4, 5, 6, and 7 are slightly taller than 0, 2, 3, and 9.

Edit: at zooms less than 100% or greater than 175% on Chrome, the autoroute numbers are fine.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on August 22, 2017, 08:21:25 pm
The AR numbers are offset slightly (on AR 151, at least), and the 3-digit canqca numbers aren't all the same size: 1, 4, 5, 6, and 7 are slightly taller than 0, 2, 3, and 9.

Edit: at zooms less than 100% or greater than 175% on Chrome, the autoroute numbers are fine.

I looked at https://commons.wikimedia.org/wiki/Category:Diagrams_of_Arkansas_State_Highway_shields and it seems that there's different font sizes used depending on what digits are in the route number. It will take some more work to fix that, unfortunately.
Title: Re: Clinched Routes Highway Shields
Post by: mariethefoxy on August 22, 2017, 11:59:32 pm
theres an error on the routes NH 101 and NH 111, the word NH is being spelled out with the numbers
Title: Re: Clinched Routes Highway Shields
Post by: yakra on August 23, 2017, 12:52:09 am
theres an error on the routes NH 101 and NH 111, the word NH is being spelled out with the numbers
A consistent glitch across the entire usanh system:
All non-letter-suffixed routes are spelled out, with the "NH".
Letter-suffixed route shields look fine.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on August 23, 2017, 01:29:35 am
theres an error on the routes NH 101 and NH 111, the word NH is being spelled out with the numbers
A consistent glitch across the entire usanh system:
All non-letter-suffixed routes are spelled out, with the "NH".
Letter-suffixed route shields look fine.

Just put in a pull request to fix this and usatx, and add the first New Brunswick shield.

For the New Brunswick shields, the font is a bit off, but the Commons shields use a non-free font.
Title: Re: Clinched Routes Highway Shields
Post by: yakra on August 23, 2017, 01:31:59 am
Excellent! Thanks for all your work on this.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on August 27, 2017, 01:59:08 am
Excellent! Thanks for all your work on this.

Thanks for putting up with my coding errors.  :)

Anyway, the other New Brunswick shields were added, as were nclt and usanes (last one still in a pull request).

126/186 shields for active systems have been created - 67.74%.
Title: Re: Clinched Routes Highway Shields
Post by: yakra on January 25, 2018, 01:27:46 am
What can you do with this (see attachment)?
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 25, 2018, 01:42:52 am
What can you do with this (see attachment)?

The main issue with canmb was the superscripted letters, which I'm not sure how to handle.

However, recently my colleague at Wikimedia Commons made shields for cannl and mexed, so hopefully those can be added soon.
Title: Re: Clinched Routes Highway Shields
Post by: yakra on January 25, 2018, 01:46:44 am
Quote
The main issue with canmb was the superscripted letters, which I'm not sure how to handle.
If we just say fudge-it-this-is-better-than-nothing and include regular letters, is that doable?
(I just downloaded inkscape an hour ago and am wicked excited.)
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 25, 2018, 02:13:46 am
It is, and there are a few others in that category (PEI for example). Or we could just estimate.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 28, 2018, 02:57:18 am
Added a pull request for cannl, usaush, and mexed.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 28, 2018, 08:51:38 am
Added a pull request for cannl, usaush, and mexed.

These are live on the tmtest site.  If after some testing all looks good, let me know and I'll install on the production site.
Title: Re: Clinched Routes Highway Shields
Post by: mapcat on January 28, 2018, 10:18:23 am
Shouldn't the usaush shields be more like this?

http://www.teresco.org/pics/toabq-20040122-25/24/P1240005.jpg (http://www.teresco.org/pics/toabq-20040122-25/24/P1240005.jpg)
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 28, 2018, 12:39:56 pm
Shouldn't the usaush shields be more like this?

http://www.teresco.org/pics/toabq-20040122-25/24/P1240005.jpg (http://www.teresco.org/pics/toabq-20040122-25/24/P1240005.jpg)

I guess it depends on whether we want to go with the period shields or the modern-day historic ones.
Title: Re: Clinched Routes Highway Shields
Post by: yakra on January 28, 2018, 01:14:39 pm
I'd vote for modern-day historic.
Title: Re: Clinched Routes Highway Shields
Post by: mapcat on January 28, 2018, 02:14:49 pm
I guess it depends on whether we want to go with the period shields or the modern-day historic ones.

Shields for other systems typically match the posted shields. This system is made up of routes currently posted with a distinctive brown shield (with some minor variations by state); it's not all routes that once had US route shields.
Title: Re: Clinched Routes Highway Shields
Post by: Jim on January 28, 2018, 02:33:03 pm
I'd definitely like to see the current brown historic signage if we can make it happen.
Title: Re: Clinched Routes Highway Shields
Post by: si404 on January 28, 2018, 03:42:40 pm
Shields for other systems typically match the posted shields. This system is made up of routes currently posted with a distinctive brown shield (with some minor variations by state); it's not all routes that once had US route shields.
This.

Though the old US Highway signs are very nicely done, that's not what the system is.
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on January 28, 2018, 04:46:49 pm
I'd definitely like to see the current brown historic signage if we can make it happen.

I'll see what I can do, but it probably won't be until the next batch. I don't think we can match the font exactly though.
Title: Re: Clinched Routes Highway Shields
Post by: yakra on January 31, 2018, 05:03:33 pm
Just thinking out loud here; I haven't looked into the ShieldGen code, as I don't grok the language it's written in, and thus don't understand, in detail, what makes it tick. It's possible that I'm missing something important.

The main issue with canmb was the superscripted letters, which I'm not sure how to handle.
If we just say fudge-it-this-is-better-than-nothing and include regular letters, is that doable?
It is, and there are a few others in that category (PEI for example). Or we could just estimate.
PEI GMSV examples: 17A (https://www.google.com/maps/@46.0574034,-62.5218872,3a,15y,20.9h,85.25t/data=!3m9!1e1!3m7!1sIHS3YJeVbrgLNvLCln7VOw!2e0!7i13312!8i6656!9m2!1b1!2i41), 18A (https://www.google.com/maps/@45.9792809,-62.5250358,3a,18y,4.88h,84.27t/data=!3m9!1e1!3m7!1sQW73CnWP_VtgI9BG6lYY6w!2e0!7i13312!8i6656!9m2!1b1!2i41), and 19A (https://www.google.com/maps/@46.1549469,-63.2950823,3a,15y,78.34h,84.14t/data=!3m9!1e1!3m7!1sjzhLGurtm9ai7Tplc1zS1g!2e0!7i13312!8i6656!9m2!1b1!2i41) (which uses a smaller font size 'A' than the first two examples)
I take "that category" to mean using letters in a smaller font size, thus complicating sizing & positioning of the text, and not necessarily superscript specifically.
usane has a similar route, NE25A (https://www.google.com/maps/@40.3933813,-101.0322297,3a,16.4y,36.68h,88.01t/data=!3m6!1e1!3m4!1sm36daFGXmIor2Q8vSp64ww!2e0!7i13312!8i6656), which is handled in the HB (http://tm.teresco.org/hb/index.php?r=ne.ne025a) like a normal 3dNE (http://tm.teresco.org/hb/index.php?r=ne.ne109) (Compare vanilla NE25 (http://tm.teresco.org/hb/index.php?r=ne.ne025)).
(To be clear, I'm perfectly fine with the way NE25A is handled in the HB; I'm just mentioning that here for completeness & comparison's sake.)

For how to handle these cases, the best comparison I can think of is usanh.
Like many other systems, ShieldGen already has to check whether a route is a 1d/2dNH (http://tm.teresco.org/hb/index.php?r=nh.nh009) or 3dNH (http://tm.teresco.org/hb/index.php?r=nh.nh109) to get the sizing & positioning of the text right. But it also has to check whether a route has a letter (http://tm.teresco.org/hb/index.php?r=nh.nh009a) suffix (http://tm.teresco.org/hb/index.php?r=nh.nh109a), in which case the text is handled differently.
From viewing the source in the HB, it looks like this is done via two <text> tags, each with different x= & y= variables in the <tspan> tag.
This should be adaptable to canpe & canmb... or is there more to it?
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on February 01, 2018, 02:27:25 pm
For how to handle these cases, the best comparison I can think of is usanh.
Like many other systems, ShieldGen already has to check whether a route is a 1d/2dNH (http://tm.teresco.org/hb/index.php?r=nh.nh009) or 3dNH (http://tm.teresco.org/hb/index.php?r=nh.nh109) to get the sizing & positioning of the text right. But it also has to check whether a route has a letter (http://tm.teresco.org/hb/index.php?r=nh.nh009a) suffix (http://tm.teresco.org/hb/index.php?r=nh.nh109a), in which case the text is handled differently.
From viewing the source in the HB, it looks like this is done via two <text> tags, each with different x= & y= variables in the <tspan> tag.
This should be adaptable to canpe & canmb... or is there more to it?

The problem is that the SVG template doesn't have a space for the letter. That doesn't mean that someone couldn't estimate where it is and add it.

I generally prioritize shields where I don't have to do that sort of thing. Sometimes I am able to come back to more complex cases as my SVG/shield skills improve. I'm hoping to get more Nova Scotia shields done soon since those were added to Commons recently.
Title: Re: Clinched Routes Highway Shields
Post by: yakra on February 02, 2018, 12:33:18 am
Quote
That doesn't mean that someone couldn't estimate where it is and add it.
Willing to take a stab at it. A lot of learning to do, though. I just figured out "resize page to content" in Inkscape...
Title: Re: Clinched Routes Highway Shields
Post by: rschen7754 on February 02, 2018, 01:30:47 am
I would recommend starting with what Commons already has and working off that. For the letters, it may help to pull up an existing shield and estimate where the letter field would go from that.
Title: Re: Clinched Routes Highway Shields
Post by: yakra on February 02, 2018, 03:11:53 pm
Commons uses an older style, without the bison graphic. Based off this one example (https://www.google.com/maps/@50.145851,-96.8743299,3a,15.4y,173.19h,96.85t/data=!3m9!1e1!3m7!1slX2sjSnMwQZOqb1VYtQRFw!2e0!7i13312!8i6656!9m2!1b1!2i41), the text may be centered a bit differently too. I may just have to eyeball it.
I'm interested in doing this, yes, but it's a low priority. Got a few things on my plate. :)
Title: Re: Clinched Routes Highway Shields
Post by: yakra on February 03, 2018, 03:07:23 pm
Riscussion re Manitoba Provincial Roads shields split and merged into the Manitoba Provincial Roads thread.
http://tm.teresco.org/forum/index.php?topic=2344.msg8872#msg8872
Title: Re: Clinched Routes Highway Shields
Post by: yakra on February 04, 2018, 11:26:05 am
State abbreviations in out-of-state route segments:

tm.teresco.org/hb/?r=pa.ny017swa
tm.teresco.org/hb/?r=ct.ny120agre

tm.teresco.org/hb/?r=nh.me113cha
tm.teresco.org/hb/?r=nh.me113con
Title: Re: Clinched Routes Highway Shields
Post by: Eth on February 07, 2018, 05:26:25 pm
State abbreviations in out-of-state route segments:

tm.teresco.org/hb/?r=pa.ny017swa
tm.teresco.org/hb/?r=ct.ny120agre

tm.teresco.org/hb/?r=nh.me113cha
tm.teresco.org/hb/?r=nh.me113con

See also http://tm.teresco.org/hb/?r=ga.tn068.