Thursday, July 2nd, 2009
GeoMaker – geo locations as microformats or a map from texts or URLs
<p>As preparation for an upcoming tech talk about Placemaker I thought it would be good to take a bit of the pain out of the geolocation service by making an interface for it. Placemaker works the following way: you post some content or a URL to it, it goes through the content or gets the content from the URL and analyzes it. It then finds geographical locations in the text and disambiguates them (for example to skip names like "Jack London" and not consider it the city London). Finally you get it back as XML.The annoying thing is that Placemaker only support POST request and does not have a JSON output - for now. GeoMaker allows non-developers to enter some text or a URL, filter the results (using YUI datatable) to remove false positives (no system is perfect) and get the embed code for a Yahoo Map or a list of microformatted locations as copy+paste. See the screencast to get the end user experience:
Of course, every time you build something like that, red-blooded developers will ask for an API to do the same thing (and pointing them to Placemaker wasn't enough). So here it is:
http://icant.co.uk/geomaker/api.php takes two parameters: url of the web document to load and output which could be map, kml, microformats, csv, or json (with callback for JSON-P). Using this you can analyze a url in JavaScript and get the data back as an array:
The Ajaxian.com output right now would be:
-
geomaker(
-
[
-
{"lat":"42.3586","lon":"-71.0567",
-
"title":"Boston, MA, US","match":"Boston"},
-
{"lat":"42.3586","lon":"-71.0567",
-
"title":"Boston, MA, US","match":"Boston, MA"},
-
{"lat":"40.7075","lon":"-106.918","title":"Clark, CO, US",
-
"match":"Clark, Co"},
-
{"lat":"42.3115","lon":"43.3658","title":"Georgia",
-
"match":"Geo"},
-
{"lat":"44.9601","lon":"7.16229",
-
"title":"Rey, Piedmont, IT","match":"Rey"}
-
])
-
Related Content:











Sometimes the length of the representation of geo locations also matters e.g. in Twitter messages. Therefore I would like to represent a solution for this:
The service Twittori uses a modified Geohash algorithm (see Wikipedia for details) to create very short URL which just consume 6 characters to represent a geo location. Here is an example: http://GE0.at/0GGmJW.
This could be an alternative for other services too, to not need to use the TinyURL services for geo location purposes in Twitter.
Freaky timing – just the other day I was just talking about how useful a service like this would be to Ubiquity. Anyway, looks very promising!