Google Cartography

car·tog·ra·phy n. The art or technique of making maps or charts.

Google Cartography uses the Google Search API to build a visual representation of the interconnectivity of streets in an area.

This application takes a starting street and finds streets which intersect with it. Traversing the streets in a breadth-first manner, further intersections are discovered. Eventually a connected graph is produced showing the interconnectivity of streets flowing from the starting street.

Example Graphs

Below are some example applets showing the data collected on two of the world's great cities. The data used is collected verbatim from the the full applet below. If you know the streets in the areas shown, you will be able to find inconsistencies introduced by the text parsing process. These graphs are kept small for easy viewing. It is possible to produce considerably more detailed graphs by using more Google API juice than was used to collect the example data.

You require a recent version of the java plugin (1.3.x is NOT new enough). You can download the JRE which includes the java plugin here.

 

Give it a try

If you have your own Google key (or get one from the Google API page by creating a Google account) you can run the applet against a street of your choice.

You require a recent version of the java plugin (1.3.x is NOT new enough). You can download the JRE which includes the java plugin here.

Be warned: The applet may use large amounts of bandwidth depending on the parameters you enter.

 

Description

Google Cartography uses the Google API to find web pages referring to street names. Initial street and region criteria are combined to form a search query, which is then executed by the Google API. Each URL from the Google results is fetched and the content of the pages converted into text. The text is then processed using regular expressions designed to capture information relating to the relationship between streets (for example, streets that cross each other or turn into other streets).

For each page a list of vertices is produced where each vertix represents an intersection between two streets. After the results for the initial street have been processed, the list of vertices will hopefully contain some vertices which are intersections with the initial street.

At this point the mapper performs a breadth-first search through the streets that can be reached from the initial street. Each street traversed during this process is subjected to the same process as the initial street, expanding the list of known street intersections. This process continues until no more streets can be reached from the initial street or until the halting criteria is satisfied (for instance, in reaching the maximum amount of Google API key usage).

Once the data collection phase has completed, the intersection vertices are converted into a graph. Each street becomes a vertix of its own, with outgoing edges connecting to the vertices of intersecting streets. The connectivity of this graph is analyzed (using the Jung graph package) to determine the largest maximal subgraph where all pairs of vertices are reachable from each other. This subgraph almost always contains the starting street; the probability of this not occurring should decrease proportionally to the number of streets traversed (which naturally selects for streets that are in the same subgraph as the starting street).

The largest connected subgraph is then visualized using a Radial Layout algorithm provided by the Prefuse graph visualization framework. The graph is initially centered on the start street but will automatically adjust its focus to center around the most recently selected street.

Issues

Ignoring its general lack of usefulness, there are several problems with the current application:

To do

Acknowledgements

Google Cartography relies on several external libraries.