RSS
 

O Wiki, Where Art Thou?

17 Nov

Online mapping applications are a pretty huge thing these days. A sixteen year old girl recently asked me how we got directions in the “Olden Days”. Keep in mind that i’m 24 years old and don’t consider any part of my lifetime to be in the “Olden Days”. That aside, I listed the steps to her as so:

  • Get your phone book.
  • Use the YellowPages to get the phone number of the place you want to go.
  • Call them and ask for directions
  • Write down what they say.

Her: “You had to have a phonebook in your house?
Me: “…………………yeah”

It got even more hilarious when I tried to explain how maps were used.

I said “You would get the grid coordinates for the street from the chart in the back, You know like b-4.”
She blinked repeatedly then smiled.

My point here is that Googlemaps(and similar webapps) are a part of most people’s lives. This technology is here to stay and is going to keep advancing. One of the newest features is centered around Wikipedia’s GeoTags.

A large number of Wiki articles now display the geographic coordinates in the top right corner of the page. This obviously represents the location of whatever the article is about.

GoogleMaps has implemented this into their app through what they call the Wikipedia Layer. It displays a Wiki logo for all articles GeoTagged within the view of the map. Clicking the logo shows a description of the article.

Aside from “Wow, that’s cool.” The first thing i thought when i saw this was “How can I make my apps do this?”

I came up with two useful methods.

Parsing the Wikipedia does not seem like the most difficult thing in the world to me, but Geonames provides a very easy to use java api. I’m talking this easy:

Double lat = 41.2856;

Double lon = -81.4011;
List <WikipediaArticle> list = WebService.findNearbyWikipedia(lat,lon,”en”);

Now there is only one problem with this. GeoNames will only let you hit the webservice 50,000 times a day from a given ip address. After that it will throw an exception. Let’s say we’re trying to write an iPhone app that utilizes this data. If there is a chance you will eventually begin hitting this limit I would do this.

  • Create a Servlet that essentially is a wrapper on the Geonames service. This, first and foremost allows us to keep most of the task-specific processing off the the mobile device and on the server. Secondly, if we begin hitting the the 50,000 request limit, we can switch to parsing the Wikipedia data our self without any change to the client code. Lastly, if we decide to port this app to devices other than the iPhone(i.e. Android, Blackberry, Palm, etc) this will slightly ease the process.

    In Conclusion:
    It’s 12:03 AM, do you know where your Wiki is?

 
No Comments

Posted in General

 

Leave a Reply