Skip to content

Latest commit

ย 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GPSExtractionTool

Descrizione / Description

๐Ÿ‡ฎ๐Ÿ‡น Un semplice script portatile che utilizza ExifTool per estrarre in blocco i dati GPS e i metadati da una cartella di foto e video. Genera automaticamente:

  • CSV con informazioni complete sui file e coordinate
  • GPX con la traccia georeferenziata
  • KML (track e points) per visualizzare percorsi e punti in Google Earth, QGIS e altri software GIS

๐Ÿ‡ฌ๐Ÿ‡ง A simple portable script that leverages ExifTool to bulk-extract GPS data and metadata from a folder of photos and videos. It automatically generates:

  • CSV with full file information and coordinates
  • GPX with the georeferenced track
  • KML (track and points) to visualize routes and locations in Google Earth, QGIS, and other GIS software

CHANGELOG

v2 - v2 Changerlog

New features:

  • Recap at the end: shows file processed, records created, etc.
  • implemented DIAGNOSTIC MODE: if the parameter set "DIAG=1"is 1 instead of 0, it creates also a warnings.log file (useful because DJI drones create a lot, see below)

Known bugs:

  • track.gpx file is correct but refused by Google MyMaps. Use track.kml instead
  • track.kml connects the end of a video with the start of the next with a simple line. Sometimens can be useful, but if unwanted simply delete the extra line

Bugfix:

  • implemented pause and controls that work correctly
  • implemented powershell to create actual templates for output
  • implemented -charset FileName=cp1252 for italian file path vith ร รจรฌรฒรน characthers
  • forced wotrking directory with pushd "%SRC%" to make it work properly with long filepaths
  • set video to generate a single point in pints instead of the whole track to avoid millions of points
  • implemented "-ee -api QuickTimeUTC -n -fileOrder gpsdatetime" to make the script compatible with DJI Drones video. DJI drones photos also creates a lot of warnings but it is an exiftool issue. keep DIAG mode active and check if there are real issues or just minor warnings

INSTRUCTIONS

ITALIAN โ€“ ENGLISH BELOW

Operazione preliminare

  1. Scarica ExifTool
    • Scarica il software da https://exiftool.org
    • Copia il file dentro la cartella GPSExtractionTool, poi rinominalo in exiftool.exe, insieme alla cartella exiftool_files, se presente

Utilizzo rapido

  1. Copia lโ€™intera cartella GPSExtractionTool (contenente exiftool.exe e extract_gps.bat)
    dentro la cartella che contiene le foto o i video da analizzare.
    Esempio:

    D:\Viaggi\2024\Foto\GPSExtractionTool\
    
  2. Apri la cartella GPSExtractionTool e fai doppio click su:

    extract_gps.bat
    
  3. Lo script analizzerร  automaticamente tutti i file multimediali presenti nella cartella superiore (dove si trovano le foto), escludendo i propri file interni.

  4. I risultati saranno salvati in:

    GPSExtractionTool\GPSData_extracted\
    

๐Ÿ“Š File di output

File Formato Contenuto principale
gps_sorted.csv CSV Tabella con metadati completi
track.gpx GPX 1.1 Traccia georeferenziata
track.kml KML Percorso temporale (gx:Track)
points.kml KML Punti singoli con metadati

๐Ÿ“‚ Dettaglio file

1. gps_sorted.csv

  • Tabella apribile in Excel / LibreOffice / Google Sheets
  • Colonne principali:
    • FileName, Directory, FileSize, MIMEType
    • Make, Model, LensModel, Software
    • ImageWidth, ImageHeight, Orientation
    • DateTimeOriginal, CreateDate, ModifyDate, GPSDateStamp, GPSTimeStamp
    • GPSLatitude, GPSLongitude, GPSAltitude, GPSImgDirection
    • ISO, ShutterSpeed, Aperture, FocalLength
  • Ordinato cronologicamente per DateTimeOriginal
    ๐Ÿ‘‰ Ideale per analisi dettagliate, filtri, statistiche, esportazioni in GIS

