Thursday, January 31, 2013

Getting Australian POIs from Sensis API

The App

Over the last X-mas/New Year break, I wrote a simple Web app to search for Australian Points-Of-Interest (POIs), such as toilets, petrol stations, rest areas, picnic grounds, hospitals, etc. Other than petrol stations (considered as "business" listings), the rest are mostly non-business entities.

Here is the URL of the app:

This web app works on desktop PCs and tablets with the following browsers:- Firefox, Chrome, Safari or the Android default browser. There is also an Android application Aus Pois that renders the JSON feed from this web app.

The Algorithm

This app gets the POI data from the Sensis API (SAPI). This is the same API that powers the Australian Yellow Pages website. Here's the URL to get the nearest POIs within 2 kms of the location, with Category Id 1007397:,145.21661812353523&radius=2&sortBy=DISTANCE_ALL_PAGES&sensitiveCategories=true&categoryId=1007397&includePois=true&key=(SAPI key)

As stated above, petrol stations are considered normal business listings rather than POIs in SAPI, but they can be retrieved together as the real POIs simply by specifying the category ID for "Service Station" in the URL.

The Technology

The Web front-end is done with Google Maps (plus the geometry library), HTML5 (for geolocation and storage) and lots of jQuery goodness.

The server-side logic is implemented on top of Gaelyk, a really cool Groovy framework that allows for almost seamless deployment of the app to Google App Engine.