Monday, March 29, 2010

Geographic Data in Open Format

This was one of my earlier attempts to provide geographic data in an open format. Ruby on Rails makes this one a snap.

Just for an example, let’s say you want to search for all the surveys with the word “hill” or “dale” in them. Like most websites, you can go to the home page and navigate to some specific search. Here’s the link: http://uber.summitengineer.net/survey_surveys/

Just type “hill dale” in the search box as usual, but watch down below the box, where it starts flashing blue. Notice that it’s composing a URL for that search? So, http://uber.summitengineer.net/survey_surveys/surveys/hill_dale/_/_/_/_/ is a URL for a search for “%hill%” or “%dale%” Whether you click the “Search” button or the link, the result is the same: your browser displays the results of that URL.

Notice that the results are grouped down the left side by community. There are some other conveniences – clicking a balloon on the map highlights the corresponding row in the table, and vice versa. Without that, it’s really a pain to link up the two in your mind.

So, it’s pretty easy to:
  • Bookmark a search so you can rerun it whenever you like. 
  • Compose a new search, even without going to the “start page”
  • Read the URL and know what you searched for
Searching in a map area is almost as simple. Go back to http://uber.summitengineer.net/survey_surveys/ and click on the map: “Limits On/Off”. A search box appears, but did you also notice the URL gets composed just like for a text search? If you play with the box by dragging the red balloons, you can adjust the geographic search area. For instance, just draw the box around the word “Hudson” on the map: you’ll get a URL like http://uber.summitengineer.net/survey_surveys/surveys/_/41_221/41_243/-81_468/-81_409/ . You can see that the latitude and longitude of the corners are in the URL. If you click that link, you’ll get a map of the surveys around Hudson. (Click “Zoom Limits” to zoom in on your search box.)

Now, to this point it is just a convenient way compose, store, and communicate live searches. However, since the URL is “guessable,” you don’t have to go to the landing page at all. In fact, you don’t even need to see the HTML page we render for humans. For that matter, you really don’t need a human involved at all.

Your system could just as easily compose a search for a term, or for an area. If your system adds “.xml” to the URL like http://uber.summitengineer.net/survey_surveys/surveys/_/41_221/41_243/-81_468/-81_409.xml/ , the results come back in a machine readable format.

In the future, we’ll be adding “.shp” for a shapefile download, and “.kml” for KML. Some of our applications support “.xls,” but Internet Explorer caused an instability and we had to drop that option.

No comments:

Post a Comment