Browse Source

Add geocoding post

Thomas Dy 11 years ago
parent
commit
433a7e35a4

+ 2 - 1
output/2013/index.html

@@ -20,7 +20,8 @@
         <!--Body content-->
         <div class="postbox">
         <h1>Posts for year 2013</h1>
-        <ul class="unstyled"><li><a href="../posts/jeep-and-bus-schedules.html">[2013-07-28 16:26] Jeep and Bus Schedules</a>
+        <ul class="unstyled"><li><a href="../posts/geocoding-services.html">[2013-09-25 12:26] Geocoding Services</a>
+            </li><li><a href="../posts/jeep-and-bus-schedules.html">[2013-07-28 16:26] Jeep and Bus Schedules</a>
             </li><li><a href="../posts/highways-in-otp.html">[2013-07-24 23:15] Highways in OTP</a>
             </li><li><a href="../posts/elevation-data-in-otp.html">[2013-07-23 18:23] Elevation Data in OTP</a>
             </li><li><a href="../posts/graphserver.html">[2013-07-23 14:48] GraphServer</a>

+ 1 - 1
output/assets/js/tag_cloud_data.json

@@ -1 +1 @@
-{"programming": [11, "/categories/programming.html"], "lets-debug": [1, "/categories/lets-debug.html"], "philippine-transit-app": [11, "/categories/philippine-transit-app.html"]}
+{"programming": [12, "/categories/programming.html"], "lets-debug": [1, "/categories/lets-debug.html"], "philippine-transit-app": [12, "/categories/philippine-transit-app.html"]}

+ 1 - 1
output/categories/lets-debug.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<rss version="2.0"><channel><title>Pleasant Programmer (lets-debug)</title><link>http://pleasantprogrammer.com</link><description></description><lastBuildDate>Fri, 23 Aug 2013 19:07:26 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>GTFS Editor</title><link>http://pleasantprogrammer.com/posts/gtfs-editor.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;Link: &lt;a href="https://github.com/conveyal/gtfs-editor"&gt;https://github.com/conveyal/gtfs-editor&lt;/a&gt;&lt;/p&gt;
+<rss version="2.0"><channel><title>Pleasant Programmer (lets-debug)</title><link>http://pleasantprogrammer.com</link><description></description><lastBuildDate>Wed, 25 Sep 2013 14:47:32 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>GTFS Editor</title><link>http://pleasantprogrammer.com/posts/gtfs-editor.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;Link: &lt;a href="https://github.com/conveyal/gtfs-editor"&gt;https://github.com/conveyal/gtfs-editor&lt;/a&gt;&lt;/p&gt;
 &lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; they really meant under development&lt;/p&gt;
 &lt;p&gt;When I first saw the source of GTFS Editor, I was ecstatic. They used &lt;a href="http://playframework.com/"&gt;Play framework&lt;/a&gt;!!! Not only that, they're targeting PostgreSQL as the main database. Those are our favorite tools for building webapps at By Implication. I was a bit sad though, when I saw it was on the 1.x release of Play though. I did have some experience with that release, but not as much compared to 2.x.&lt;/p&gt;
 &lt;p&gt;Getting it to actually run though, wasn't very pleasant. The initial setup was easy enough. Get &lt;a href="http://www.playframework.com/download"&gt;Play 1.2.5&lt;/a&gt;, install Postgres with PostGIS, clone the repo and create backing database in Postgres. Some minor additional steps you need are to create the PostGIS extension on the database. The schema is automatically generated and applied by Play so that should be all that's necessary. Wonderful. Then, run play, open a browser, go to &lt;a href="http://localhost:9000"&gt;http://localhost:9000&lt;/a&gt;, compilation error. Fantastic.&lt;/p&gt;

+ 2 - 1
output/categories/philippine-transit-app.html

@@ -20,7 +20,8 @@
         <!--Body content-->
         <div class="postbox">
         <h1>Posts about philippine-transit-app</h1>
-        <ul class="unstyled"><li><a href="../posts/jeep-and-bus-schedules.html">[2013-07-28 16:26] Jeep and Bus Schedules</a>
+        <ul class="unstyled"><li><a href="../posts/geocoding-services.html">[2013-09-25 12:26] Geocoding Services</a>
+            </li><li><a href="../posts/jeep-and-bus-schedules.html">[2013-07-28 16:26] Jeep and Bus Schedules</a>
             </li><li><a href="../posts/highways-in-otp.html">[2013-07-24 23:15] Highways in OTP</a>
             </li><li><a href="../posts/elevation-data-in-otp.html">[2013-07-23 18:23] Elevation Data in OTP</a>
             </li><li><a href="../posts/graphserver.html">[2013-07-23 14:48] GraphServer</a>

+ 8 - 8
output/categories/philippine-transit-app.xml

@@ -1,5 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
-<rss version="2.0"><channel><title>Pleasant Programmer (philippine-transit-app)</title><link>http://pleasantprogrammer.com</link><description></description><lastBuildDate>Fri, 23 Aug 2013 19:07:26 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Jeep and Bus Schedules</title><link>http://pleasantprogrammer.com/posts/jeep-and-bus-schedules.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;
+<rss version="2.0"><channel><title>Pleasant Programmer (philippine-transit-app)</title><link>http://pleasantprogrammer.com</link><description></description><lastBuildDate>Wed, 25 Sep 2013 14:47:32 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Geocoding Services</title><link>http://pleasantprogrammer.com/posts/geocoding-services.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don't know exactly where their start and end points are on the map. Even then, manually looking for a location on a map is a time-consuming task.&lt;/p&gt;
+&lt;p&gt;The gold standard for doing geocoding right now is Google Maps. It's hard to find a better location search experience. If they actually provided routing for jeeps here in the Philippines, I imagine there wouldn't be &lt;em&gt;that&lt;/em&gt; much you could do for the competition.&lt;/p&gt;
+&lt;p&gt;When the competition started though, I took it as a challenge to avoid Google Maps as much as possible. I wanted to see how much is currently possible with other options such as OpenStreetMap. In fact, OSM does have a geocoding service called &lt;a href="http://nominatim.openstreetmap.org"&gt;Nominatim&lt;/a&gt;.&lt;/p&gt;
+&lt;p&gt;Sadly, for a mapping app, what you want to do is not simply just geocoding. With geocoding, you take an address and turn it into coordinates. When you want to search for a place in a mapping app, you take part of an address, infer the rest of it, and give the user options to choose from.&lt;/p&gt;
+&lt;p&gt;Given a typical mapping app, you might type in "ateneo" and expect it to give you Ateneo de Manila University. With typical geocoding services like Nominatim or even Google's &lt;a href="https://developers.google.com/maps/documentation/javascript/geocoding"&gt;geocoding API&lt;/a&gt;, you probably won't get any result for this. What you want to use is the &lt;a href="https://developers.google.com/maps/documentation/javascript/places"&gt;Places API&lt;/a&gt; which provides an autocomplete search box. Using it, when you type in "ateneo", it automatically suggests in the dropdown, "Ateneo de Manila University".&lt;/p&gt;
+&lt;p&gt;A downside to using the Places API is that it's against the terms of service to use it with something that isn't Google Maps, which means no OpenStreetMap. If there were more time, writing your own autocompletion engine using OpenStreetMap's data will probably be a better long term solution.&lt;/p&gt;
+&lt;p&gt;For now, since the competition's deadline is just a few days away, I'll be using Google Maps.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/geocoding-services.html</guid><pubDate>Wed, 25 Sep 2013 04:26:59 GMT</pubDate></item><item><title>Jeep and Bus Schedules</title><link>http://pleasantprogrammer.com/posts/jeep-and-bus-schedules.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;
 &lt;p&gt;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.&lt;/p&gt;
 &lt;p&gt;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.&lt;/p&gt;
 &lt;p&gt;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.&lt;/p&gt;
@@ -297,10 +303,4 @@ Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
 &lt;p&gt;It doesn't really handle too many routes passing through a stop. The list just overflows past the bubble. You can still actually read it by panning the map. It's just a bit weird though.&lt;/p&gt;
 &lt;p&gt;If you also noticed, there are usually 2 of each route. This is how the jeepney data was modeled as jeep routes might be different going one way and going back. This isn't the case for all jeeps though, so it might also be an implementation issue with the GTFS editor.&lt;/p&gt;
 &lt;p&gt;&lt;a href="/galleries/transit/onebusaway2.png"&gt;&lt;img alt="OneBusAway" src="/galleries/transit/onebusaway2.png"&gt;&lt;/a&gt;&lt;/p&gt;
-&lt;p&gt;&lt;a href="/galleries/transit/onebusaway3.png"&gt;&lt;img alt="OneBusAway" src="/galleries/transit/onebusaway3.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/one-bus-or-maybe-jeep-away.html</guid><pubDate>Mon, 08 Jul 2013 17:53:59 GMT</pubDate></item><item><title>Jeepney and Bus Routes</title><link>http://pleasantprogrammer.com/posts/jeepney-and-bus-routes.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;In the &lt;a href="/posts/philippine-transit-app-challenge.html"&gt;last post&lt;/a&gt;, I talked about how we now have data about jeepney and bus routes in the Philippines. The data is actually in the &lt;a href="https://developers.google.com/transit/gtfs/"&gt;GTFS format&lt;/a&gt;, which is the format the Google Maps consumes transit data. Apparently, the government will be submitting the GTFS data later this year. Transit directions for Metro Manila in Google Maps would be wonderful. That said, it definitely raises the bar for the app challenge people.&lt;/p&gt;
-&lt;p&gt;In the last post, I mentioned the quality of the data isn't quite good. Even before seeing the data, I was already a bit unsure of it. The key problem is how you model the routes. The GTFS format was inherently designed for more well developed and organized transit agencies which isn't exactly what we have in the Philippines now.&lt;/p&gt;
-&lt;p&gt;One potential problem is the nature of the jeeps and buses. GTFS routes are a collection of trips which are a sequence of stops. However, we don't have jeepney stops, and even if we did they still just stop anywhere. There are also times where jeeps will take a shortcut if no passengers need to get dropped off along their normal route.&lt;/p&gt;
-&lt;p&gt;From what I've seen of the data, they handled the first problem well enough. Stops are defined as where people typically get on the jeep or bus. This is good, but they didn't define a shape for the routes. There is no information as to which exact roads they pass through. All we have to go by are the stops to show the route on a map.&lt;/p&gt;
-&lt;p&gt;&lt;img alt="sample route" src="http://i.imgur.com/NSVlryE.jpg"&gt;&lt;/p&gt;
-&lt;p&gt;The problem isn't that bad though. The agencies could still add the shapes later on. Or maybe an app challenge participant could make an app around fixing the routes via crowd-sourcing or similar. The shape itself isn't that important for a rudimentary directions app, but if we want better apps, we will need better data.&lt;/p&gt;
-&lt;p&gt;There were also some minor issues with the data itself. Some of the files had extra columns. This normally isn't an issue, but it caused problems for &lt;a href="https://github.com/harrisony/gtfs_SQL_importer"&gt;GTFS SQL importer&lt;/a&gt;. There were also problems with matching the shape data with the stops when I tried it with &lt;a href="http://onebusaway.org"&gt;OneBusAway&lt;/a&gt;. They could probably be &lt;a href="https://github.com/OneBusAway/onebusaway-application-modules/wiki/Stop-to-Shape-Matching"&gt;fixed&lt;/a&gt; but that's for another day.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/jeepney-and-bus-routes.html</guid><pubDate>Sun, 07 Jul 2013 02:32:36 GMT</pubDate></item></channel></rss>
+&lt;p&gt;&lt;a href="/galleries/transit/onebusaway3.png"&gt;&lt;img alt="OneBusAway" src="/galleries/transit/onebusaway3.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/one-bus-or-maybe-jeep-away.html</guid><pubDate>Mon, 08 Jul 2013 17:53:59 GMT</pubDate></item></channel></rss>

+ 2 - 1
output/categories/programming.html

@@ -20,7 +20,8 @@
         <!--Body content-->
         <div class="postbox">
         <h1>Posts about programming</h1>
