Contains two components:
- Javascript code to download Google Location History (kml) for multiple days
- Python importer that loads kml data from Google Location History into a Postgres database
In order to download kml files for multiple days containing the location history of a user, log into the users account on Google Maps. Copy the Javascript code in the file "downloadLocationHistory.js" into the console in your browser and modify the start and end date variables. Execute the code. Fetch your files in the download folder.
To import trips into a postgres DB do the following:
- Create a subdirectory "kml". Inside this folder you create a folder for each user and place his/her kml files inside the folder.
- Set the DB credentials in config.py
- Execute upload_trips.py to run the import
Optionally merge_trips.py can be used to join trips ("activities") that occured very close together in time.