Giter Club home page Giter Club logo

add_photo_locations_from_gpx's Introduction

Add location to Apple Photos from GPX File

Python script to add missing location data to photos in your Apple Photos library based on a data from a GPX file. This script can be run stand-alone to add location data to the photos in your library or via osxphotos using the osxphotos run command.

Installation

The easiest way to run this is to save the script to your computer then install osxphotos using these instructions and run the script using osxphotos run add_photo_locations_from_gpx.py.

If you're comfortable with python, you can also run this script stand-alone:

Clone the repo:

  • git clone [email protected]:RhetTbull/add_photo_locations_from_gpx.git
  • cd add_photo_locations_from_gpx

I recommend you create and activate a python virtual environment before running pip:

  • python3 -m venv venv
  • source venv/bin/activate

Then install requirements:

  • python3 -m pip requirements.txt

Requires python 3.9+

Running

python3 add_photo_locations_from_gpx.py --help

or, if running with osxphotos:

osxphotos install gpxpy
osxphotos run add_photo_locations_from_gpx.py --help

Usage: add_photo_locations_from_gpx.py [OPTIONS] GPX_FILENAME

  Add missing location data to photos in Apple Photos from GPX file.

Options:
  --delta INTEGER       Time delta in seconds, default = 60.
  --dry-run             Dry run, do not actually update location info for
                        photos.
  --add-to-album ALBUM  Add updated photos to album named ALBUM, creating the
                        album if necessary.
  --selected            Only update photos currently selected in Photos.
                        Default is to update all photos with missing location
                        data in the library.
  --help                Show this message and exit.

I strongly recommend you run with --dry-run first and manually check the locations for some of the photos. I also recommend using the --add-to-album to add all updated photos to an album so you can check the results.

--delta specifies how close in time (in seconds) the GPX timestamp needs to be (in seconds) in order to match the location to the photo's timestamp.

Photos which already have a location in Photos will not be updated even if the photo's time matches a time in the GPX file.

License

MIT License. See LICENSE file.

Dependencies

See Also

Caveat

This script can modify photos in your Photos library. Use with caution. No warranty is implied or provided.

add_photo_locations_from_gpx's People

Contributors

rhettbull 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.