-        <ul class="unstyled"><li><a href="../posts/jeep-and-bus-schedules.html">[2013-07-28 16:26] Jeep and Bus Schedules</a>
+        <ul class="unstyled"><li><a href="../posts/geocoding-services.html">[2013-09-25 12:26] Geocoding Services</a>
+            </li><li><a href="../posts/jeep-and-bus-schedules.html">[2013-07-28 16:26] Jeep and Bus Schedules</a>
             </li><li><a href="../posts/highways-in-otp.html">[2013-07-24 23:15] Highways in OTP</a>
             </li><li><a href="../posts/elevation-data-in-otp.html">[2013-07-23 18:23] Elevation Data in OTP</a>
             </li><li><a href="../posts/graphserver.html">[2013-07-23 14:48] GraphServer</a>

+ 8 - 8
output/categories/programming.xml

@@ -1,5 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
-<rss version="2.0"><channel><title>Pleasant Programmer (programming)</title><link>http://pleasantprogrammer.com</link><description></description><lastBuildDate>Fri, 23 Aug 2013 19:07:26 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Jeep and Bus Schedules</title><link>http://pleasantprogrammer.com/posts/jeep-and-bus-schedules.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;
+<rss version="2.0"><channel><title>Pleasant Programmer (programming)</title><link>http://pleasantprogrammer.com</link><description></description><lastBuildDate>Wed, 25 Sep 2013 14:47:32 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Geocoding Services</title><link>http://pleasantprogrammer.com/posts/geocoding-services.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don't know exactly where their start and end points are on the map. Even then, manually looking for a location on a map is a time-consuming task.&lt;/p&gt;
+&lt;p&gt;The gold standard for doing geocoding right now is Google Maps. It's hard to find a better location search experience. If they actually provided routing for jeeps here in the Philippines, I imagine there wouldn't be &lt;em&gt;that&lt;/em&gt; much you could do for the competition.&lt;/p&gt;
+&lt;p&gt;When the competition started though, I took it as a challenge to avoid Google Maps as much as possible. I wanted to see how much is currently possible with other options such as OpenStreetMap. In fact, OSM does have a geocoding service called &lt;a href="http://nominatim.openstreetmap.org"&gt;Nominatim&lt;/a&gt;.&lt;/p&gt;
+&lt;p&gt;Sadly, for a mapping app, what you want to do is not simply just geocoding. With geocoding, you take an address and turn it into coordinates. When you want to search for a place in a mapping app, you take part of an address, infer the rest of it, and give the user options to choose from.&lt;/p&gt;
+&lt;p&gt;Given a typical mapping app, you might type in "ateneo" and expect it to give you Ateneo de Manila University. With typical geocoding services like Nominatim or even Google's &lt;a href="https://developers.google.com/maps/documentation/javascript/geocoding"&gt;geocoding API&lt;/a&gt;, you probably won't get any result for this. What you want to use is the &lt;a href="https://developers.google.com/maps/documentation/javascript/places"&gt;Places API&lt;/a&gt; which provides an autocomplete search box. Using it, when you type in "ateneo", it automatically suggests in the dropdown, "Ateneo de Manila University".&lt;/p&gt;
+&lt;p&gt;A downside to using the Places API is that it's against the terms of service to use it with something that isn't Google Maps, which means no OpenStreetMap. If there were more time, writing your own autocompletion engine using OpenStreetMap's data will probably be a better long term solution.&lt;/p&gt;
+&lt;p&gt;For now, since the competition's deadline is just a few days away, I'll be using Google Maps.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/geocoding-services.html</guid><pubDate>Wed, 25 Sep 2013 04:26:59 GMT</pubDate></item><item><title>Jeep and Bus Schedules</title><link>http://pleasantprogrammer.com/posts/jeep-and-bus-schedules.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;
 &lt;p&gt;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.&lt;/p&gt;
 &lt;p&gt;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.&lt;/p&gt;
 &lt;p&gt;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.&lt;/p&gt;
@@ -297,10 +303,4 @@ Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
 &lt;p&gt;It doesn't really handle too many routes passing through a stop. The list just overflows past the bubble. You can still actually read it by panning the map. It's just a bit weird though.&lt;/p&gt;
 &lt;p&gt;If you also noticed, there are usually 2 of each route. This is how the jeepney data was modeled as jeep routes might be different going one way and going back. This isn't the case for all jeeps though, so it might also be an implementation issue with the GTFS editor.&lt;/p&gt;
 &lt;p&gt;&lt;a href="/galleries/transit/onebusaway2.png"&gt;&lt;img alt="OneBusAway" src="/galleries/transit/onebusaway2.png"&gt;&lt;/a&gt;&lt;/p&gt;
