Geolocations

In order to map the locations of the priests according to the diocese to which they belonged, it is necessary to obtain geolocations of the diocese.  In particular, this requires finding the latitude and longitude for each diocese.  Fortunately, geonames.org is a geographical database that contains, among other information, the latitude and longitude of cities throughout the world.  In addition, GeoNames allows the names of cities to be queried in any language; this is particularly useful in this instance because the city names are all in German.  

In order to use GeoNames, I obtained a GeoNames user account, which allowed me to query the database.  I also found a Python package called GeoCoder that significantly simplifies the querying process.  In particular, the information on a city is returned in a simple JSON format ideal for extracting latitude and longitude.  This enabled me to write a short python script to query the GeoNames database for the latitude and longitude of each diocese in the CSV file and add them to the CSV file as new data fields.

Here is my python script, embedded as a Jupyter notebook: