open-trip-planner.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!DOCTYPE html>
  2. <html lang="en-us">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="generator" content="Hugo 0.92.0" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="/assets/css/theme.css">
  8. <link rel="alternate" href="/rss.xml" type="application/rss+xml" title="Pleasant Programmer">
  9. <script type="text/javascript" src="//use.typekit.net/iwm5axp.js"></script>
  10. <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
  11. <title>Open Trip Planner - Pleasant Programmer</title>
  12. </head>
  13. <body>
  14. <header id="header" role="banner">
  15. <div id="thomas">
  16. <img src="/assets/img/thomas.gif" alt="DJ THOMAS IN DA HAUS">
  17. <img src="/assets/img/thomas.png" alt="Pleasant Programmer">
  18. </div>
  19. <h1 class="site-title"><a href="/">Pleasant Programmer</a></h1>
  20. <nav id="menu" role="navigation">
  21. <ul>
  22. <li><a href="/pages/projects.html">projects</a></li>
  23. <li><a href="/posts.html">archives</a></li>
  24. <li><a href="/tags.html">tags</a></li>
  25. <li><a href="/rss.xml">rss</a></li>
  26. </ul>
  27. </nav>
  28. </header>
  29. <div id="container">
  30. <main id="content" role="main">
  31. <article itemscope itemtype="http://schema.org/BlogPosting">
  32. <h1 class="p-name entry-title" itemprop="headline name">
  33. <a href="/posts/open-trip-planner.html">Open Trip Planner</a></h1>
  34. <small>
  35. <span class="dateline">Posted: <time itemprop="datePublished" datetime="2013-07-09">2013-07-09</time></span>
  36. | More posts about
  37. <a class="tag p-category" href="/tags/philippine-transit-app.html" rel="tag">
  38. philippine-transit-app
  39. </a>
  40. <a class="tag p-category" href="/tags/programming.html" rel="tag">
  41. programming
  42. </a>
  43. </small>
  44. <div class="e-content entry-content" itemprop="entry-text">
  45. <p>Link: <a href="http://www.opentripplanner.org">http://www.opentripplanner.org</a></p>
  46. <p><strong>TL;DR</strong> routes pretty well; data might cause weird issues</p>
  47. <p>OpenTripPlanner, as the name implies, is a routing app. Given point A and point B, it can provide possible routes by taking transit, riding a bike, or a mix of both. You can also specify options on how much walking you&rsquo;re willing to do or if you prefer fewer transfers over trip time. It could be a good competitor to the transit directions of Google Maps.</p>
  48. <p>It&rsquo;s actually in general use by the <a href="http://maps.trimet.org/">Trimet</a>, Portland&rsquo;s public transit system. I think a good reason why they deployed OpenTripPlanner is that Portland is a very bike friendly area. OpenTripPlanner&rsquo;s support for multi-modal (bike + transit) routing is one thing that even Google Maps doesn&rsquo;t have. This actually just screams <a href="http://philippine-transit.hackathome.com/prizes/">Inclusive Technology Award</a>.</p>
  49. <h3 id="setup">Setup</h3>
  50. <p>Getting OpenTripPlanner up and running involves a bit more downloading than OneBusAway. I&rsquo;d suggest going through the <a href="https://github.com/openplans/OpenTripPlanner/wiki/FiveMinutes">5-minute introduction</a> if you want to actually work with the Philippine data. You will also need to download the <a href="http://download.geofabrik.de/asia/philippines.html">Philippine data dump</a> from OSM. You will want the <code>osm.bz2</code> one (WARNING: 900MB unzipped).</p>
  51. <p>Once you get the webapp running, you&rsquo;ll notice the map tiles won&rsquo;t load correctly. This is because the default tileset used is from Mapbox which doesn&rsquo;t provide publicly free tilesets anymore. To actually see things on the map, you should click the + on the upper-right of the map and change the base layer to something like Open Street Map or OSM Mapquest. This has been fixed in their latest sources.</p>
  52. <h3 id="issues">Issues</h3>
  53. <p>The next thing you&rsquo;ll notice is that you can&rsquo;t search for a place. You can only just pick points on the map and route between those. I&rsquo;m still not exactly sure if it&rsquo;s supposed to have it, since the Trimet one has it. But even then adding it by using the Google Maps or MapQuest APIs shouldn&rsquo;t be too difficult.</p>
  54. <p>Another missing thing compared to the Trimet planner is being able to look at the routes akin to OneBusAway. And even then, Trimet&rsquo;s implementation isn&rsquo;t as good for exploring as OneBusAway is. Seeing the schedule or seeing which routes pass through a stop are left to an external site to do.</p>
  55. <p>There have been some weird issues with the routing though. A common occurence is the steps are somewhat disconnected (see image below). The left half shows OpenTripPlanner, it shows that you get off at a &ldquo;stop&rdquo; in EDSA and you should magically teleport to Arguilla street and start walking. To be fair, Google Maps (right half) shows that there is a street from the &ldquo;stop&rdquo; to Arguilla.</p>
  56. <p><img src="../galleries/transit/otp1.png" alt="OpenTripPlanner disconnected route"></p>
  57. <p>I can&rsquo;t say this isn&rsquo;t a bug. After all, OpenTripPlanner couldn&rsquo;t have magically known there really was a street there. If it did, it wouldn&rsquo;t just teleport you to the corner. I&rsquo;m more inclined to think though that this is a result of not having any shape data. As a result, OpenTripPlanner might try to assume the stop could mean places within a certain radius of where it was defined.</p>
  58. <p>Another weird issue that pops up sometimes is where it tells you to ride a jeep past the stop you want and then after a while, get off and ride a jeep back to your stop. A more general issue is that sometimes it won&rsquo;t give you the best route because it thinks you have to loop around to get to where you want to be. I don&rsquo;t really know how common this issue pops up though. It&rsquo;s highly dependent on where you put the marker. If you just move the marker down a little bit, it actually does give the correct route.</p>
  59. <p><img src="../galleries/transit/otp2.png" alt="OpenTripPlanner loopy route"></p>
  60. <p>Much like the earlier problem, I can&rsquo;t tell if this is a bug or it&rsquo;s a result of the bad data. Once again though, I think the issue is more of bad data. If you look at the plotted UP-Katipunan route, the stops aren&rsquo;t even on the road. This probably makes it more difficult for OpenTripPlanner to actually tell if the stop and road are connected.</p>
  61. <p><img src="../galleries/transit/upkatipunan.jpg" alt="UP Katipunan Route"></p>
  62. <p>From what they said during the launch, most of the route data was collected by getting a person to ride a jeep with a smartphone. That would explain why the coordinates aren&rsquo;t that exact. Even then, it would have been nice if they at least cleaned up the data by moving the stops to the road. They would have had to go over them to name the stops anyway.</p>
  63. <h3 id="conclusion">Conclusion</h3>
  64. <p>Overall though, I really like OpenTripPlanner. It handles most of the hard parts of the challenge. It provides a REST API for doing routing with the GTFS + OSM data. There&rsquo;s also a lot of potential for additional open source work. A lot can be done to improve the default webapp. Adding a default location searcher would greatly improve usability. Adding in the route viewing features of OneBusAway would also be nice. Alternatively, you could even write your own client that just interfaces with the API.</p>
  65. </div>
  66. <aside class="postpromonav">
  67. <nav>
  68. <ul class="pager clearfix">
  69. <li class="previous">
  70. <a href="/posts/jeepney-and-bus-routes.html" rel="prev" title="Jeepney and Bus Routes">&larr; Previous post</a>
  71. </li>
  72. <li class="next">
  73. <a href="/posts/one-bus-or-maybe-jeep-away.html" rel="next" title="One Bus (or maybe Jeep) Away">Next post &rarr;</a>
  74. </li>
  75. </ul>
  76. </nav>
  77. </aside>
  78. <section class="comments">
  79. <script
  80. data-isso="https://isso.pleasantprogrammer.com/"
  81. data-isso-require-author="true"
  82. data-isso-vote="false"
  83. src="https://isso.pleasantprogrammer.com/js/embed.min.js">
  84. </script>
  85. <section id="isso-thread"></section>
  86. </section>
  87. </article>
  88. </main>
  89. <footer id="footer" role="contentinfo">
  90. <p>
  91. <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">
  92. <img alt="CC-BY-SA" style="border-width:0" src="https://licensebuttons.net/l/by-sa/3.0/80x15.png">
  93. </a> &copy; 2022 Thomas Dy - Powered by <a href="http://gohugo.io">Hugo</a></p>
  94. </footer>
  95. </div>
  96. <script src="/assets/js/konami.js"></script>
  97. <script>
  98. var easter_egg = new Konami();
  99. easter_egg.code = function() {
  100. var el = document.getElementById('thomas');
  101. if(el.className == "whoa") {
  102. el.className = "";
  103. }
  104. else {
  105. el.className = "whoa";
  106. }
  107. document.body.scrollTop = document.documentElement.scrollTop = 0;
  108. }
  109. easter_egg.load();
  110. </script>
  111. </body>
  112. </html>