-&lt;p&gt;&lt;a href="/galleries/transit/onebusaway3.png"&gt;&lt;img alt="OneBusAway" src="/galleries/transit/onebusaway3.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/one-bus-or-maybe-jeep-away.html</guid><pubDate>Mon, 08 Jul 2013 17:53:59 GMT</pubDate></item><item><title>Jeepney and Bus Routes</title><link>http://pleasantprogrammer.com/posts/jeepney-and-bus-routes.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;In the &lt;a href="/posts/philippine-transit-app-challenge.html"&gt;last post&lt;/a&gt;, I talked about how we now have data about jeepney and bus routes in the Philippines. The data is actually in the &lt;a href="https://developers.google.com/transit/gtfs/"&gt;GTFS format&lt;/a&gt;, which is the format the Google Maps consumes transit data. Apparently, the government will be submitting the GTFS data later this year. Transit directions for Metro Manila in Google Maps would be wonderful. That said, it definitely raises the bar for the app challenge people.&lt;/p&gt;
-&lt;p&gt;In the last post, I mentioned the quality of the data isn't quite good. Even before seeing the data, I was already a bit unsure of it. The key problem is how you model the routes. The GTFS format was inherently designed for more well developed and organized transit agencies which isn't exactly what we have in the Philippines now.&lt;/p&gt;
-&lt;p&gt;One potential problem is the nature of the jeeps and buses. GTFS routes are a collection of trips which are a sequence of stops. However, we don't have jeepney stops, and even if we did they still just stop anywhere. There are also times where jeeps will take a shortcut if no passengers need to get dropped off along their normal route.&lt;/p&gt;
-&lt;p&gt;From what I've seen of the data, they handled the first problem well enough. Stops are defined as where people typically get on the jeep or bus. This is good, but they didn't define a shape for the routes. There is no information as to which exact roads they pass through. All we have to go by are the stops to show the route on a map.&lt;/p&gt;
-&lt;p&gt;&lt;img alt="sample route" src="http://i.imgur.com/NSVlryE.jpg"&gt;&lt;/p&gt;
-&lt;p&gt;The problem isn't that bad though. The agencies could still add the shapes later on. Or maybe an app challenge participant could make an app around fixing the routes via crowd-sourcing or similar. The shape itself isn't that important for a rudimentary directions app, but if we want better apps, we will need better data.&lt;/p&gt;
-&lt;p&gt;There were also some minor issues with the data itself. Some of the files had extra columns. This normally isn't an issue, but it caused problems for &lt;a href="https://github.com/harrisony/gtfs_SQL_importer"&gt;GTFS SQL importer&lt;/a&gt;. There were also problems with matching the shape data with the stops when I tried it with &lt;a href="http://onebusaway.org"&gt;OneBusAway&lt;/a&gt;. They could probably be &lt;a href="https://github.com/OneBusAway/onebusaway-application-modules/wiki/Stop-to-Shape-Matching"&gt;fixed&lt;/a&gt; but that's for another day.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/jeepney-and-bus-routes.html</guid><pubDate>Sun, 07 Jul 2013 02:32:36 GMT</pubDate></item></channel></rss>
+&lt;p&gt;&lt;a href="/galleries/transit/onebusaway3.png"&gt;&lt;img alt="OneBusAway" src="/galleries/transit/onebusaway3.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/one-bus-or-maybe-jeep-away.html</guid><pubDate>Mon, 08 Jul 2013 17:53:59 GMT</pubDate></item></channel></rss>

+ 22 - 19
output/index-1.html

@@ -17,6 +17,28 @@
         </li></ul></header><div class="container">
         <div class="content">
             
+        <div class="postbox">
+        <div class="title">
+            <h1><a href="posts/transit-wand.html">Transit Wand</a>
+            <small>
+                 Posted: 2013-07-15 22:45
+            </small></h1>
+        </div>
+        <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>
+<p>You can then use the 6-digit identifier to view the data on Transit Wand's server, which is good since uploading any data automatically deletes it from the phone. There really isn't much else you can do with it though. It just allows you to view the data, and export it as a <a href="https://en.wikipedia.org/wiki/Shapefile">Shapefile</a>.</p>
+<p>As is, this is purely a data collection client-server app. Barring looking at the database, there is no way to get a list of phones which have collected data. Only the person who initiated the data collection knows the 6-digit code to view their data. There's also no way to extract the ridership information from the server yet. This isn't to say that the data won't eventually go public though.</p>
+<p>An interesting thing you <em>can</em> do with the Transit Wand data is import it into GTFS Editor to make a new route. You don't even have to manually download and upload the data. Just type in your 6-digit identifier and it will give you a list of routes you've captured via Transit Wand. This is wonderful as you get all the stop data, as well as the shape of the route.</p>
+<p>I imagine these two tools were how the DOTC came up with all the GTFS data we have now. What I don't understand is why the shape data isn't present. Importing from Transit Wand already gets you shape data. There are even facilities to edit the shape within the editor if clean up is necessary. The only problem I saw was the fact that you can't easily move stops, you have to input coordinates to change the position.</p>
+<p>It <em>might</em> also be possible that when the DOTC was still collecting the data, the route collection or editing features weren't present yet. That would just be lame and depressing though.</p>
+<p>Overall, Transit Wand does what it's supposed to do. You collect data, and then upload it to a server. There is a lot of room for improvement though. It would be nice to have a better API that allows access to more of the data. Building in analysis tools for the ridership data might also be a welcome thing. I imagine it would also be great if you could encourage people to use the app and upload their own trips.</p>
+            
+    <p>
+        <a href="posts/transit-wand.html#disqus_thread" data-disqus-identifier="cache/posts/transit-wand.html">Comments</a>
+
+        </p></div>
         <div class="postbox">
         <div class="title">
             <h1><a href="posts/fare-data.html">Fare Data</a>
@@ -314,25 +336,6 @@ Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
         <a href="posts/one-bus-or-maybe-jeep-away.html#disqus_thread" data-disqus-identifier="cache/posts/one-bus-or-maybe-jeep-away.html">Comments</a>
 
         </p></div>
-        <div class="postbox">
-        <div class="title">
-            <h1><a href="posts/jeepney-and-bus-routes.html">Jeepney and Bus Routes</a>
-            <small>
-                 Posted: 2013-07-07 10:32
-            </small></h1>
-        </div>
-        <p>In the <a href="posts/philippine-transit-app-challenge.html">last post</a>, I talked about how we now have data about jeepney and bus routes in the Philippines. The data is actually in the <a href="https://developers.google.com/transit/gtfs/">GTFS format</a>, which is the format the Google Maps consumes transit data. Apparently, the government will be submitting the GTFS data later this year. Transit directions for Metro Manila in Google Maps would be wonderful. That said, it definitely raises the bar for the app challenge people.</p>
-<p>In the last post, I mentioned the quality of the data isn't quite good. Even before seeing the data, I was already a bit unsure of it. The key problem is how you model the routes. The GTFS format was inherently designed for more well developed and organized transit agencies which isn't exactly what we have in the Philippines now.</p>
-<p>One potential problem is the nature of the jeeps and buses. GTFS routes are a collection of trips which are a sequence of stops. However, we don't have jeepney stops, and even if we did they still just stop anywhere. There are also times where jeeps will take a shortcut if no passengers need to get dropped off along their normal route.</p>
-<p>From what I've seen of the data, they handled the first problem well enough. Stops are defined as where people typically get on the jeep or bus. This is good, but they didn't define a shape for the routes. There is no information as to which exact roads they pass through. All we have to go by are the stops to show the route on a map.</p>
-<p><img alt="sample route" src="http://i.imgur.com/NSVlryE.jpg"></p>
-<p>The problem isn't that bad though. The agencies could still add the shapes later on. Or maybe an app challenge participant could make an app around fixing the routes via crowd-sourcing or similar. The shape itself isn't that important for a rudimentary directions app, but if we want better apps, we will need better data.</p>
-<p>There were also some minor issues with the data itself. Some of the files had extra columns. This normally isn't an issue, but it caused problems for <a href="https://github.com/harrisony/gtfs_SQL_importer">GTFS SQL importer</a>. There were also problems with matching the shape data with the stops when I tried it with <a href="http://onebusaway.org">OneBusAway</a>. They could probably be <a href="https://github.com/OneBusAway/onebusaway-application-modules/wiki/Stop-to-Shape-Matching">fixed</a> but that's for another day.</p>
-            
-    <p>
-        <a href="posts/jeepney-and-bus-routes.html#disqus_thread" data-disqus-identifier="cache/posts/jeepney-and-bus-routes.html">Comments</a>
-
-        </p></div>
     
 <div>
 <ul class="pager clearfix"><li class="previous">

+ 19 - 0
output/index-2.html

@@ -17,6 +17,25 @@
         </li></ul></header><div class="container">
         <div class="content">
             
+        <div class="postbox">
+        <div class="title">
+            <h1><a href="posts/jeepney-and-bus-routes.html">Jeepney and Bus Routes</a>
+            <small>
+                 Posted: 2013-07-07 10:32
+            </small></h1>
+        </div>
+        <p>In the <a href="posts/philippine-transit-app-challenge.html">last post</a>, I talked about how we now have data about jeepney and bus routes in the Philippines. The data is actually in the <a href="https://developers.google.com/transit/gtfs/">GTFS format</a>, which is the format the Google Maps consumes transit data. Apparently, the government will be submitting the GTFS data later this year. Transit directions for Metro Manila in Google Maps would be wonderful. That said, it definitely raises the bar for the app challenge people.</p>
+<p>In the last post, I mentioned the quality of the data isn't quite good. Even before seeing the data, I was already a bit unsure of it. The key problem is how you model the routes. The GTFS format was inherently designed for more well developed and organized transit agencies which isn't exactly what we have in the Philippines now.</p>
+<p>One potential problem is the nature of the jeeps and buses. GTFS routes are a collection of trips which are a sequence of stops. However, we don't have jeepney stops, and even if we did they still just stop anywhere. There are also times where jeeps will take a shortcut if no passengers need to get dropped off along their normal route.</p>
+<p>From what I've seen of the data, they handled the first problem well enough. Stops are defined as where people typically get on the jeep or bus. This is good, but they didn't define a shape for the routes. There is no information as to which exact roads they pass through. All we have to go by are the stops to show the route on a map.</p>
+<p><img alt="sample route" src="http://i.imgur.com/NSVlryE.jpg"></p>
+<p>The problem isn't that bad though. The agencies could still add the shapes later on. Or maybe an app challenge participant could make an app around fixing the routes via crowd-sourcing or similar. The shape itself isn't that important for a rudimentary directions app, but if we want better apps, we will need better data.</p>
+<p>There were also some minor issues with the data itself. Some of the files had extra columns. This normally isn't an issue, but it caused problems for <a href="https://github.com/harrisony/gtfs_SQL_importer">GTFS SQL importer</a>. There were also problems with matching the shape data with the stops when I tried it with <a href="http://onebusaway.org">OneBusAway</a>. They could probably be <a href="https://github.com/OneBusAway/onebusaway-application-modules/wiki/Stop-to-Shape-Matching">fixed</a> but that's for another day.</p>
+            
+    <p>
+        <a href="posts/jeepney-and-bus-routes.html#disqus_thread" data-disqus-identifier="cache/posts/jeepney-and-bus-routes.html">Comments</a>
+
+        </p></div>
         <div class="postbox">
         <div class="title">
             <h1><a href="posts/philippine-transit-app-challenge.html">Philippine Transit App Challenge</a>

+ 19 - 22
output/index.html

@@ -17,6 +17,25 @@
         </li></ul></header><div class="container">
         <div class="content">
             
+        <div class="postbox">
+        <div class="title">
+            <h1><a href="posts/geocoding-services.html">Geocoding Services</a>
+            <small>
+                 Posted: 2013-09-25 12:26
+            </small></h1>
+        </div>
+        <p>A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don't know exactly where their start and end points are on the map. Even then, manually looking for a location on a map is a time-consuming task.</p>
+<p>The gold standard for doing geocoding right now is Google Maps. It's hard to find a better location search experience. If they actually provided routing for jeeps here in the Philippines, I imagine there wouldn't be <em>that</em> much you could do for the competition.</p>
+<p>When the competition started though, I took it as a challenge to avoid Google Maps as much as possible. I wanted to see how much is currently possible with other options such as OpenStreetMap. In fact, OSM does have a geocoding service called <a href="http://nominatim.openstreetmap.org">Nominatim</a>.</p>
+<p>Sadly, for a mapping app, what you want to do is not simply just geocoding. With geocoding, you take an address and turn it into coordinates. When you want to search for a place in a mapping app, you take part of an address, infer the rest of it, and give the user options to choose from.</p>
+<p>Given a typical mapping app, you might type in "ateneo" and expect it to give you Ateneo de Manila University. With typical geocoding services like Nominatim or even Google's <a href="https://developers.google.com/maps/documentation/javascript/geocoding">geocoding API</a>, you probably won't get any result for this. What you want to use is the <a href="https://developers.google.com/maps/documentation/javascript/places">Places API</a> which provides an autocomplete search box. Using it, when you type in "ateneo", it automatically suggests in the dropdown, "Ateneo de Manila University".</p>
+<p>A downside to using the Places API is that it's against the terms of service to use it with something that isn't Google Maps, which means no OpenStreetMap. If there were more time, writing your own autocompletion engine using OpenStreetMap's data will probably be a better long term solution.</p>
+<p>For now, since the competition's deadline is just a few days away, I'll be using Google Maps.</p>
+            
+    <p>
+        <a href="posts/geocoding-services.html#disqus_thread" data-disqus-identifier="cache/posts/geocoding-services.html">Comments</a>
+
+        </p></div>
         <div class="postbox">
         <div class="title">
             <h1><a href="posts/jeep-and-bus-schedules.html">Jeep and Bus Schedules</a>
