Main Menu

Export with brackets

Started by serenwipity, January 18, 2025, 07:54:24 AM

Previous topic - Next topic

serenwipity

Hi Phil,
Im trying to work out a workflow to plot a route based on pictures i have taken during a roadtrip. Im using Linux Mint cinnamon version of exiftool. I also tried to work with the jExiftoolGUI but the font of the program is either to large or to small to work with (doesnt scale with steps of 0.1, seems only to use 0.5 increments).

Anyway, the best routeplanner i found where you can upload a gpx file is openrouteplanner.org. For others who are interested, better to create an api in api.openrouteplanner.org. The you have more options. In my case i had to increase the search radius so the waypoints could be found on roads nearby.

So i could upload a gpx file created with exiftool, but the api requires just coordinates encased with brackets and in long,lat order instead of lat,long eg [long,lat],[long,lat],[long,lat]
I just need an export to an text file which i copy past to the program.
How would i do that?
Much appreciated

Ps dont know if its even possible, but can exiftool filter only the last pictures of each day eg the location of campsite/sleepover?

Phil Harvey

This section of the Geotagging page describes how to make a GPX file from a set of geotagged pictures.  You just need to modify the gpx.fmt file for the format you want.

Filtering the last pictures of each day would be a bit tricky, but possible if it was OK to generate the track in reverse order. (But I doubt that would be acceptable.)  What about the first picture of each day?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

serenwipity

Hi Phil,
Im scratching my brain out on how to go about this. I tried to modify the gmt.fmt file to no avail. I only get errors (gmt.fmt listing). I tried tags but i have no idea what im doing. This really is not my cup of tea.

Hope you want to provide a solution, at least for adding the brackets and a continuing list seperated by comma's as in
[long,lat],[long,lat],[long,lat]
 
The sorting of the pictures by end of day i will do manually.

Sorry for my ignorance :)

Kind regards


Phil Harvey

So there is no other header information in the file?  Sorry, upon re-reading I think this is simpler than I first thought.  I though you wanted some different form of GPX output.

To output a single line with all the signed coordinates in brackets, you can do this:

exiftool -p- "[$gpslongitude,$gpslatitude]," -n DIR > out.txt

Notes:

1. The line will have a comma a the end.  I hope this isn't a problem.

2. The order that the files are processed is system dependent.  You may need to add a -fileOrder option to sort them in the order you want, maybe

exiftool -fileorder filename -p- "[$gpslongitude,$gpslatitude]," -n DIR > out.txt

or

exiftool -fileorder createdate -p- "[$gpslongitude,$gpslatitude]," -n DIR > out.txt

3. Add the -r option to also process files in sub-directories.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

serenwipity

#4
Hi Phil,
Thank you for your quick and helpful reply.
With the command
 exiftool -p- "[$gpslongitude,$gpslatitude]," -n DIR > out.txt

i do get a file in the right format, but the lat and long values are empty:
[,],[,],[,],[,],[,],[,],[,],[,],[,],

if i check with the jExiftoolGUI the tags are in the picture file. I attached a picture.

Any ideas?

Edit: Solved. I had to use ' instead of " as i am on Linux. I saw your subtext below your post.

For others, i mentioned the wrong website to upload this. Its https://maps.openrouteservice.org or https://api.openrouteservice.org
https://www.gpsvisualizer.com is also applicable

Thank you Phil for your patience

Phil Harvey

Sorry.  You're on Linux so you should use single quotes (see my signature).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).