2. track.gpx

  • Formato GPX 1.1 standard
  • Contiene una traccia (trk) con tutti i punti geotaggati in ordine temporale
  • Ogni punto include latitudine, longitudine, altitudine (se presente), timestamp
    ๐Ÿ‘‰ Perfetto per dispositivi GPS, Garmin BaseCamp, QGIS, Google Earth (import GPX)

3. track.kml

  • Formato KML con estensione Google (gx:Track)
  • Sequenza temporale di tutti i punti con animazione della timeline
    ๐Ÿ‘‰ Ottimo per rivedere il viaggio in Google Earth come animazione temporale

4. points.kml

  • Formato KML con un Placemark per ogni foto/video
  • Nome = FileName, descrizione = Directory
  • Include TimeStamp e coordinate
  • ExtendedData con metadati (fotocamera, lente, ISO, focale, ecc.)
    ๐Ÿ‘‰ Utile in Google Earth / QGIS se vuoi i punti singoli con dettagli tecnici

๐Ÿ’ก Consigli dโ€™uso

  • Vuoi unโ€™analisi tabellare (filtri, grafici, pivot)?
    โ†’ gps_sorted.csv (Excel, Google Sheets, LibreOffice Calc)

  • Vuoi caricare il percorso su un GPS o app sportiva?
    โ†’ track.gpx (Garmin, Strava, Komoot, QGIS, MapSource)

  • Vuoi rivedere il viaggio in Google Earth con animazione temporale?
    โ†’ track.kml (gx:Track)

  • Vuoi vedere ogni foto come punto con dettagli tecnici?
    โ†’ points.kml (Google Earth, QGIS)


๐Ÿ“Œ Note

  • Le colonne/elementi possono essere vuoti se il file non contiene quel metadato.
  • ExifTool supporta molti formati (JPG, PNG, HEIC, RAW, MP4, MOV...).
  • Google Earth preferisce i KML, ma importa anche i GPX.
  • QGIS puรฒ importare direttamente CSV, GPX e KML.
  • Se i dati temporali mancano, lโ€™ordinamento cronologico potrebbe non essere accurato.

โš™๏ธ Flusso di esecuzione

  1. Controllo preliminare

    • Lo script verifica la presenza di exiftool.exe
    • Se manca โ†’ errore e stop.
  2. Individuazione sorgente

    • Viene analizzata la cartella superiore rispetto a GPSExtractionTool (dove si trovano le foto).
    • Esclude la cartella degli strumenti e lโ€™output (GPSExtractionTool, GPSData_extracted).
  3. Preparazione output

    • Se non esiste, viene creata GPSData_extracted accanto allo script.
  4. Generazione template

    • Se mancanti, vengono creati i file di formattazione locali:
      • gpx.fmt โ†’ struttura del file GPX
      • kml_track.fmt โ†’ struttura KML con percorso (gx:Track)
      • kml_points.fmt โ†’ struttura KML con punti e metadati
  5. Estrazione CSV

    • Genera gps_sorted.csv con metadati completi (camera, parametri di scatto, GPS).
    • Ordinato cronologicamente per DateTimeOriginal.
  6. Generazione GPX

    • Produce track.gpx con i punti georeferenziati (lat, lon, alt, time).
  7. Generazione KML (track)

    • Produce track.kml con percorso temporale (gx:Track), animabile in Google Earth.
  8. Generazione KML (points)

    • Produce points.kml con un Placemark per ogni file e metadati in <ExtendedData>.
  9. Messaggio finale

    • Lo script mostra i file creati dentro GPSData_extracted.

๐Ÿ‡ฌ๐Ÿ‡ง English version


Preliminary operation

  1. Download ExifTool
    • Download the software from https://exiftool.org
    • Copy the file into the GPSExtractionTool folder, then rename it to exiftool.exe, along with the exiftool_files folder, if present

Quick Start

  1. Copy the entire GPSExtractionTool folder (containing exiftool.exe and extract_gps.bat)
    inside the folder that contains the photos or videos you want to process.
    Example:

    D:\Trips\2024\Photos\GPSExtractionTool\
    
  2. Open the GPSExtract folder and double-click:

    extract_gps.bat
    
  3. The script will automatically scan all media files located in the parent folder (where the photos are stored), excluding its own internal files.

  4. Results will be saved in:

    GPSExtractionTool\GPSData_extracted\
    

