Skip to content

Converts google timeline day data files (KML) into a single CSV file

Notifications You must be signed in to change notification settings

nerik/google-timeline-to-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-timeline-to-csv

Converts Google Timeline data to CSV. This allows temporal analysis of the data, with CartoDB's Torque for instance. It can handle multiple individual day files and merge them as one CSV file, or one single Takeout KML file. Note: this might be possible using ogr2ogr, but not out of the box AFAIK (using some KML driver). A simple customized node script seemed a faster and saner way.

Check out the demo on CartoDB.

Usage

  • Go on the Google Timeline page

  • Download the kml files for each day you need (select a day, click on the cog icon on the bottom right, choose 'Export this day to KML'), or download your whole history as a single kml file.

  • clone this repo and install dependencies :

npm i
  • Run the script :
./index.js [directory containing individual day files] > target_file.csv
./index.js [single kml file] > target_file.csv
  • Import to CartoDB

  • Have fun :) (remember that there is a limit of 500k rows per table by default)

You might run into memory errors like:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

As suggested by @JPvRiel. Try increasing the default node heap size, e.g. using node --max-old-space-size=8192 index.js ...

About

Converts google timeline day data files (KML) into a single CSV file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages