Posts tagged Grand Rapids
Scraping Grand Rapids bus routes
Sep 25th
The Rapid, the bus service for Grand Rapids and surrounding areas, recently redesigned their website. The redesign was long overdue and the result certainly looks a lot cleaner, if still far from inspiring. They’ve added a flash-based map showing their routes (though it could do with being a little larger on the page) and added PDF maps of each route (eg. this one for Route 6). Unfortunately as yet there’s no tool for working out routes, but that’s not a big surprise.
My favourite features, however, are not any of those mentioned above but the fact that each route now has a clean URL (eg. http://www.ridetherapid.org/ride/routes/6/) and a link to google maps for each stop, thereby exposing the coordinates of all the stops. With those two components in place, it becomes very easy to pull out the route data and begin to apply it to other uses. A ruby script (using _why’s excellent hpricot) to do just that would be:
#!/usr/bin/env ruby require 'rubygems' require 'open-uri' require 'hpricot' routes = (1..15).to_a.concat [24,28,37,44,49,50,51] routes.each do |route| begin route_uri = "http://www.ridetherapid.org/ride/routes/#{route}/stops/" doc = Hpricot(open(route_uri)) title = doc.at("h1").children[0].to_s.strip puts title stopList = doc.search("div#stopList table tr") (1..stopList.size).each do |row| unless stopList[row].nil? uri = stopList[row].at("a").attributes['href'] name = stopList[row].at("a").children[0].to_s coords = uri.match(/q=(\d+\.\d+),\+(.*?)\&/) if coords.class == MatchData latitude = coords[1] longitude = coords[2] puts "#{name} on route #{route} is at #{latitude}, #{longitude}" end end end rescue => err puts "Problem retrieving #{route_uri}" end end
With this data available, it immediately becomes possible for local people and organizations to make use of it in a variety of ways–businesses could easily show the nearest bus stops to their locations, listing services can help visitors plan their routes, and those of us who aren’t fans of the flash-map could use other services to build alternatives.
Grand Rapids GIS
Aug 11th
A couple of weeks ago I attended my first Grand Rapids Perl Mongers meeting in order to hear a presentation about the City of Grand Rapids‘ efforts to build a GIS driven by perl and hosted on linux. The presentation was interesting, though the coverage of the technology used didn’t dig much deeper than “we used perl and linux because they’re free and we had staff who advocated them” and “this is all done in perl,” and I didn’t get a sense of a broad vision for the future potential of such a system (by contrast, the Mayor’s speech when launching the latest phase of citywide WiFi testing demonstrated a broad vision for enhancing city services through the use of pervasive technology).
My main interest in the city’s GIS is the potential of opening up city information for use by community organisations in location-aware applications. There is potentially considerable benefit for community organisations in being able to integrate with the city’s databases in order to pull out information about issues that affect their constituency (road closures, zoning hearings, etc) and for businesses in being able to integrate with details such as public transport stops and routes. I’m also interested in using it as a backbone for more participatory politics tools, as keeping track of ward boundaries can be a tricky process and is best managed in one place.
Sadly my questions regarding web services hooks for the GIS were met with a response that I could get hold of my own map data from their source, which wasn’t really what I was going for. I’ve followed up with emails, and hopefully will hear more soon, but don’t hold out much hope that there will be any potential for integration any time soon. It is frustrating that a relatively recently built system using tools which are touted in part for thei “open source” credentials should lack interfaces which needn’t be hard to implement and that would encourage a much broader uptake of the system to build a rich information environment.
Google Maps and Grand Rapids WiFi
May 19th
For the past few weeks I’ve been meaning to play with myGmaps, and last night I finally got the opportunity. I’d introduced a map view to Grand Rapids WiFi a few months ago, but I’ve never been entirely satisfied with the map in use or the flexibility of the zoom, so I decided to explore what it would take to move that data onto a google map.
Generating the required XML was very straightforward. Between this piece at Engadget and the tools at myGmaps it was very simple to add a new Smarty template to the site and get everything up and running. It’s a shame google didn’t go with some more standardised vocabularies (it would be wonderful to be able to pipe the existing RDF version of the site straight in), but at least the format is simple.
What I did find, however, was that my browsers quickly became unstable. I’d never seen Firefox’s “A script is making Firefox become very slow, should I terminate it?” warning before last night, but plotting around 40 points on such a map triggered it. Reducing that to five points with an SQL LIMIT helped considerably, but at the cost of much of the map’s utility. The full maps is nice, but nowhere near stable enough to make a regular part of the site (I may put a link to it, but it will be with provisos).
I hope there’s a way to reduce the weight of this toolkit, as it’s definitely a far better map. If google were to launch a public API, perhaps we could start building more advanced applications which integrate directions and other tools. For now, it’s back to the drawing board for me, to try and work out a UI that lets me reduce the number of points plotted while still being useful for the user.
For those with plenty of RAM, you can find the full map at grwifi.net/gmaps/.