๐Ÿ“Š Output files

File Format Main contents
gps_sorted.csv CSV Table with complete metadata
track.gpx GPX 1.1 Georeferenced track
track.kml KML Temporal path (gx:Track)
points.kml KML Individual points with metadata

๐Ÿ“‚ Output details

1. gps_sorted.csv

  • Tabular format (CSV), can be opened in Excel / LibreOffice / Google Sheets
  • Main columns:
    • FileName, Directory, FileSize, MIMEType
    • Make, Model, LensModel, Software
    • ImageWidth, ImageHeight, Orientation
    • DateTimeOriginal, CreateDate, ModifyDate, GPSDateStamp, GPSTimeStamp
    • GPSLatitude, GPSLongitude, GPSAltitude, GPSImgDirection
    • ISO, ShutterSpeed, Aperture, FocalLength
  • Chronologically ordered by DateTimeOriginal
    ๐Ÿ‘‰ Best for detailed analysis, filters, statistics, export to GIS

2. track.gpx

  • Standard GPX 1.1 format
  • Contains a track (trk) with all geotagged points in time order
  • Each point includes latitude, longitude, altitude (if available), timestamp
    ๐Ÿ‘‰ Perfect for GPS devices, Garmin BaseCamp, QGIS, Google Earth (import GPX)

3. track.kml

  • KML format with Google extension (gx:Track)
  • Temporal sequence of all points with timeline animation
    ๐Ÿ‘‰ Great for replaying your trip in Google Earth as a time sequence

4. points.kml

  • KML format with one Placemark per photo/video
  • Name = FileName, description = Directory
  • Includes TimeStamp and coordinates
  • ExtendedData with metadata (camera, lens, ISO, focal length, etc.)
    ๐Ÿ‘‰ Useful in Google Earth / QGIS to view individual points with technical details

๐Ÿ’ก File usage recommendations

  • Need tabular analysis (filters, charts, pivot tables)?
    โ†’ gps_sorted.csv (Excel, Google Sheets, LibreOffice Calc)

  • Need to upload the track to a GPS or sports app?
    โ†’ track.gpx (Garmin, Strava, Komoot, QGIS, MapSource)

  • Want to replay your trip in Google Earth with time animation?
    โ†’ track.kml (gx:Track)

  • Want to see each photo as a point with full details?
    โ†’ points.kml (Google Earth, QGIS)


๐Ÿ“Œ Notes

  • Columns/elements may be empty if the file does not contain that metadata.
  • ExifTool supports many formats (JPG, PNG, HEIC, RAW, MP4, MOV...).
  • Google Earth prefers KML but also imports GPX.
  • QGIS can directly import CSV, GPX and KML.
  • If temporal data is missing, chronological order may not be precise.

โš™๏ธ Execution flow

  1. Pre-check

    • The script verifies that exiftool.exe exists inside GPSExtractionTool.
    • If missing โ†’ error and stop.
  2. Source detection

    • It scans the parent folder of GPSExtractionTool (where your photos live).
    • Tool and output folders are excluded (GPSExtractionTool, GPSData_extracted).
  3. Output preparation

    • Creates GPSData_extracted next to the script if it does not exist.
  4. Template generation

    • If missing, it creates local formatter files:
      • gpx.fmt โ†’ GPX track structure
      • kml_track.fmt โ†’ KML with gx:Track
      • kml_points.fmt โ†’ KML placemarks with metadata
  5. CSV extraction

    • Produces gps_sorted.csv with complete metadata (camera, exposure, GPS).
    • Chronologically ordered by DateTimeOriginal.
  6. GPX generation

    • Produces track.gpx with georeferenced points (lat, lon, ele, time).
  7. KML (track) generation

    • Produces track.kml with a temporal path (gx:Track), playable in Google Earth.
  8. KML (points) generation

    • Produces points.kml with one Placemark per file and <ExtendedData>.
  9. Final message

    • The script prints the list of files created in GPSData_extracted.

About

A simple script for massive data and GPS coordinates extraction using ExifTools and creation of GPX and KML maps

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages