You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
4.8 KiB

  1. <?php
  2. use Illuminate\Database\Seeder;
  3. class TransitLineSeeder extends Seeder
  4. {
  5. /**
  6. * Run the database seeds.
  7. *
  8. * @return void
  9. */
  10. public function run()
  11. {
  12. // From https://trimet.org/ride/stop_select_form.html
  13. $html = '<select id="route" name="route" class="field-input field-select-input input-select">
  14. <option value="100">MAX Blue Line</option>
  15. <option value="200">MAX Green Line</option>
  16. <option value="290">MAX Orange Line</option>
  17. <option value="90">MAX Red Line</option>
  18. <option value="190">MAX Yellow Line</option>
  19. <option value="203">WES Commuter Rail</option>
  20. <option value="193">Portland Streetcar - NS Line</option>
  21. <option value="194">Portland Streetcar - A Loop</option>
  22. <option value="195">Portland Streetcar - B Loop</option>
  23. <option value="208">Portland Aerial Tram</option>
  24. <option value="1">1-Vermont</option>
  25. <option value="4">4-Division/Fessenden</option>
  26. <option value="6">6-Martin Luther King Jr Blvd</option>
  27. <option value="8">8-Jackson Park/NE 15th</option>
  28. <option value="9">9-Powell Blvd</option>
  29. <option value="10">10-Harold St</option>
  30. <option value="11">11-Rivergate/Marine Dr</option>
  31. <option value="12">12-Barbur/Sandy Blvd</option>
  32. <option value="14">14-Hawthorne</option>
  33. <option value="15">15-Belmont/NW 23rd</option>
  34. <option value="16">16-Front Ave/St Helens Rd</option>
  35. <option value="17">17-Holgate/Broadway</option>
  36. <option value="18">18-Hillside</option>
  37. <option value="19">19-Woodstock/Glisan</option>
  38. <option value="20">20-Burnside/Stark</option>
  39. <option value="21">21-Sandy Blvd/223rd</option>
  40. <option value="22">22-Parkrose</option>
  41. <option value="23">23-San Rafael</option>
  42. <option value="24">24-Fremont</option>
  43. <option value="25">25-Glisan/Rockwood</option>
  44. <option value="29">29-Lake/Webster Rd</option>
  45. <option value="30">30-Estacada</option>
  46. <option value="32">32-Oatfield</option>
  47. <option value="33">33-McLoughlin/King Rd</option>
  48. <option value="34">34-Linwood/River Rd</option>
  49. <option value="35">35-Macadam/Greeley</option>
  50. <option value="36">36-South Shore</option>
  51. <option value="37">37-Lake Grove</option>
  52. <option value="38">38-Boones Ferry Rd</option>
  53. <option value="39">39-Lewis &amp; Clark</option>
  54. <option value="43">43-Taylors Ferry Rd</option>
  55. <option value="44">44-Capitol Hwy/Mocks Crest</option>
  56. <option value="45">45-Garden Home</option>
  57. <option value="46">46-North Hillsboro</option>
  58. <option value="47">47-Baseline/Evergreen</option>
  59. <option value="48">48-Cornell</option>
  60. <option value="50">50-Cedar Mill</option>
  61. <option value="51">51-Vista</option>
  62. <option value="52">52-Farmington/185th</option>
  63. <option value="53">53-Arctic/Allen</option>
  64. <option value="54">54-Beaverton-Hillsdale Hwy</option>
  65. <option value="55">55-Hamilton</option>
  66. <option value="56">56-Scholls Ferry Rd</option>
  67. <option value="57">57-TV Hwy/Forest Grove</option>
  68. <option value="58">58-Canyon Rd</option>
  69. <option value="59">59-Walker/Park Way</option>
  70. <option value="61">61-Marquam Hill/Beaverton</option>
  71. <option value="62">62-Murray Blvd</option>
  72. <option value="63">63-Washington Park/Arlington Hts</option>
  73. <option value="64">64-Marquam Hill/Tigard</option>
  74. <option value="65">65-Marquam Hill/Barbur Blvd</option>
  75. <option value="66">66-Marquam Hill/Hollywood</option>
  76. <option value="67">67-Bethany/158th</option>
  77. <option value="68">68-Marquam Hill/Collins Circle</option>
  78. <option value="70">70-12th/NE 33rd Ave</option>
  79. <option value="71">71-60th Ave</option>
  80. <option value="72">72-Killingsworth/82nd Ave</option>
  81. <option value="73">73-122nd Ave</option>
  82. <option value="75">75-Cesar Chavez/Lombard</option>
  83. <option value="76">76-Beaverton/Tualatin</option>
  84. <option value="77">77-Broadway/Halsey</option>
  85. <option value="78">78-Beaverton/Lake Oswego</option>
  86. <option value="79">79-Clackamas/Oregon City</option>
  87. <option value="80">80-Kane/Troutdale Rd</option>
  88. <option value="81">81-Kane/257th</option>
  89. <option value="84">84-Powell Valley/Orient Dr</option>
  90. <option value="85">85-Swan Island</option>
  91. <option value="87">87-Airport Way/181st</option>
  92. <option value="88">88-Hart/198th</option>
  93. <option value="92">92-South Beaverton Express</option>
  94. <option value="93">93-Tigard/Sherwood</option>
  95. <option value="94">94-Pacific Hwy/Sherwood</option>
  96. <option value="96">96-Tualatin/I-5</option>
  97. <option value="97">97-Tualatin-Sherwood Rd</option>
  98. <option value="99">99-Macadam/McLoughlin</option>
  99. <option value="152">152-Milwaukie</option>
  100. <option value="154">154-Willamette/Clackamas Heights</option>
  101. <option value="155">155-Sunnyside</option>
  102. <option value="156">156-Mather Rd</option>
  103. <option value="291">291-Orange Night Bus</option>
  104. </select>';
  105. if(preg_match_all('/"(\d+)">(.+)</', $html, $matches)) {
  106. foreach($matches[2] as $i=>$line) {
  107. $id = $matches[1][$i];
  108. DB::table('transit_lines')->insert(['id' => $id, 'name' => $line, 'sort' => $i]);
  109. }
  110. }
  111. }
  112. }