๐ฎ๐น 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
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
- Scarica ExifTool
- Scarica il software da https://exiftool.org
- Copia il file dentro la cartella
GPSExtractionTool, poi rinominalo inexiftool.exe, insieme alla cartellaexiftool_files, se presente
-
Copia lโintera cartella
GPSExtractionTool(contenenteexiftool.exeeextract_gps.bat)
dentro la cartella che contiene le foto o i video da analizzare.
Esempio:D:\Viaggi\2024\Foto\GPSExtractionTool\ -
Apri la cartella
GPSExtractionToole fai doppio click su:extract_gps.bat -
Lo script analizzerร automaticamente tutti i file multimediali presenti nella cartella superiore (dove si trovano le foto), escludendo i propri file interni.
-
I risultati saranno salvati in:
GPSExtractionTool\GPSData_extracted\
| 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 |
- 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
- 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)
- 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
- Formato KML con un Placemark per ogni foto/video
- Nome = FileName, descrizione = Directory
- Include
TimeStampe coordinate - ExtendedData con metadati (fotocamera, lente, ISO, focale, ecc.)
๐ Utile in Google Earth / QGIS se vuoi i punti singoli con dettagli tecnici
-
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)
- 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.
-
Controllo preliminare
- Lo script verifica la presenza di
exiftool.exe - Se manca โ errore e stop.
- Lo script verifica la presenza di
-
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).
- Viene analizzata la cartella superiore rispetto a
-
Preparazione output
- Se non esiste, viene creata
GPSData_extractedaccanto allo script.
- Se non esiste, viene creata
-
Generazione template
- Se mancanti, vengono creati i file di formattazione locali:
gpx.fmtโ struttura del file GPXkml_track.fmtโ struttura KML con percorso (gx:Track)kml_points.fmtโ struttura KML con punti e metadati
- Se mancanti, vengono creati i file di formattazione locali:
-
Estrazione CSV
- Genera
gps_sorted.csvcon metadati completi (camera, parametri di scatto, GPS). - Ordinato cronologicamente per
DateTimeOriginal.
- Genera
-
Generazione GPX
- Produce
track.gpxcon i punti georeferenziati (lat, lon, alt, time).
- Produce
-
Generazione KML (track)
- Produce
track.kmlcon percorso temporale (gx:Track), animabile in Google Earth.
- Produce
-
Generazione KML (points)
- Produce
points.kmlcon un Placemark per ogni file e metadati in<ExtendedData>.
- Produce
-
Messaggio finale
- Lo script mostra i file creati dentro
GPSData_extracted.
- Lo script mostra i file creati dentro
- Download ExifTool
- Download the software from https://exiftool.org
- Copy the file into the
GPSExtractionToolfolder, then rename it toexiftool.exe, along with theexiftool_filesfolder, if present
-
Copy the entire
GPSExtractionToolfolder (containingexiftool.exeandextract_gps.bat)
inside the folder that contains the photos or videos you want to process.
Example:D:\Trips\2024\Photos\GPSExtractionTool\ -
Open the
GPSExtractfolder and double-click:extract_gps.bat -
The script will automatically scan all media files located in the parent folder (where the photos are stored), excluding its own internal files.
-
Results will be saved in:
GPSExtractionTool\GPSData_extracted\
| 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 |
- 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
- 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)
- 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
- KML format with one Placemark per photo/video
- Name = FileName, description = Directory
- Includes
TimeStampand coordinates - ExtendedData with metadata (camera, lens, ISO, focal length, etc.)
๐ Useful in Google Earth / QGIS to view individual points with technical details
-
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)
- 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.
-
Pre-check
- The script verifies that
exiftool.exeexists insideGPSExtractionTool. - If missing โ error and stop.
- The script verifies that
-
Source detection
- It scans the parent folder of
GPSExtractionTool(where your photos live). - Tool and output folders are excluded (
GPSExtractionTool,GPSData_extracted).
- It scans the parent folder of
-
Output preparation
- Creates
GPSData_extractednext to the script if it does not exist.
- Creates
-
Template generation
- If missing, it creates local formatter files:
gpx.fmtโ GPX track structurekml_track.fmtโ KML withgx:Trackkml_points.fmtโ KML placemarks with metadata
- If missing, it creates local formatter files:
-
CSV extraction
- Produces
gps_sorted.csvwith complete metadata (camera, exposure, GPS). - Chronologically ordered by
DateTimeOriginal.
- Produces
-
GPX generation
- Produces
track.gpxwith georeferenced points (lat, lon, ele, time).
- Produces
-
KML (track) generation
- Produces
track.kmlwith a temporal path (gx:Track), playable in Google Earth.
- Produces
-
KML (points) generation
- Produces
points.kmlwith one Placemark per file and<ExtendedData>.
- Produces
-
Final message
- The script prints the list of files created in
GPSData_extracted.
- The script prints the list of files created in