Feb 06 2009 Fri
7:42 pm PHT
One of the cool things about OpenStreetMap (OSM) is that the data is immediately usable by anyone for any purpose. (See my OpenStreetMap category for other posts about OSM.) An end user can have access to the (massive) raw data and in fact, people have been building tons of applications using it. One of these applications that I’d like to show you is the whimsically-named Yet Another OpenStreetMap Routing Service or YOURS. Check out and play around with the simple-but-cool demonstration website. This demo site is a web application that displays optimal routes between two points you select and was launched last year.
As the full name of YOURS implies, there are already other OSM-based routing services and one of them that has more features is OpenRouteService.org, but that only covers only a few countries in Europe. YOURS, on the other hand, covers the whole world so it’s the only one you can play with right now using Philippine OSM data. I think this makes YOURS the first free routing service that can be used by anyone with an Internet connection. (There are several routable road data of the Philippines elsewhere on the Net—like this Garmin-compatible road database compiled by the
WaypointsDotPH community—but these require that you have a compatible GPS device in the first place.)
The YOURS demo website just simply lets you choose two points, either by clicking on the provided map (after selecting “From” or “To”) or by entering locations into text fields (which will use the OSM name finder service to get the actual coordinates), and then calculates the optimal route, displays the approximate length of the route, and draws that route on the same map. You can then play around with route by reversing the “From” and “To” points or by selecting a new “From” or “To” location while retaining the other point. You can download the resulting route as a GPX file, which can be loaded into GPS devices, or you can use the API, which returns a KML file. There is however no textual directions available (yet), only a sequential set of points.
An example of a route given by YOURS is the one shown above going from my village’s entrance in Las Piñas to Palma Hall in U.P. Diliman. (The image is a link to the demo website route result.) The routing service only relies on the road topology (which includes road classification) and uses no other data (such as traffic conditions), so it calculates the optimal route assuming that there is no traffic and no toll fees. (Imagine driving around Metro Manila during the Holy Week vacation late at night.) Keeping that assumption in mind, I definitely agree that the route is indeed the optimal one; it goes west along Alabang-Zapote Road, north via Coastal Road and Roxas Blvd, turning east to EDSA then East Avenue, and then counterclockwise along Elliptical Road before going into U.P. via Philcoa.
The routing engine also considers one-way streets and some turn restrictions (like no U-turns and no left turns) in its computation. But since the data for the Philippines doesn’t yet have extensive data on turn restrictions, the second example above shows a route that considers one-way streets. Here it shows the route going from the driveway outside Glorietta 1 to the Glorietta 3 carpark; it correctly considers the one-way restrictions around Glorietta.
OpenStreetMappers have been using YOURS as a debugging tool for correcting routing-related data in the OSM database. I’ve used it quite often to fix road information such as the one error where the northbound side of Guadalupe Bridge on EDSA was indicated as going southbound. (Because of that data bug, the route that was given in my first example—Las Piñas to U.P.—made a huge detour via SLEX, Quirino Avenue, Nagtahan, and Aurora Boulevard.) In other cases where the data appears correct, seemingly wrong routes may mean that the routing engine has a bug or that it needs more fine tuning. I’ve submitted a couple reports of such suboptimal routes at the YOURS/weird routes wiki page.
Go ahead and try it! I’ve wasted one evening just playing around with various routes.