Hap.py is a python program I wrote which accepts a Connecticut state address and returns all available aerial photography over that location.
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.
Parsing .kml files, creating a list of tuples:
If you want the long version, read on!
If you just want to look at the code, view on Github.
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.
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.
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."
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.
There are a ton of ways to expand upon this. I list some of these below: