Giter VIP home page Giter VIP logo

google-location-history-converter's Introduction

google-location-history-converter

  • Description The Google Location History converter is a command line tool that converts the JSON that Google makes available via their Takeout interface, and converts it into KML that works with Exiftool to geolocate your images. If you have a higher end camera, it probably doesn't have a GPS built in, but you likely have your phone with you.

  • Instructions

  1. Enable Google Location History on your phone
  2. Download your Google Location History from Google Takeout
    1. Go to https://takeout.google.com
    2. Under "Create a new export" select the data you wish to include, in our case we want to click "Deselect All" and then find "Location History (Timeline)", and then select just that checkbox. Don't worry about "Multiple formats", it seems that Google only allows you to download JSON now.
    3. Once you have selected that checkbox, the "Next step" button should now be clickable, click the "Next stop" button.
    4. You will now be presented with the "2 Choose file type, frequency & destination" set of options. I leave destination as "Send download link via email", and Frequency as "Export once", I change "File type" to be .tgz and leave the "File size" alone at 50g.
    5. Click "Create export"
    6. Your export will now be in progress, and there will be a message at the bottom saying that Google is creating a copy of your data. You will now need to wait until Google notifties you that your data is ready.
    7. Wait for Google to create a copy of your data.
    8. When you receive the email from Google or you see that it is available, download it to your hard drive. Google will most likely ask you for your password, this is normal.
  3. Convert your data using Google-Location-history-converter
    1. Locate your newly downloaded Google location data, it is usually in your browser's downloads folder. You will need to know the filepath to the data from the command line.
    2. Run the google-location-history-converter --inputFile => The input filename, this is the Google Location Data file, in compressed TGZ format --outputFile => This is where to output the KML file, if you omit this, it will send the data to stdout --filterMoreThanDays => This is how many days back from today to export, if you omit it, it will convert all your data, if you enter 15, it will give you 15 days back from today.
    glconverter --inputFile="<The filepath to the downloaded Google location data>" --outputFile "<the filename you want for the KML data, ending in .kml>" --filterMoreThanDays 15
    If you know that you will only have one Google Location history file in the directory, you can also convert it like this. Which gives you 30 days of location data:
    glconverter --inputFile=$(ls *.tgz) --outputFile ./locationHistory.kml --filterMoreThanDays=30 
    1. Your KML file is now in the file you specified.
  4. Geolocate your images using Exiftool
    1. Locate your exported KML file, we will assume its here: ./locationHistory.kml
    2. Put your images in a directory, we will use the current directory "." 4 Run Exiftool on your images
LOCATION_HISTORY_FILE_KML=./locationHistory.kml
IMAGE_FILE_DIRECTORY=.
exiftool -v5 -geotag "$LOCATION_HISTORY_FILE_KML" '-geotime<${DateTimeOriginal}-05:00' . -api GeoMaxIntSecs=1800 -overwrite_original_in_place $IMAGE_FILE_DIRECTORY
  1. Optionally sort your images into directories based on when you took the photo
exiftool '-Directory<DateTimeOriginal' -d "$IMAGE_FILE_DIRECTORY/%Y-%m-%d" $IMAGE_FILE_DIRECTORY

google-location-history-converter's People

Contributors

rickprice avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.