123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <!DOCTYPE html>
- <html prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# " vocab="http://ogp.me/ns" lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>Highways in OTP | Pleasant Programmer</title>
- <link href="../assets/css/rst.css" rel="stylesheet" type="text/css">
- <link href="../assets/css/code.css" rel="stylesheet" type="text/css">
- <link href="../assets/css/theme.css" rel="stylesheet" type="text/css">
- <link href="../assets/css/custom.css" rel="stylesheet" type="text/css">
- <link rel="alternate" type="application/rss+xml" title="RSS" href="../rss.xml">
- <link rel="canonical" href="http://pleasantprogrammer.com/posts/highways-in-otp.html">
- <script type="text/javascript" src="//use.typekit.net/iwm5axp.js"></script><script type="text/javascript">try{Typekit.load();}catch(e){}</script><!--[if lt IE 9]><script src="../assets/js/html5.js"></script><![endif]--><meta name="author" content="Thomas Dy">
- <link rel="prev" href="elevation-data-in-otp.html" title="Elevation Data in OTP" type="text/html">
- <link rel="next" href="jeep-and-bus-schedules.html" title="Jeep and Bus Schedules" type="text/html">
- <meta property="og:site_name" content="Pleasant Programmer">
- <meta property="og:title" content="Highways in OTP">
- <meta property="og:url" content="http://pleasantprogrammer.com/posts/highways-in-otp.html">
- <meta property="og:description" content="One of the weird things that happens with OTP is sometimes it gives absurdly roundabout routes. Here is OTP's suggested route for walking from UP to Ateneo:
- This is just so hilariously wrong. It's mu">
- <meta property="og:type" content="article">
- <meta property="article:published_time" content="2013-07-24T23:15:57+08:00">
- <meta property="article:tag" content="philippine-transit-app">
- <meta property="article:tag" content="programming">
- </head>
- <body>
- <a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
-
- <header id="header" role="banner"><div class="thomas">
- <img src="../assets/img/thomas.gif" alt="DJ THOMAS IN DA HAUS"><img src="../assets/img/thomas.png" alt="Pleasant Programmer">
- </div>
-
- <h1 id="brand"><a href="http://pleasantprogrammer.com/" title="Pleasant Programmer" rel="home">
- <span id="blog-title">Pleasant Programmer</span>
- </a></h1>
-
-
- <nav id="menu" role="navigation"><ul>
- <li class="twitter"><a href="http://twitter.com/pleasantprog">@pleasantprog</a></li>
- <li><a href="../archive.html">Archives</a></li>
- <li><a href="../categories/index.html">Tags</a></li>
- <li><a href="../rss.xml">RSS</a></li>
-
-
- </ul></nav></header><div id="container">
- <main id="content" role="main"><article class="post-text h-entry hentry postpage" itemscope="itemscope" itemtype="http://schema.org/Article"><header><h1 class="p-name entry-title" itemprop="headline name"><a href="#" class="u-url">Highways in OTP</a></h1>
- <small>
- <span class="dateline">Posted: <a href="#" rel="bookmark"><time class="published dt-published" datetime="2013-07-24T23:15:57+08:00" itemprop="datePublished" title="2013-07-24 23:15">2013-07-24 23:15</time></a></span>
- |
- More posts about
-
- <a class="tag p-category" href="../categories/philippine-transit-app.html" rel="tag">philippine-transit-app</a>
- <a class="tag p-category" href="../categories/programming.html" rel="tag">programming</a>
- </small>
-
- </header><div class="e-content entry-content" itemprop="articleBody text">
- <div>
- <p>One of the weird things that happens with OTP is sometimes it gives absurdly roundabout routes. Here is OTP's suggested route for walking from UP to Ateneo:</p>
- <p><img alt="Roundabout route from UP to Ateneo" src="../galleries/transit/otproundabout.png"></p>
- <p>This is just so hilariously wrong. It's much simpler to just walk along Katipunan Avenue.</p>
- <p>OTP couldn't possibly be that dumb though, so there must be something we're doing wrong. If you notice, Katipunan Avenue is colored red compared to the other streets. OTP seems to be avoiding any path that goes along Katipunan Avenue. The problem might have something to do with the "road type" designated to Katipunan.</p>
- <p>Apparently, by default OTP will consider roads of type <code>trunk</code> to be non-walkable and non-bikable. This is documented in the <a href="http://wiki.openstreetmap.org/wiki/OpenTripPlanner">OpenStreetMap wiki</a> and the <a href="https://github.com/openplans/OpenTripPlanner/wiki/GraphBuilder#permissions-and-bicycle-safety">OTP wiki</a> as well. There are actually multiple ways to go about this then. The first solution that came to mind was to just edit the original OSM XML file.</p>
- <pre class="code literal-block">sed -i .bak s/trunk/primary/g manila.osm
- </pre>
- <p>And rebuild the graph. It doesn't really matter much because the OSM data isn't used to render the maps. It's just used to build the routing data. This is actually what I did for <a href="http://maps.pleasantprogrammer.com">maps.pleasantprogrammer.com</a>.</p>
- <p>It's also possible to set the default way properties in OTP. Instead of disallowing walking and biking on <code>highway=trunk</code> we could allow that. This is not much better than the <code>sed</code> solution though. It's better since you keep the weighting done by OTP, but you're still saying that all trunks are walkable which might not be the case.</p>
- <p>The most correct way to actually fix this is to go through each of the trunks and specifying <code>foot=yes</code> and <code>bicycle=yes</code> for those trunks that are actually walkable. You could either do this locally with the dumped data, or contribute it directly to OSM. I'm not sure on the particulars with updating OSM though.</p>
- </div>
- </div>
- <aside class="postpromonav"><nav><ul class="pager clearfix">
- <li class="previous">
- <a href="elevation-data-in-otp.html" rel="prev" title="Elevation Data in OTP">← Previous post</a>
- </li>
- <li class="next">
- <a href="jeep-and-bus-schedules.html" rel="next" title="Jeep and Bus Schedules">Next post →</a>
- </li>
- </ul></nav></aside><section class="comments"><div id="disqus_thread"></div>
- <script>
- var disqus_shortname ="pleasantprog",
- disqus_url="http://pleasantprogrammer.com/posts/highways-in-otp.html",
- disqus_title="Highways in OTP",
- disqus_identifier="cache/posts/highways-in-otp.html",
- disqus_config = function () {
- this.language = "en";
- };
- (function() {
- var dsq = document.createElement('script'); dsq.async = true;
- dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
- })();
- </script><noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a>
- </noscript>
- <a href="//disqus.com" class="dsq-brlink" rel="nofollow">Comments powered by <span class="logo-disqus">Disqus</span></a>
- </section></article><script>var disqus_shortname="pleasantprog";(function(){var a=document.createElement("script");a.async=true;a.src="//"+disqus_shortname+".disqus.com/count.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)}());</script></main><footer id="footer" role="contentinfo"><p><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="CC-BY-SA" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/80x15.png"></a> © 2015 Thomas Dy - Powered by <a href="http://getnikola.com">Nikola</a></p>
-
- </footer>
- </div>
-
-
-
-
- <script src="../assets/js/konami.js"></script><script src="http://code.jquery.com/jquery-2.0.3.min.js"></script><script>
- var easter_egg = new Konami();
- easter_egg.code = function() {
- $(".thomas").toggleClass("whoa");
- $("body").scrollTop(0);
- }
- easter_egg.load();
- // love you, thomas!
- // yours, @_phi + @meggykawsek
- </script>
- </body>
- </html>
|