@@ -113,28 +132,6 @@ sed -i .bak <span class="s1">'/^72/ s/,600/,60/'</span> frequencies.txt
         <a href="posts/graphserver.html#disqus_thread" data-disqus-identifier="cache/posts/graphserver.html">Comments</a>
 
         </p></div>
-        <div class="postbox">
-        <div class="title">
-            <h1><a href="posts/transit-wand.html">Transit Wand</a>
-            <small>
-                 Posted: 2013-07-15 22:45
-            </small></h1>
-        </div>
-        <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>
-<p>You can then use the 6-digit identifier to view the data on Transit Wand's server, which is good since uploading any data automatically deletes it from the phone. There really isn't much else you can do with it though. It just allows you to view the data, and export it as a <a href="https://en.wikipedia.org/wiki/Shapefile">Shapefile</a>.</p>
-<p>As is, this is purely a data collection client-server app. Barring looking at the database, there is no way to get a list of phones which have collected data. Only the person who initiated the data collection knows the 6-digit code to view their data. There's also no way to extract the ridership information from the server yet. This isn't to say that the data won't eventually go public though.</p>
-<p>An interesting thing you <em>can</em> do with the Transit Wand data is import it into GTFS Editor to make a new route. You don't even have to manually download and upload the data. Just type in your 6-digit identifier and it will give you a list of routes you've captured via Transit Wand. This is wonderful as you get all the stop data, as well as the shape of the route.</p>
-<p>I imagine these two tools were how the DOTC came up with all the GTFS data we have now. What I don't understand is why the shape data isn't present. Importing from Transit Wand already gets you shape data. There are even facilities to edit the shape within the editor if clean up is necessary. The only problem I saw was the fact that you can't easily move stops, you have to input coordinates to change the position.</p>
-<p>It <em>might</em> also be possible that when the DOTC was still collecting the data, the route collection or editing features weren't present yet. That would just be lame and depressing though.</p>
-<p>Overall, Transit Wand does what it's supposed to do. You collect data, and then upload it to a server. There is a lot of room for improvement though. It would be nice to have a better API that allows access to more of the data. Building in analysis tools for the ridership data might also be a welcome thing. I imagine it would also be great if you could encourage people to use the app and upload their own trips.</p>
-            
-    <p>
-        <a href="posts/transit-wand.html#disqus_thread" data-disqus-identifier="cache/posts/transit-wand.html">Comments</a>
-
-        </p></div>
     
 <div>
 <ul class="pager clearfix"><li class="next">

+ 78 - 0
output/posts/geocoding-services.html

