Today’s entry is pretty cool. I came across the urbarama site, which describes itself as “a collaborative world atlas of architecture and civil infrastructure”. What’s more it has an API, which will return details on closeby projects given a geographic reference point. For more detailed information and for downloads see the excel liberation site.
So let’s start with the rest library entry – pretty straightforward (for details on this see the rest library overview)
.add “restType”, erRestType.erSingleQuery
.add “url”, “http://www.urbarama.com/api/project?sort=popular&offset=0&count=100&size=small&format=json”
.add “results”, “projects”
.add “treeSearch”, True
.add “ignore”, vbNullString
w = cj.add(“urbarama”);
w.add (“restType”, ERRESTTYPE.erSingleQuery);
w.add (“url”, “http://www.urbarama.com/api/project?sort=popular&offset=0&count=100&size=small&format=json”);
w.add (“results”, “projects”);
w.add (“treeSearch”, true);
However, the thing here is that the parameters required are kind of funky. Essentially a minimum and maximum longitude and latitude. I though I may as well mash this up with the already existing yahoo geocode library entry and make a proper job of it. So now, the UI for this mashup will ask for a place, an area to look in, and will populate a spreadsheet with information about and location of qualifying items from the urbarama database. Naturally this then provides a nice list from which to generate a map, and data with which to populate the infoboxes. That’s for another day.
There were a few things to figure out to get all this to work, not least how to calculate a latitude/longtitude given a distance and a heading, but the final fits together quite well. Here’s a snippet of the output.
and here’s the test code. You can get the whole thing on the excel liberation site.