Skip to content

nck974/py-geo-locator

Repository files navigation

py-geo-locator

This program takes as input a set of images and gps tracks. If the image was taken during a track the closest position in the track will be saved in the EXIF data of the image. This library is written in python, excluding the library that writes the metadata into the EXIF file which is in perl (the available python libraries did not work so well with RAW photos).

Prerequisites

  1. Perl is installed.
  2. Python >3.10 is installed.

Installation

  1. Pull the project
  2. Install perl library cpan -i Image::ExifTool:
  3. Install python requirements pip install -r requirements.txt.

Usage

  1. Place your gps tracks in gps_data folder.
  2. Place your photos in src_photos folder.
  3. Execute geolocalize_photos.py.
  4. The photos that could be geolocalized will be placed in dest_photos.

Fit data

Strava seems to store some old imported data as .fit.gz. First you can use 7zip in windows or something similar in other OS to extract all .gz to .fit.

To convert them to gpx just copy the .fit files in the folder gps_data_fit and run python .\convert_fit_to_gpx.py.

Conversion is done by the external library fit2gpx.

TCX data

Strava seems to store some old imported data as .tcx.gz. First you can use 7zip in windows or something similar in other OS to extract all .gz to .tcx.

To convert them to gpx just copy the .tcx files in the folder gps_data_tcx and run python .\convert_tcx_to_gpx.py.

Conversion is done by the external library tcx2gpx.

Limitations

  1. Currently only jpg, png, and canon RAW data is supported. Although I guess it should also work with other formats is the file suffix is accepted, feel free to send a PR to add additional formats.
  2. Some old photos did not have timezones in the EXIF data which may make it harder to match the correct gps data, lib\photo\metadata.py contains a function to play with the timezone and find the correct point for that old data.

About

Add gps data to your photos from gps tracks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published