|
@@ -1,27 +1,30 @@
|
|
|
-<!DOCTYPE html><html lang="en"><head><meta name="viewport" content="width=device-width, initial-scale=1"><meta charset="utf-8"><meta name="description" content=""><meta name="author" content="Thomas Dy"><title>Pleasant Programmer | 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/colorbox.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"><!--[if lt IE 9]>
|
|
|
+<!DOCTYPE html><html lang="en"><head><meta name="viewport" content="width=device-width, initial-scale=1"><meta charset="utf-8"><meta name="description" content=""><meta name="author" content="Thomas Dy"><title>Pleasant Programmer | 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/colorbox.css" rel="stylesheet" type="text/css"><link href="assets/css/theme.css" rel="stylesheet" type="text/css"><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="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
|
|
|
<![endif]--><link rel="alternate" type="application/rss+xml" title="RSS (en)" href="rss.xml"></head><body>
|
|
|
- <div class="container">
|
|
|
- <div class="header clearfix">
|
|
|
- <h1 id="blog-title">
|
|
|
- <a href="." title="Pleasant Programmer">Pleasant Programmer</a>
|
|
|
- </h1>
|
|
|
- <ul class="nav"><li><a href="archive.html">Archives</a>
|
|
|
+ <header><a href="." title="Pleasant Programmer">
|
|
|
+ <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="blog-title">
|
|
|
+ Pleasant Programmer
|
|
|
+ </h1>
|
|
|
+ </a>
|
|
|
+ <ul class="nav"><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><li><a href="http://www.twitter.com/pleasantprog">@pleasantprog</a></li>
|
|
|
- <ul class="nav"></ul></ul></div>
|
|
|
+ </li></ul></header><div class="container">
|
|
|
<div class="content">
|
|
|
|
|
|
<div class="postbox">
|
|
|
<div class="title">
|
|
|
<h1><a href="posts/jeep-and-bus-schedules.html">Jeep and Bus Schedules</a>
|
|
|
- <small>
|
|
|
+ <small>
|
|
|
Posted: 2013-07-28 16:26
|
|
|
</small></h1>
|
|
|
</div>
|
|
|
- <hr><p>Wouldn't it be wonderful if there were no buses or jeepneys in the Philippines over the weekends? It would truly be a cyclist's paradise. Imagine biking along EDSA, normally that would be a death sentence, but according to the GTFS data, you shouldn't worry. I can assure you, it's still a death sentence.</p>
|
|
|
+ <p>Wouldn't it be wonderful if there were no buses or jeepneys in the Philippines over the weekends? It would truly be a cyclist's paradise. Imagine biking along EDSA, normally that would be a death sentence, but according to the GTFS data, you shouldn't worry. I can assure you, it's still a death sentence.</p>
|
|
|
<p>The GTFS spec defines 2 ways of statically specifying trip schedules. You can define the exact times that a service will arrive at a stop. You can also specify between what times the service is active and how often a new bus or jeep leaves the first stop. You also define which days those rules apply. You could say every MWF, the bus operates from 9:00AM to 9:00PM and every TTH, the bus services from 3:00AM to 11:00PM.</p>
|
|
|
<p>This should be sufficient in theory, but real world conditions like traffic or the weather could throw the schedules off. To solve this, there's another spec, GTFS-realtime. This allows transit agencies to push temporary schedule updates and service announcements.</p>
|
|
|
<p>Like much everything else about the Philippine transit system, there aren't really any "schedules" to speak of. It's generally whenever the buses or jeeps feel like it. So we have no static schedules. We don't have a central agency or the tracking technology to make it feasible to push updates via GTFS-RT.</p>
|
|
@@ -49,11 +52,11 @@ sed -i .bak <span class="s1">'/^72/ s/,600/,60/'</span> frequencies.txt
|
|
|
<div class="postbox">
|
|
|
<div class="title">
|
|
|
<h1><a href="posts/highways-in-otp.html">Highways in OTP</a>
|
|
|
- <small>
|
|
|
+ <small>
|
|
|
Posted: 2013-07-24 23:15
|
|
|
</small></h1>
|
|
|
</div>
|
|
|
- <hr><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>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>
|
|
@@ -73,11 +76,11 @@ sed -i .bak <span class="s1">'/^72/ s/,600/,60/'</span> frequencies.txt
|
|
|
<div class="postbox">
|
|
|
<div class="title">
|
|
|
<h1><a href="posts/elevation-data-in-otp.html">Elevation Data in OTP</a>
|
|
|
- <small>
|
|
|
+ <small>
|
|
|
Posted: 2013-07-23 18:23
|
|
|
</small></h1>
|
|
|
</div>
|
|
|
- <hr><p><img alt="OpenTripPlanner showing elevation data" src="galleries/transit/otpelevation.png"></p>
|
|
|
+ <p><img alt="OpenTripPlanner showing elevation data" src="galleries/transit/otpelevation.png"></p>
|
|
|
<p>One thing I hadn't tested out last time was OTP's support for elevation data. It makes use of this by showing the elevation you have to traverse while walking along the suggested route. It can also take it into account when suggesting bike routes.</p>
|
|
|
<p>The <a href="https://github.com/openplans/OpenTripPlanner/wiki/FiveMinutes">5 minute tutorial</a> actually discusses the elevation data briefly, but a more in-depth thing you can look at is the <a href="https://github.com/openplans/OpenTripPlanner/wiki/GraphBuilder#elevation-data">GraphBuilder documentation</a>. It suggests using the ASTER dataset which is free but requires registration. I just opted to use the SRTM data available from the <a href="http://www.philgis.org/freegisdata.htm">PhilGIS website</a>.</p>
|
|
|
<p>I don't know about the ASTER dataset, but the PhilGIS data was in the ERDAS img format. OTP only supports GeoTIFF so there was a need to convert it beforehand. You can use <a href="http://www.gdal.org/">GDAL</a> for this. You'd just then run,</p>
|
|
@@ -95,11 +98,11 @@ sed -i .bak <span class="s1">'/^72/ s/,600/,60/'</span> frequencies.txt
|
|
|
<div class="postbox">
|
|
|
<div class="title">
|
|
|
<h1><a href="posts/graphserver.html">GraphServer</a>
|
|
|
- <small>
|
|
|
+ <small>
|
|
|
Posted: 2013-07-23 14:48
|
|
|
</small></h1>
|
|
|
</div>
|
|
|
- <hr><p>Link: <a href="http://graphserver.github.io/graphserver/">http://graphserver.github.io/graphserver/</a></p>
|
|
|
+ <p>Link: <a href="http://graphserver.github.io/graphserver/">http://graphserver.github.io/graphserver/</a></p>
|
|
|
<p>One other routing webapp I saw was GraphServer. It's actually more of a general purpose Graph library which supports GTFS and OSM data than an actual dedicated routing software like OpenTripPlanner. It's also based off python and C instead of Java, so it feels a lot less heavy.</p>
|
|
|
<p>The instructions on the website are already pretty good. There are just some minor errors with it. Where it says <code>gs_gtfsdb_build</code>, you should actually use <code>gs_gtfsdb_compile</code>. Also, when running <code>gs_osmdb_compile</code> you might need to use <code>-t</code> for tolerant in case you follow the instructions on chopping up the original OSM data.</p>
|
|
|
<p>A nice suggestion from the GraphServer instructions was to crop the OSM data to minimize the graph size. This is actually quite helpful if you downloaded the entire Philippine OSM dump. It reduced the original 900MB file to 135MB which was a lot more workable. I did hit a problem with their instructions though. The linked version of osmosis is an old one, which doesn't support 64-bit ids. The <a href="http://wiki.openstreetmap.org/wiki/Osmosis">latest version of Osmosis</a> easily did the job though.</p>
|
|
@@ -113,11 +116,11 @@ sed -i .bak <span class="s1">'/^72/ s/,600/,60/'</span> frequencies.txt
|
|
|
<div class="postbox">
|
|
|
<div class="title">
|
|
|
<h1><a href="posts/transit-wand.html">Transit Wand</a>
|
|
|
- <small>
|
|
|
+ <small>
|
|
|
Posted: 2013-07-15 22:45
|
|
|
</small></h1>
|
|
|
</div>
|
|
|
- <hr><p>Link: <a href="https://play.google.com/store/apps/details?id=com.conveyal.transitwand">http://transitwand.com</a></p>
|
|
|
+ <p>Link: <a href="https://play.google.com/store/apps/details?id=com.conveyal.transitwand">http://transitwand.com</a></p>
|
|
|
<p>Overall, this was the simplest of the <a href="http://philippine-transit.hackathome.com/use-this-code/">open-source transit tools</a> to actually get up and running. There's already a deployed instance of the server, and you can easily download the phone app via the <a href="https://play.google.com/store/apps/details?id=com.conveyal.transitwand">Play Store</a>. Even running the server by yourself didn't have any of the hiccups I had with GTFS Editor.</p>
|
|
|
<p>The phone app is actually quite simple. It allows you to capture a trip, which will record your GPS coordinates as you ride public transit. It also allows you to mark points of the trip where you stop and also how long the stop took. Lastly, it allows you to record embarking and disembarking passengers which is potentially useful for ridership data.</p>
|
|
|
<p>After doing a capture session, you can review the data on the phone. It will plot out the route on a map, with markers for the stops. You then either delete the data if it looks wrong, or you can upload it to the Transit Wand server. Uploading involves registering an account, but it's free and you don't even actually need to put in a username or anything. It simply registers the phone's IMEI on the server and gives you a 6-digit identifier.</p>
|
|
@@ -141,9 +144,16 @@ sed -i .bak <span class="s1">'/^72/ s/,600/,60/'</span> frequencies.txt
|
|
|
|
|
|
|
|
|
<script type="text/javascript">var disqus_shortname="pleasantprog";(function(){var a=document.createElement("script");a.async=true;a.type="text/javascript";a.src="http://"+disqus_shortname+".disqus.com/count.js";(document.getElementsByTagName("HEAD")[0]||document.getElementsByTagName("BODY")[0]).appendChild(a)}());</script></div>
|
|
|
-
|
|
|
- <div class="footer"><small><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> © 2013 Thomas Dy - Powered by <a href="http://nikola.ralsina.com.ar">Nikola</a></small></div>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
-</body></html>
|
|
|
+ <footer><small><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> © 2013 Thomas Dy - Powered by <a href="http://nikola.ralsina.com.ar">Nikola</a></small>
|
|
|
+ <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></footer></body></html>
|