@@ -0,0 +1,78 @@
+<!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>Geocoding Services | 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>
+    <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></ul></header><div class="container">
+        <div class="content">
+            
+    <div class="postbox">
+    <div class="title">
+        
+    <h1>Geocoding Services</h1>
+
+        <small>
+            Posted: 2013-09-25 12:26
+            
+
+            
+          |  More posts about
+            <a class="tag" href="../categories/philippine-transit-app.html"><span class="badge badge-info">philippine-transit-app</span></a>
+            <a class="tag" href="../categories/programming.html"><span class="badge badge-info">programming</span></a>
+
+        </small>
+    </div>
+    <p>A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don't know exactly where their start and end points are on the map. Even then, manually looking for a location on a map is a time-consuming task.</p>
+<p>The gold standard for doing geocoding right now is Google Maps. It's hard to find a better location search experience. If they actually provided routing for jeeps here in the Philippines, I imagine there wouldn't be <em>that</em> much you could do for the competition.</p>
+<p>When the competition started though, I took it as a challenge to avoid Google Maps as much as possible. I wanted to see how much is currently possible with other options such as OpenStreetMap. In fact, OSM does have a geocoding service called <a href="http://nominatim.openstreetmap.org">Nominatim</a>.</p>
+<p>Sadly, for a mapping app, what you want to do is not simply just geocoding. With geocoding, you take an address and turn it into coordinates. When you want to search for a place in a mapping app, you take part of an address, infer the rest of it, and give the user options to choose from.</p>
+<p>Given a typical mapping app, you might type in "ateneo" and expect it to give you Ateneo de Manila University. With typical geocoding services like Nominatim or even Google's <a href="https://developers.google.com/maps/documentation/javascript/geocoding">geocoding API</a>, you probably won't get any result for this. What you want to use is the <a href="https://developers.google.com/maps/documentation/javascript/places">Places API</a> which provides an autocomplete search box. Using it, when you type in "ateneo", it automatically suggests in the dropdown, "Ateneo de Manila University".</p>
+<p>A downside to using the Places API is that it's against the terms of service to use it with something that isn't Google Maps, which means no OpenStreetMap. If there were more time, writing your own autocompletion engine using OpenStreetMap's data will probably be a better long term solution.</p>
+<p>For now, since the competition's deadline is just a few days away, I'll be using Google Maps.</p>
+    
+    <ul class="pager clearfix"><li class="previous">
+            <a href="jeep-and-bus-schedules.html">← Previous post</a>
+        </li>
+    </ul><div id="disqus_thread"></div>
+        <script type="text/javascript">
+        var disqus_shortname ="pleasantprog";
+            var disqus_url="http://pleasantprogrammer.com/posts/geocoding-services.html";
+        var disqus_title="Geocoding Services";
+        var disqus_identifier="cache/posts/geocoding-services.html";
+        var disqus_config = function () {
+            this.language = "en";
+        };
+        (function() {
+            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+            dsq.src = 'http://' + 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="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+
+    </div>
+
+        </div>
+    </div>
+    <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>

+ 22 - 0
output/posts/geocoding-services.md

@@ -0,0 +1,22 @@
+<!-- 
+.. link: 
+.. description: 
+.. tags: philippine-transit-app, programming
+.. date: 2013/09/25 12:26:59
+.. title: Geocoding Services
+.. slug: geocoding-services
+-->
+
+A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don't know exactly where their start and end points are on the map. Even then, manually looking for a location on a map is a time-consuming task.
+
+The gold standard for doing geocoding right now is Google Maps. It's hard to find a better location search experience. If they actually provided routing for jeeps here in the Philippines, I imagine there wouldn't be *that* much you could do for the competition.
+
+When the competition started though, I took it as a challenge to avoid Google Maps as much as possible. I wanted to see how much is currently possible with other options such as OpenStreetMap. In fact, OSM does have a geocoding service called [Nominatim](http://nominatim.openstreetmap.org).
+
+Sadly, for a mapping app, what you want to do is not simply just geocoding. With geocoding, you take an address and turn it into coordinates. When you want to search for a place in a mapping app, you take part of an address, infer the rest of it, and give the user options to choose from.
+
+Given a typical mapping app, you might type in "ateneo" and expect it to give you Ateneo de Manila University. With typical geocoding services like Nominatim or even Google's [geocoding API](https://developers.google.com/maps/documentation/javascript/geocoding), you probably won't get any result for this. What you want to use is the [Places API](https://developers.google.com/maps/documentation/javascript/places) which provides an autocomplete search box. Using it, when you type in "ateneo", it automatically suggests in the dropdown, "Ateneo de Manila University".
+
+A downside to using the Places API is that it's against the terms of service to use it with something that isn't Google Maps, which means no OpenStreetMap. If there were more time, writing your own autocompletion engine using OpenStreetMap's data will probably be a better long term solution.
+
+For now, since the competition's deadline is just a few days away, I'll be using Google Maps.

+ 3 - 0
output/posts/jeep-and-bus-schedules.html

@@ -57,6 +57,9 @@ sed -i .bak <span class="s1">'/^72/ s/,600/,60/'</span> frequencies.txt
     <ul class="pager clearfix"><li class="previous">
             <a href="highways-in-otp.html">← Previous post</a>
         </li>
+        <li class="next">
+            <a href="geocoding-services.html">Next post →</a>
+        </li>
     </ul><div id="disqus_thread"></div>
         <script type="text/javascript">
         var disqus_shortname ="pleasantprog";

+ 8 - 8
output/rss.xml

@@ -1,5 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
-<rss version="2.0"><channel><title>Pleasant Programmer</title><link>http://pleasantprogrammer.com</link><description></description><lastBuildDate>Fri, 23 Aug 2013 19:07:26 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Jeep and Bus Schedules</title><link>http://pleasantprogrammer.com/posts/jeep-and-bus-schedules.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;
+<rss version="2.0"><channel><title>Pleasant Programmer</title><link>http://pleasantprogrammer.com</link><description></description><lastBuildDate>Wed, 25 Sep 2013 14:47:32 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Geocoding Services</title><link>http://pleasantprogrammer.com/posts/geocoding-services.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don't know exactly where their start and end points are on the map. Even then, manually looking for a location on a map is a time-consuming task.&lt;/p&gt;
+&lt;p&gt;The gold standard for doing geocoding right now is Google Maps. It's hard to find a better location search experience. If they actually provided routing for jeeps here in the Philippines, I imagine there wouldn't be &lt;em&gt;that&lt;/em&gt; much you could do for the competition.&lt;/p&gt;
+&lt;p&gt;When the competition started though, I took it as a challenge to avoid Google Maps as much as possible. I wanted to see how much is currently possible with other options such as OpenStreetMap. In fact, OSM does have a geocoding service called &lt;a href="http://nominatim.openstreetmap.org"&gt;Nominatim&lt;/a&gt;.&lt;/p&gt;
+&lt;p&gt;Sadly, for a mapping app, what you want to do is not simply just geocoding. With geocoding, you take an address and turn it into coordinates. When you want to search for a place in a mapping app, you take part of an address, infer the rest of it, and give the user options to choose from.&lt;/p&gt;
+&lt;p&gt;Given a typical mapping app, you might type in "ateneo" and expect it to give you Ateneo de Manila University. With typical geocoding services like Nominatim or even Google's &lt;a href="https://developers.google.com/maps/documentation/javascript/geocoding"&gt;geocoding API&lt;/a&gt;, you probably won't get any result for this. What you want to use is the &lt;a href="https://developers.google.com/maps/documentation/javascript/places"&gt;Places API&lt;/a&gt; which provides an autocomplete search box. Using it, when you type in "ateneo", it automatically suggests in the dropdown, "Ateneo de Manila University".&lt;/p&gt;
+&lt;p&gt;A downside to using the Places API is that it's against the terms of service to use it with something that isn't Google Maps, which means no OpenStreetMap. If there were more time, writing your own autocompletion engine using OpenStreetMap's data will probably be a better long term solution.&lt;/p&gt;
+&lt;p&gt;For now, since the competition's deadline is just a few days away, I'll be using Google Maps.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/geocoding-services.html</guid><pubDate>Wed, 25 Sep 2013 04:26:59 GMT</pubDate></item><item><title>Jeep and Bus Schedules</title><link>http://pleasantprogrammer.com/posts/jeep-and-bus-schedules.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;
 &lt;p&gt;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.&lt;/p&gt;
 &lt;p&gt;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.&lt;/p&gt;
 &lt;p&gt;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.&lt;/p&gt;
@@ -297,10 +303,4 @@ Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
 &lt;p&gt;It doesn't really handle too many routes passing through a stop. The list just overflows past the bubble. You can still actually read it by panning the map. It's just a bit weird though.&lt;/p&gt;
 &lt;p&gt;If you also noticed, there are usually 2 of each route. This is how the jeepney data was modeled as jeep routes might be different going one way and going back. This isn't the case for all jeeps though, so it might also be an implementation issue with the GTFS editor.&lt;/p&gt;
 &lt;p&gt;&lt;a href="/galleries/transit/onebusaway2.png"&gt;&lt;img alt="OneBusAway" src="/galleries/transit/onebusaway2.png"&gt;&lt;/a&gt;&lt;/p&gt;
-&lt;p&gt;&lt;a href="/galleries/transit/onebusaway3.png"&gt;&lt;img alt="OneBusAway" src="/galleries/transit/onebusaway3.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/one-bus-or-maybe-jeep-away.html</guid><pubDate>Mon, 08 Jul 2013 17:53:59 GMT</pubDate></item><item><title>Jeepney and Bus Routes</title><link>http://pleasantprogrammer.com/posts/jeepney-and-bus-routes.html</link><description>&lt;html&gt;&lt;body&gt;&lt;p&gt;In the &lt;a href="/posts/philippine-transit-app-challenge.html"&gt;last post&lt;/a&gt;, I talked about how we now have data about jeepney and bus routes in the Philippines. The data is actually in the &lt;a href="https://developers.google.com/transit/gtfs/"&gt;GTFS format&lt;/a&gt;, which is the format the Google Maps consumes transit data. Apparently, the government will be submitting the GTFS data later this year. Transit directions for Metro Manila in Google Maps would be wonderful. That said, it definitely raises the bar for the app challenge people.&lt;/p&gt;
-&lt;p&gt;In the last post, I mentioned the quality of the data isn't quite good. Even before seeing the data, I was already a bit unsure of it. The key problem is how you model the routes. The GTFS format was inherently designed for more well developed and organized transit agencies which isn't exactly what we have in the Philippines now.&lt;/p&gt;
-&lt;p&gt;One potential problem is the nature of the jeeps and buses. GTFS routes are a collection of trips which are a sequence of stops. However, we don't have jeepney stops, and even if we did they still just stop anywhere. There are also times where jeeps will take a shortcut if no passengers need to get dropped off along their normal route.&lt;/p&gt;
-&lt;p&gt;From what I've seen of the data, they handled the first problem well enough. Stops are defined as where people typically get on the jeep or bus. This is good, but they didn't define a shape for the routes. There is no information as to which exact roads they pass through. All we have to go by are the stops to show the route on a map.&lt;/p&gt;
-&lt;p&gt;&lt;img alt="sample route" src="http://i.imgur.com/NSVlryE.jpg"&gt;&lt;/p&gt;
-&lt;p&gt;The problem isn't that bad though. The agencies could still add the shapes later on. Or maybe an app challenge participant could make an app around fixing the routes via crowd-sourcing or similar. The shape itself isn't that important for a rudimentary directions app, but if we want better apps, we will need better data.&lt;/p&gt;
-&lt;p&gt;There were also some minor issues with the data itself. Some of the files had extra columns. This normally isn't an issue, but it caused problems for &lt;a href="https://github.com/harrisony/gtfs_SQL_importer"&gt;GTFS SQL importer&lt;/a&gt;. There were also problems with matching the shape data with the stops when I tried it with &lt;a href="http://onebusaway.org"&gt;OneBusAway&lt;/a&gt;. They could probably be &lt;a href="https://github.com/OneBusAway/onebusaway-application-modules/wiki/Stop-to-Shape-Matching"&gt;fixed&lt;/a&gt; but that's for another day.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/jeepney-and-bus-routes.html</guid><pubDate>Sun, 07 Jul 2013 02:32:36 GMT</pubDate></item></channel></rss>
+&lt;p&gt;&lt;a href="/galleries/transit/onebusaway3.png"&gt;&lt;img alt="OneBusAway" src="/galleries/transit/onebusaway3.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description><guid>http://pleasantprogrammer.com/posts/one-bus-or-maybe-jeep-away.html</guid><pubDate>Mon, 08 Jul 2013 17:53:59 GMT</pubDate></item></channel></rss>

+ 21 - 21
output/sitemap.xml

@@ -6,107 +6,107 @@
                         http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  <url>
   <loc>http://pleasantprogrammer.com</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/2013/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/2013/index.html</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/archive.html</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/assets/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/assets/css/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/assets/img/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/assets/js/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/categories/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/categories/index.html</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/categories/lets-debug.html</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/categories/philippine-transit-app.html</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/categories/programming.html</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/galleries/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/galleries/index.html</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/galleries/transit/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/galleries/transit/index.html</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/listings/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/listings/index.html</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/posts/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
  <url>
   <loc>http://pleasantprogrammer.com/uploads/</loc>
-  <lastmod>2013-08-23</lastmod>
+  <lastmod>2013-09-25</lastmod>
   <priority>0.5000</priority>
  </url>
 </urlset>

+ 22 - 0
posts/geocoding-services.md

@@ -0,0 +1,22 @@
+<!-- 
+.. link: 
+.. description: 
+.. tags: philippine-transit-app, programming
+.. date: 2013/09/25 12:26:59
+.. title: Geocoding Services
+.. slug: geocoding-services
+-->
+
+A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don't know exactly where their start and end points are on the map. Even then, manually looking for a location on a map is a time-consuming task.
+
+The gold standard for doing geocoding right now is Google Maps. It's hard to find a better location search experience. If they actually provided routing for jeeps here in the Philippines, I imagine there wouldn't be *that* much you could do for the competition.
+
+When the competition started though, I took it as a challenge to avoid Google Maps as much as possible. I wanted to see how much is currently possible with other options such as OpenStreetMap. In fact, OSM does have a geocoding service called [Nominatim](http://nominatim.openstreetmap.org).
+
+Sadly, for a mapping app, what you want to do is not simply just geocoding. With geocoding, you take an address and turn it into coordinates. When you want to search for a place in a mapping app, you take part of an address, infer the rest of it, and give the user options to choose from.
+
+Given a typical mapping app, you might type in "ateneo" and expect it to give you Ateneo de Manila University. With typical geocoding services like Nominatim or even Google's [geocoding API](https://developers.google.com/maps/documentation/javascript/geocoding), you probably won't get any result for this. What you want to use is the [Places API](https://developers.google.com/maps/documentation/javascript/places) which provides an autocomplete search box. Using it, when you type in "ateneo", it automatically suggests in the dropdown, "Ateneo de Manila University".
+
+A downside to using the Places API is that it's against the terms of service to use it with something that isn't Google Maps, which means no OpenStreetMap. If there were more time, writing your own autocompletion engine using OpenStreetMap's data will probably be a better long term solution.
+
+For now, since the competition's deadline is just a few days away, I'll be using Google Maps.