Reverse geocode spreadsheet coordinates using geocoder and pandas

I had a spreadsheet of coordinates, along with their addresses. The addresses were either inaccurate or missing. Without access to an ArcGIS licence, and knowing the addresses were not available on our enterprise geocoding service, I sought to find a quicker (and open-source) way.


import geocoder
import pandas as pd
xls = r'C:\Some\Arb\Folder\coords.xls'
out_xls = r'C:\Some\Arb\Folder\geocoded.xls'
df = pd.read_excel(xls)
for index, row in df.iterrows():
g = geocoder.google([row[3], row[2]], method='reverse')
df.set_value(index, 'Street Address', g.address)
df.to_excel(out_xls, 'Geocoded')

I used the geocoder library to do this. I used it previously when I still had an ArcGIS Online account and a Bing key to check geocoding accuracy amongst the three providers.

Since I don’t have those luxuries anymore, I used pandas to read in the spreadsheet and reverse geocode the coordinates found in the the third and fourth columns. I then added a new column to the data frame to contain the returned address, and copied the data frame to a new spreadsheet.

Uploading and embedding an unlisted YouTube video into a SharePoint site

This doesn’t have anything to do with GIS necessarily, but often I find that in the course of my work I have to do these arbitrary tasks which support our bigger projects. After having previously uploaded certain project video files in a document library on SharePoint, that didn’t seem to be the best way to do it.

After some thinking and Googling, I found that uploading the videos to YouTube and embedding it on a SharePoint wiki page would be the best option. While the videos do not contain sensitive information, we tend to err on the side of caution, so I researched how to make the videos private.

That’s how I came across the unlisted option. After uploading the videos and marking them as unlisted, I then embedded each video into a 3-column wiki page on the SharePoint site using the YouTube embed code.

This process was tedious though. I had to perform this task again recently for a different site. This created a problem in several ways:

  1. There were now videos for two different projects attached to the account. The amount of projects will probably increase in the future
  2. I would need to tag, rename and edit each video description separately (for 22 videos)
  3. Embedding each individual video would be a pain

I fixed number 2 quickly by changing the video upload defaults, so that during a batch upload each video would retain its name, get the correct description and tags, be marked as unlisted and categorised correctly.

I fixed numbers 1 and 3 by creating an unlisted playlist. After creating the playlist, I added the videos in the order I wanted, grabbed the embed code and pasted it into my SharePoint page.