Tutorial 3: Geocoding Collection Data for Use with Simile Exhibit

This recipe builds from the more general Tutorial 2 for using Simile Exhibit.

It employs the metaphor of a recipe, a technique for sharing technological processes in a familiar and approachable way explained in a paper I presented at the 2006 CaSTA Conference.

There are a variety of services you can use to geocode location metadata. If you have a column representing location metadata associated with your digital objects one of the simplest tools is a Google Sheets Add-in Geocode by Awesome Table.

One important point to be aware of when using Google-based tools is that it uses your Google account information and limits you to only 1,000 requests per day.

However, if you have a reference in your metadata to location, whether it is a place name, an address or otherwise, we need to associate this will latitude and longitudinal reference for each location to be able to represent it spatially.

Due to the limitation on geocode requests and also to ensure accuracy it is essential that you normalise and regularise the location data you have prior to carrying out the geocoding task. Depending on the volume of references you have this could be accomplished as easily as sorting the location column alphabetically and adjusting values manually.

The Recipe

This is a recipe to geocode location metadata so that it can be displayed visually on a map.

Ingredients

  1. A Dataset (a tabular collection of objects and their associated metadata)
  2. A Google Account
  3. An exhibit as discussed in Recipe: A Lightweight Framework to Present Digital Collections
  4. The Geocode Add-On for Google Sheets

Steps

Prepare the Data

  1. Open your datafile in Excel or Google Docs. If you prefer to work in Excel do so and simply upload the finished datatable to Google Docs when you have finished the steps below. To share the file it must be accessible in your GoogleDocs Drive.
  2. Install the Geocode Add-On from Awesome Table by Going to the Add-On Menu and Choosing Get Add-Ons…

Screenshot 2016-06-02 08.35.24

  1. Choose Start Geocoding … from the Add-On menu.
  2. From the sidebar presented choose the column name corresponding to your location data.

Screenshot 2016-06-02 08.39.47

  1. Push that Geocode! button.

The Add-On will create two new columns in your spreadsheet adjacent to the location column you specify. It will then begin to populate these with Latitude and Longitude data. Despite the seeming magic, there will undoubtedly be instances where the Add-On cannot find corresponding LatLng data, or will identify and erroneous match.

  1. When the Add-On has completed – you can watch the progress report as it indicates how many locations it has coded – you should check your results for accuracy and completeness.

Publish your Data

  1. To make the data accessible for Exhibit to use we need to create a new column and label it {latlng:text}.
  2. Populate this column by combining the values in the Latitude column with the Longitude column and separating them with a “,”.
  3. Assuming that you are using the spreadsheet you previously used to create the collection exhibit, the column is now immediately available to the exhibit. Otherwise, follow the steps below to public it to the web.

Publish your Google Docs Spreadsheet for the Web.

You will find Publish to the Web … under the File menu in Google Docs. Clicking Publish will make your data machine accessible. This does not mean that it will appear in Google searches. However, the URL that will result can be entered into a browser and your data will be presented in a tabular format.

  1. Copy the URL that is presented when you click publish.

Screenshot 2016-06-01 14.18.57

  1. Paste the URL into the box presented on the web page at: SheetstoJSON http://projects.csail.mit.edu/exhibit/googleJSON/ and click the submit button.

Screenshot 2016-06-01 14.23.38

  1. When you click submit the page will inform you that “Looks like there are multiple sheets in that spreadsheet. Which do you want to use?” This is normal. If you have a single worksheet in your Google Doc just click the second submit button. Otherwise choose from the available sheets that it finds and then click the submit button.
  2. You will then get a final usable URL for use with your Exhibit. It will be labelled as Output URL: This is the one to now copy for use to present your data. Copy this URL.Screenshot 2016-06-01 14.28.15

Modify the Exhibit Code to Add a Map View

  1. Open the HTML template for Exhibits – exhibitSimple.html if it is not already open.
  2. Find the text in this template file “<!– Remove these comments to make the Map View Active”.
  3. Carefully remove the text above so that the line starts with <div>. Also remove the closing –> after the next </div> statement. Your code should then look something like this:

Screenshot 2016-06-02 09.04.58

  1. Save the html file and copy it to your server (replacing the existing exhibit file if necessary).
  2. Reload the file in your web browser. You should see a resulting map view in addition to any views you created previously.

Screenshot 2016-06-02 09.09.12

Troubleshooting and Cleaning

  1. Exhibit will warn you whether there is data which cannot be plotted on the map. This may result from missing values or from values that are not decipherable by the geoparser. Exhibit is actually a very useful data troubleshooting tool in its own regard. Note the statement immediately above the map telling us in this instance that ‘385 results out of 684 cannot be plotted.” You can click on this link itself and see the suspect records. This can be a laborious process, but exhibit will quickly highlight where you need to look to start to fix the location references.

What you now have however is a powerful and engaging view of your digital objects presented on a zoomable, scrollable and interactive spatial visualisation. You may now wish to explore adding additional views in some of the recipes listed blow.

Glossary

Discussion

Further Information

  1. Simile Exhibit Wiki
  2. Exhibit Google Discussion Forums
  3. Google JSON Decoder
  4. Tutorial 1
  5. Tutorial 2 (More recent and further ranging including the Google Sheets Step!)