Retrieving Historical Aerial Photography

Stephen Duncanson
November 29, 2019

What?

Hap.py is a python program I wrote which accepts a Connecticut state address and returns all available aerial photography over that location.

Why?

The first implementation of hap.py was written during the summer of 2019 while I was an intern at RACE Coastal Engineering. Historical photography is very important to Engineering companies: It gets used for everything from permiting to assembling bidding packages. Unfortunatly the interactive maps hosted by UConn MAGIC (Map and Geographic Information Center), were (are?) broken. I took it upon myself to write a program which would accept an address and return the associated aerial photography.

While on winter break I thought it would be a good idea to expand on my idea and create a way for anyone to access historical photography.

How? (technical brief)

Parsing .kml files, creating a list of tuples: ((lat,long),url-to-pdf) for each year, geocoding an entered address and using kdtrees to do time efficient nearest neighbor lookup between the geocoded address and the coordinates ripped (and corrected!) from the .kml files.

If you want the long version, read on!
If you just want to look at the code, view on Github.

History & KML Parsing

What is a kml file?

According to the Google developer documentation, "KML is a file format used to display geographic data in an Earth browser such as Google Earth."

An example is shown below.

Extruded polygons and placemarks on the Google campus. Source: SamplesInEarth.kml

We have seen how KML files look when opened with Google earth, but what do these files look like on a more fundamental level?

Below is a screenshot of an average KML file opened with the MacOS TextEdit program.

A KML file opened with the TextEdit program. Ignore the red underlines.

Again quoting from Google here: "KML uses a tag-based structure with nested elements and attributes and is based on the XML standard. All tags are case-sensitive and must appear exactly as they are listed in the KML Reference. The Reference indicates which tags are optional. Within a given element, tags must appear in the order shown in the Reference."

Why are we talking about KML files?

As I stated above the interactive maps hosted by UConn MAGIC are broken, yet the KML files which serve as the source material for them are free and easily available. To create a program which can retrieve histroical photography we must first extract pertinent information from these files.

The UConn MAGIC site contains 11 aerial photography surveys of the state, and 3 at a county level:

This program will focus on the statewide surveys. The reduction process for each state survey KML file is detailed below.

1934

1952

1965

1970

1986

1990

1995

2004

2006

2008

2010

Next Steps

There are a ton of ways to expand upon this. I list some of these below:

  1. Setting up the Raspberry Pi. Eventually I would like to run these bots off of my raspberry pi for 24/7 uptime.
  2. Improved web interface. I happen to be a very poor web developer. I would love to see what a real developer could do with this idea. Interactive maps?
  3. Historical flight simulator. Google earth includes a flight simulator mode! The images could be downloaded en masse, stitched togehter, and overlayed onto google earth and released as a .kml file.
  4. Better KML parsing with pyKML. Pretty self explanatory. The pyKML package provides better tools to parse .kml files. Using this library would be much better than using my 'spit-and-prayers' parsing tools.

Home