From 1ce93f9521e3104b50f4b7a1151f8c10f7876bd9 Mon Sep 17 00:00:00 2001 From: cockroachking Date: Tue, 1 Sep 2026 23:20:55 -0400 Subject: [PATCH] Shields Batch 54 --- shields/arc/shield_co.nwpkwy.svg | 9 ++ shields/shieldData_usavt.csv | 116 ++++++++++++++++++ shields/shield_co.nwpkwy.svg | 39 ++++-- ...eld_ny.fdroodr.svg => shield_ny.fdrdr.svg} | 0 shields/shield_phl.cclex.svg | 25 ++-- shields/shield_vt.vt008a.svg | 39 ++++++ shields/shieldgen.php | 34 ++++- shields/template_cypa.svg | 2 +- shields/template_stpen.svg | 10 ++ 9 files changed, 246 insertions(+), 28 deletions(-) create mode 100644 shields/arc/shield_co.nwpkwy.svg create mode 100644 shields/shieldData_usavt.csv rename shields/{shield_ny.fdroodr.svg => shield_ny.fdrdr.svg} (100%) create mode 100644 shields/shield_vt.vt008a.svg create mode 100644 shields/template_stpen.svg diff --git a/shields/arc/shield_co.nwpkwy.svg b/shields/arc/shield_co.nwpkwy.svg new file mode 100644 index 00000000..c8bd9580 --- /dev/null +++ b/shields/arc/shield_co.nwpkwy.svg @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/shields/shieldData_usavt.csv b/shields/shieldData_usavt.csv new file mode 100644 index 00000000..d89f81d9 --- /dev/null +++ b/shields/shieldData_usavt.csv @@ -0,0 +1,116 @@ +region,route,root,shieldClass +VT,VT2A,vt.vt002a,State +VT,VT2B,vt.vt002b,State +VT,VT3,vt.vt003,State +VT,VT4A,vt.vt004a,State +VT,VT5A,vt.vt005a,State +VT,VT7A,vt.vt007a,State +VT,VT7BWal,vt.vt007bwal,State +VT,VT7BCla,vt.vt007bcla,State +VT,VT8,vt.vt008,State +VT,VT8A,vt.vt008a,Town +VT,VT9,vt.vt009,State +VT,VT9TrkBra,vt.vt009trkbra,State +VT,VT10,vt.vt010,State +VT,VT10A,vt.vt010a,State +VT,VT11,vt.vt011,State +VT,VT12,vt.vt012,State +VT,VT12A,vt.vt012a,State +VT,VT14,vt.vt014,State +VT,VT15,vt.vt015,State +VT,VT15A,vt.vt015a,State +VT,VT16,vt.vt016,Both +VT,VT17,vt.vt017,State +VT,VT18,vt.vt018,State +VT,VT22A,vt.vt022a,State +VT,VT23,vt.vt023,Town +VT,VT25,vt.vt025,State +VT,VT25A,vt.vt025a,State +VT,VT25B,vt.vt025b,State +VT,VT26,vt.vt026,State +VT,VT30,vt.vt030,State +VT,VT31,vt.vt031,State +VT,VT35,vt.vt035,Town +VT,VT36,vt.vt036,Both +VT,VT38,vt.vt038,State +VT,VT44,vt.vt044,Both +VT,VT44A,vt.vt044a,State +VT,VT53,vt.vt053,Town +VT,VT58,vt.vt058,Both +VT,VT62,vt.vt062,State +VT,VT63,vt.vt063,State +VT,VT64,vt.vt064,State +VT,VT65,vt.vt065,State +VT,VT66,vt.vt066,State +VT,VT67,vt.vt067,State +VT,VT67A,vt.vt067a,State +VT,VT73,vt.vt073,Both +VT,VT74,vt.vt074,State +VT,VT78,vt.vt078,State +VT,VT100,vt.vt100,State +VT,VT100AltMor,vt.vt100altmor,State +VT,VT100A,vt.vt100a,State +VT,VT100B,vt.vt100b,State +VT,VT100C,vt.vt100c,State +VT,VT101,vt.vt101,State +VT,VT102,vt.vt102,State +VT,VT103,vt.vt103,State +VT,VT104,vt.vt104,State +VT,VT104A,vt.vt104a,State +VT,VT105,vt.vt105,State +VT,VT105TrkNew,vt.vt105trknew,State +VT,VT105A,vt.vt105a,State +VT,VT106,vt.vt106,State +VT,VT107,vt.vt107,State +VT,VT108,vt.vt108,State +VT,VT109,vt.vt109,State +VT,VT110,vt.vt110,State +VT,VT111,vt.vt111,State +VT,VT112,vt.vt112,State +VT,VT113,vt.vt113,State +VT,VT114,vt.vt114,State +VT,VT116,vt.vt116,State +VT,VT117,vt.vt117,Both +VT,VT118,vt.vt118,Both +VT,VT119,vt.vt119,State +VT,VT120,vt.vt120,State +VT,VT121,vt.vt121,Town +VT,VT122,vt.vt122,State +VT,VT122AltLyn,vt.vt122altlyn,State +VT,VT123,vt.vt123,State +VT,VT125,vt.vt125,State +VT,VT127,vt.vt127,Town +VT,VT128,vt.vt128,State +VT,VT129,vt.vt129,Both +VT,VT131,vt.vt131,State +VT,VT132,vt.vt132,Both +VT,VT133,vt.vt133,State +VT,VT139,vt.vt139,Town +VT,VT140,vt.vt140,Both +VT,VT141,vt.vt141,State +VT,VT142,vt.vt142,State +VT,VT143,vt.vt143,Town +VT,VT144,vt.vt144,Town +VT,VT147,vt.vt147,State +VT,VT149,vt.vt149,State +VT,VT153,vt.vt153,Town +VT,VT155,vt.vt155,State +VT,VT191,vt.vt191,State +VT,VT207,vt.vt207,Both +VT,VT214,vt.vt214,State +VT,VT215,vt.vt215,Town +VT,VT225,vt.vt225,Town +VT,VT232,vt.vt232,State +VT,VT235,vt.vt235,Town +VT,VT236,vt.vt236,State +VT,VT242,vt.vt242,State +VT,VT243,vt.vt243,State +VT,VT244,vt.vt244,State +VT,VT253,vt.vt253,State +VT,VT279,vt.vt279,State +VT,VT289,vt.vt289,State +VT,VT313,vt.vt313,State +VT,VT314,vt.vt314,State +VT,VT315,vt.vt315,Town +VT,VT346,vt.vt346,State +VT,VTF5,vt.vtf5,State diff --git a/shields/shield_co.nwpkwy.svg b/shields/shield_co.nwpkwy.svg index c8bd9580..2307d262 100644 --- a/shields/shield_co.nwpkwy.svg +++ b/shields/shield_co.nwpkwy.svg @@ -1,9 +1,32 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shields/shield_ny.fdroodr.svg b/shields/shield_ny.fdrdr.svg similarity index 100% rename from shields/shield_ny.fdroodr.svg rename to shields/shield_ny.fdrdr.svg diff --git a/shields/shield_phl.cclex.svg b/shields/shield_phl.cclex.svg index 6a1465aa..c7966616 100644 --- a/shields/shield_phl.cclex.svg +++ b/shields/shield_phl.cclex.svg @@ -55,54 +55,49 @@ stroke-width="14.88" id="rect4" /> - - - - + \ No newline at end of file diff --git a/shields/shield_vt.vt008a.svg b/shields/shield_vt.vt008a.svg new file mode 100644 index 00000000..2bf45d21 --- /dev/null +++ b/shields/shield_vt.vt008a.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/shields/shieldgen.php b/shields/shieldgen.php index f4a65aee..c146f140 100644 --- a/shields/shieldgen.php +++ b/shields/shieldgen.php @@ -902,6 +902,7 @@ function tm_shield_generate($r, $force_reload = false) { case 'prtvr': case 'rksr': case 'srba': + case 'stpen': case 'svna': case 'svnh': case 'ukrm': @@ -1946,11 +1947,36 @@ function tm_shield_generate($r, $force_reload = false) { case 'usavt': // Vermont $matches = []; $routeNum = str_replace("VT", "", $row['route']); - if (strlen($routeNum) > 3) { - $svg = file_get_contents("{$dir}/template_usavt_wide4.svg"); + $shieldClass = null; + $csv = array_map(fn($line) => str_getcsv($line, escape: ""), file("{$dir}/shieldData_" . $row['systemName'] . ".csv")); + foreach ($csv as $values) { + if ($values[2] == $r) { + $shieldClass = $values[3]; + } + } + if ($shieldClass == "Town") { + if (strlen($routeNum) > 2) { + $svg = file_get_contents("{$dir}/template_usaky_wide.svg"); + } + else { + $svg = file_get_contents("{$dir}/template_usaky.svg"); + } } - elseif (strlen($routeNum) > 2) { - $svg = file_get_contents("{$dir}/template_usavt_wide.svg"); + elseif ($shieldClass == "Both") { + if (strlen($routeNum) > 2) { + $svg = file_get_contents("{$dir}/template_usavt_wide.svg"); + } + else { + $svg = file_get_contents("{$dir}/template_usavt.svg"); + } + } + else { + if (strlen($routeNum) > 3) { + $svg = file_get_contents("{$dir}/template_usavt_wide4.svg"); + } + elseif (strlen($routeNum) > 2) { + $svg = file_get_contents("{$dir}/template_usavt_wide.svg"); + } } if (preg_match('/(?[0-9]+)(?[A-Za-z]+)/', $routeNum, $matches)) { $svg = str_replace("***NUMBER***", $matches['number'], $svg); diff --git a/shields/template_cypa.svg b/shields/template_cypa.svg index 91208134..c6e2ce32 100644 --- a/shields/template_cypa.svg +++ b/shields/template_cypa.svg @@ -1,2 +1,2 @@ -Asset 8 +Asset 8 ***NUMBER*** \ No newline at end of file diff --git a/shields/template_stpen.svg b/shields/template_stpen.svg new file mode 100644 index 00000000..42331edb --- /dev/null +++ b/shields/template_stpen.svg @@ -0,0 +1,10 @@ + + + + + + + ***NUMBER*** + + +