At the Erewhon workshop in December we asked people to choose/suggest applications for geodata. One of the favourites was: “Find the nearest copy of a book from a reading list (bearing in mind which libraries you can use, and the opening hours of libraries)” so we decided to use this as an example of how we’d begin to use Oxpoints data to enhance other services.
- Locations of many libraries already in Oxpoints data
- A list of all libraries, with unique codes
- Search results pages on OLIS (Oxford’s OPAC), conveniently including library codes (below)
We couldn’t easily get hold of the patron data (i.e. which libraries a user has access to), and the opening hours looked fairly indigestible in their current form (see example); so we decided to leave these out of this mashup.
We boiled down the list of libraries until it was reduced to just a name and a code for each library, simply structured:
then we worked out how the libraries’ unique identifiers corresponded to ours, and mixed these into the Oxpoints data. A lot of the mixing had to be done by hand, but we’re talking about a comparatively small dataset, and humans are good at fuzzy matching.
BLL Main Libr gets turned into http://maps.google.co.uk/?z=16&q=http://m.ox.ac.uk/oxpoints/Library/BLL+Main+Libr.kml
So far so good: this saves the user clicking through another couple of pages to the ‘information’ page for each individual library (which gives a street address, though not a map). But it doesn’t let the user compare library locations easily; clearly we had to show all the library locations on the same map, and if we were going to include any more information than just the basic location, we needed a bit more control over the display — which meant using the Maps API rather than the public Google Maps.
Just one thing missing: where are you? Time for a bit more magic from the Google labs: the Google Gears Geolocation API lets you get the user’s latitude and longitude (if they allow Gears to access this information). This allowed us to add a ‘you are here’ marker to our map:
Of course, for a real application there would be lots of better ways to get the user’s location (native GPS on mobile devices; on desktop machines, the ability to set your own location); the map links would be built in to the search results pages rather than scripted in with Greasemonkey; we’d have more information about the libraries the user was allowed to access and consumable feeds of library opening hours, so that ‘availability’ wasn’t just a simple lookup but a calculation based on all those factors… but nonetheless this quick prototype mashup shows how far it’s possible to get without any of these things.
Here’s the Greasemonkey script: http://www.oucs.ox.ac.uk/oxpoints/olismapall.user.js