GPSCORRELATE(1)
๐ธ NAME ๐ธ
okay so this is the manual page for gpscorrelate(1), version gpscorrelate 2.4 ๐
gpscorrelate โ correlates digital images with GPS data, filling EXIF fields. periodt. ๐ฐ๏ธ
๐ฐ๏ธ SYNOPSIS ๐ฐ๏ธ
The shapes this command can take are literally:
gpscorrelate [{-g file.gpx} |
{[-l | --latlong latitude,longitude[,elevation] ]}] [-z |
--timeadd +/-HH[:MM]] [--no-photo-tz] [-O |
--photooffset seconds] [-i | --no-interpolation] [-v |
--verbose] [-d | --datum datum] [-n | --no-write] [-R |
--replace] [-m | --max-dist time] [-t | --ignore-tracksegs]
[--heading] [-B | --max-heading degrees] [-b |
--direction degrees] [-M | --no-mtime] [--degmins]
image.jpg...
gpscorrelate {-s | --show | -o | --machine} image.jpg...
gpscorrelate {-x | --show-gpx} [-z | --timeadd +/-HH[:MM]]
[--no-photo-tz] [-O | --photooffset seconds] image.jpg...
gpscorrelate {-r | --remove} [-M | --no-mtime] image.jpg...
gpscorrelate {-f | --fix-datestamps} {-z | --timeadd +/-HH[:MM]}
image.jpg...
gpscorrelate -V | --version | -h | --help
๐ DESCRIPTION ๐
This manual page documents the gpscorrelate command. There is extended documentation available in HTML format; see below. ๐
gpscorrelate is a program that acts on digital images in JPEG format, filling in the EXIF (Exchangeable Image File Format) fields related to GPS (Global Positioning System) information. Source for the GPS data is a GPX (GPS Exchange Format) file, which records GPS location information in an XML-based format. The act of filling those fields is referred to as correlation. ๐
If GPS data are available at the precise moment the image was taken (with a 1-second granularity) the GPS data are stored unmodified in EXIF fields. If they are not, linear interpolation of GPS data available at moments before and after the image was taken can be used. If the image contains sub-second time resolution, it is used to obtain a more accurate estimate of the position between the two points. Linear interpolation gives good results when points are close together, but if they are several kilometres apart (such as on an infrequently-sampled airplane track), it will introduce some error versus the great circle route an airplane normally flies. A measure of the approximate accuracy of the GPS location reading (based on the number of digits recorded in the track point) is preserved when written into the image through the denominator of rational value fields. A GPSDOP tag is also written for exact point matches when satellite HDOP information is available, providing a more dependable estimate of location accuracy. โจ
The interpolation algorithm assumes that time values in GPX files are strictly increasing, which is normally the case. If a GPX file is found to violate this assumption, the message Warning: track points are not ordered by time is written to stderr along with the first backwards-going time value. Any location values written to images using such a file may not be using the best GPS coordinate points available if the images were taken around the time of the time incongruity. No warning is given if time between track segments goes backwards, which would only affect correlations when --ignore-tracksegs is used. The --max-dist option can be used to place a limit on how large a time gap is accepted, which can limit the effect if this occurs. โ ๏ธ
GPX files often contain gaps in location coverage. Line of sight to the GPS satellites can be lost if the receiver goes into a tunnel or a dense forest, for example, and track recording will stop until the connection can be reestablished. Some track recorders will stop recording points if the receiver stops moving. This results in points in the GPX file with timestamps far apart from each other, rather than only the normal one second apart (or another short interval). The interpolation that gpscorrelate performs by default assumes a smooth movement between the two known points on either side, but if those two points are minutes or hours apart (or even longer!) the interpolated position is unlikely to make sense. To avoid ending up with a bad location for an image, the --max-dist option can be used to skip correlating photos that were taken within a large gap in coverage. ๐ง
๐ OPTIONS ๐
These programs follow the usual GNU command line syntax, with long options starting with two dashes (-). A summary of options is included below. ๐
-g,--gps file.gpxโ Correlate images using the specified GPX file containing GPS track points. This option can be given many times to specify multiple GPX files. For each photo being correlated, the first file containing a track covering the time the photo was taken will be the one used. All<trk>segments in each file are used. ๐-l,--latlong latitude,longitude[,elevation]โ Provide a specific geographic coordinate to use for all images instead of correlating along a path in a GPX file. The format must be of the general formlatitude,longitude,elevationwhere latitude and longitude must each be in either decimal form, such as-123.45678, or in degrees/minutes/seconds form, such as-123ยฐ45'67.8"or-123d45m67s. Providing an elevation is optional. Each component can be separated by commas, spaces or tabs.
Note that this option has a known limitation in that it does not honour the locale's decimal place character in locales that use other than ".". ๐
-s,--showโ Only show the GPS data already in the given image's EXIF tags instead of correlating them. The time shown comes directly from the image without adjustments. ๐-x,--show-gpxโ Only show the GPS data in the given images in GPX format. Note that the points are written in the order in which the images are found on the command-line, so be sure to give them in the order in which they were photographed. The-z/--timeaddand-O/--photooffsetoptions are honoured just as in correlation to determine the correct time zone of the images. Images that can't be read or aren't GPS tagged are ignored. If the times of the photos given on the command-line are not strictly increasing, the messageWarning: image files are not ordered by time.is written tostderr. ๐ฆ-o,--machineโ Only show the GPS data of the given images in a machine-readable CSV format. The time shown comes directly from the image without adjustments. Images without GPS tags are ignored. The fields output are file name, date and time, latitude, longitude, elevation, where the first value is the filename, as passed, the second is the timestamp, and the last three are floating point values with an optional leading plus or minus. ๐ป-r,--removeโ Remove all GPS EXIF data from the given images. Note that this only removes the GPS tags that the program could add; it does not delete all possible GPS EXIF tags. All other tags are left alone. ๐งน-z,--timeadd +/-HH[:MM]โ Time to add to GPS points to make them match the timestamps of the images. GPS timestamps are in UTC; image timestamps are generally in local time. Enter the timezone used when taking the images; e.g.,+8for Perth, Western Australia or-2:30for St. John's, Newfoundland. This defaults to the time zone embedded in the image, or if that is not available (or when--no-photo-tzis given), the UTC offset of the local time zone as of the time of the first image processed (versions before 1.7 defaulted to00:00). โฐ--no-photo-tzโ Ignore anyOffsetTimeOriginalEXIF tags in photos that specify the time zone in which the photo was taken. If the tag is wrong, such as if the user forgot to update the time zone manually when travelling, then this will prevent it from being used. If this option is given, thengpscorrelatereverts to using automatic time zone detection for the photo, or a manually-specified one (if--timeaddis given). ๐-O,--photooffset secondsโ Time in seconds (fractional seconds are allowed) to add to the photo timestamp to make it match the GPS timestamp. To determine the number of seconds needed, just create a photograph of your GPS device showing the current time and compare it with the timestamp of your photo file. The EXIF time tags in the image are not modified based on this value. ๐ธ-i,--no-interpolationโ Disable linear interpolation between points. With this flag, the nearest exact point (within--max-dist) is used. Without this flag, photos taken between the time of two recorded GPS coordinates are correlated based on linear interpolation between those two points. ๐-v,--verboseโ Show slightly more information during the image correlation process, such as the GPS data selected for each image. ๐-d,--datum datumโ Specify GPS measurement datum. If not set,WGS-84is used (TOKYOis another possibility). However, GPX is not supposed to store anything butWGS-84, so this should only ever be needed with the--latlongoption. ๐-n,--no-writeโ Do not write the correlated EXIF data back into the image. Useful with--verboseto see what would happen during image correlation. ๐ซ-R,--replaceโ Overwrite any existing GPS tags in the file. Without this option, any file that already contains GPS tags will be skipped. ๐-m,--max-dist timeโ Maximum time in seconds from the photo time which a logged GPS point can refer and still be used for correlation. This defaults to0, which means to disable this check. Only one of the two points need be within this range for correlation to take place.
If a clear view of sufficient GPS satellites is lost while recording a track, then there may be location gaps in the GPX file. If the accuracy of the recorded location is paramount and you would rather not correlate a position at all for a photo if the available GPS coordinates were recorded too long ago in the past or too far into the future (relative to when the photo was taken), then set this to a nonzero value.
This option will also prevent recording heading and direction under the same circumstances (see --max-heading for a discussion of when this may be needed). โณ
-t,--ignore-tracksegsโ Interpolate between track segments, too. Generally, track segments show multiple sessions of GPS logging; between them is generally when the GPS was not logging. Since interpolation honours the--max-distflag, even track segments with wide time gaps can safely be used if both flags are set. Without this flag, photos taken within the time gap between two<trkseg>tracks in the GPX file are not correlated. ๐ค๏ธ--headingโ bestie, this writes an EXIF tag showing the direction of movement at the moment the image was captured ๐งญโจ. It's only possible if the direction is actually written in an appropriate tag inside a<trkpt>entry in the GPX file. The supported tags arecourse(from GPX 1.0),extensions/TrackPointExtension/course(a Garminยฎ TrackPointExtension), andextensions/compass(written by OSMTracker).
So here's the tea: gpscorrelate treats each of these tags as holding the true direction of movement, but ngl they aren't very well defined and might not hold exactly what's expected ๐ญ. Like, a phone might store the direction it's facing rather than the direction of movement, or the direction might be the magnetic heading instead of true heading. Or a device might estimate the heading from GPS movement, which will be inaccurate at slow speeds ๐. Use your knowledge of the recording application to determine how much faith you can place in the resulting tags, fr fr.
If this is used with --latlong instead of with --gps, then a fixed heading of 0 is written (this is subject to change in the future) ๐
.
-B,--max-headingdegrees โ don't write the tags for--headingand--directionfor images where the heading has changed by more than the specified number of degrees between the GPX points being used ๐. This prevents writing a value that's likely to be inaccurate because the image was taken during a sharp turn. It's off by default and must be less than 180 if given.
Heads up though, this option won't prevent writing an incorrect heading or direction in the case where GPS points are sparser than the time it takes the recording vehicle to make a nearly 360ยฐ turn ๐ฌ. For example, if the vehicle takes 8 seconds to turn completely around but GPS tags are written every 10 seconds, then the two points written at either end of the turn could have headings that are very close (within--max-heading) yet a picture taken in the middle of the turn, 4 seconds after the first tag, would have an interpolated heading that is around 180ยฐ off the correct value. Prevent this kind of bad value from being written by setting a--max-distthat is much less than the time it takes to turn around, such as4in this example.
-b,--directiondegrees โ write an EXIF tag showing the direction the camera was pointing when the image was taken ๐ธ. The degrees argument gives the offset between the direction of travel (the value that would be written if--headingwere given) and the camera direction. For example, if the camera is mounted pointing out the right side window of a car, then this would be specified as--direction 90. If--headingis also given, then the two tags will always be this number of degrees apart. If accuracy is important, use the--max-headingand--max-distoptions to limit writing these tags to times when there is a good fix on the position and not during a sharp turn. Since this option applies along the entire track, it's only generally useful when the camera is fixed in the vehicle during the trip ๐.
This may be used with --latlong, in which case the argument is used as the camera direction without alteration โจ.
-M,--no-mtimeโ do not change the last modification time of changed files ๐ฐ๏ธ. Your files' timestamps stay exactly as they were, periodt.-f,--fix-datestampsโ fix broken GPS datestamps written withgpscorrelateversions < 1.5.2 by replacing them with the photo's time stamp ๐ง. Prior to 1.5.2, two bugs wrote the wrong value for theGPSDateStampandGPSTimeStamptags. This option will check each supplied filename for the problem and correct it. Use with--no-writeto prevent writing these changes (useful for checking for the issue). This option also implies--no-mtime. You will also need to use--timeaddto specify the difference between localtime and UTC time for the supplied photos โฐ.--degminsโ write location asDD MM.MM(instead of the more accurateDD MM SS.SS) as was the default ingpscorrelateversions < 1.5.3. There is no good reason to use this option unless some broken program expects this style ๐. Like, genuinely, legacy vibes only.-h,--helpโ only show a summary of options ๐ซถ.-V,--versionโ only print thegpscorrelateversion number and copyright information ๐.
๐ธ EXAMPLES ๐ธ
Correlate all photos in a directory taken in western Europe in the summer (i.e., UTC-2):
gpscorrelate -g Test.gpx -z 2 *.jpg
Correlate all photos in a directory taken in Italy, switching to UTC-2 or UTC-1 depending on the daylight savings time in effect when the first picture in the list was taken:
env TZ=Europe/Rome gpscorrelate -g Test.gpx *.jpg
Correlate all photos in a directory from a track spread out over two different track files and taken in the computer's current time zone, interpolating between segments and between files while ignoring photos taken too far away from a recorded point, without changing the file time stamp of the files, while showing details of the process:
gpscorrelate -g track1.gpx -g track2.gpx -m 120 -t -M -v *.jpg
Correlate images taken from a dashcam, adding direction tags from the GPX file:
gpscorrelate --heading --max-heading 90 --direction 0 -g Test.gpx *.jpg
Correlate a set of photos taken with a camera aimed straight out of the right-hand passenger side window of a car (90ยฐ from straight ahead), using a GPX file containing direction tags, skipping direction tagging during fast turns and all tags when a GPS lock is lost for more than 6 seconds (to avoid writing inaccurate tags):
gpscorrelate -g car_trip.gpx --heading --max-heading 45 --direction 90 \
--max-dist 6 --ignore-tracksegs *.jpg
Correlate a photo taken from a camera with a fast clock (i.e., the clock was 77.5 seconds ahead of GPS time) and with incorrectly-specified time zone tags:
gpscorrelate -g Test.gpx -O -77.5 --no-photo-tz photo.jpg
Show existing GPS tags in a photo:
gpscorrelate --show photo.jpg
Show existing GPS tags in a photo and output in CSV format:
gpscorrelate --show --machine photo.jpg
Create a GPX track from a set of images taken in the UK in winter that are already GPS tagged (e.g., as might come from a cell phone camera), which can be used to correlate other photos taken on another nearby camera:
gpscorrelate --show-gpx -z 0 IMG*.JPG
Remove GPS tags from photos:
gpscorrelate --remove *.jpg
Add a GPS location tag to a photo taken to the southeast at Ulmer Mรผnster:
gpscorrelate -l 48.398620,9.991417,522 --direction 135 -z 2 ulm.jpg
๐ฆ EXIT STATUS ๐ฆ
gpscorrelate returns 0 in case of success, 1 in case of major error (such as a read or write error) and 2 in case of minor error (such as the given GPS track not covering the time of an image). So like, zero means slay, one means big yikes, two means small yikes ๐
.
๐ SEE ALSO ๐
gpsd(1), gpsbabel(1), gpxlogger(1), cgpxlogger(1).
The documentation of gpscorrelate in HTML format is available on the filesystem at /usr/share/doc/gpscorrelate ๐.
๐ LICENSE ๐
This manual page was initially written by Stefano Zacchiroli <zack@debian.org> for the Debian(TM) system. It was extended by Till Maas <opensource@till.name> and Dan Fandrich <dan@coneharvesters.com>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation.
๐ AUTHOR ๐
Stefano Zacchiroli
- Author.
โญ COPYRIGHT โญ
Copyright ยฉ 2006-2026 Stefano Zacchiroli <zack@debian.org>, Till Maas, Dan Fandrich
And that's the whole page, bestie โ you made it to the end ๐ซถโจ This icon of a manual is gpscorrelate version 2.4, dated 21 Sep 2026, and it ate, no cap ๐๐
๐ฆ where this page comes from
- arch rolling: gpscorrelate 2.4-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms