Add direction of photo from GPX file

Hi
Hi

I’m using a Shimano cm2000 action camera to take a succession of photographs of a bike ride. It doesn’t have GPS.
I’m using a Garmin Oregan GPSr to record a GPX of the route.
I’m using Geosetter (latest beta) to geotag the photos from the GPX data.
I’m using the Mapillary webpage to upload.

The photos have no direction/heading stored in Exif. They were all taken in the direction of travel.

What’s the best way to block add the information required?
I’ve looked in Geosetter, but individually (& laboriously) is the only way I could find.

PS Is there a better (free) Windows program to geotag photos than Geosetter, which you’d recommend?

2 Likes

Hi Dave,
I can recommend Javawa Fotogeotag, much easier to use and faster.

2 Likes

Excellent @ligfietser. Much easier to just drag ‘n’ drop. It stores the originals in a sub-folder, as opposed to Geosetter, so I can Ctrl A to select all if I want to repeat the process, and adds photo direction.

I have set up a series of automated scripts extracting photos from videos, setting timestamp according to video recording time, and geotagging the photos, using ffmpeg and mapillary_tools python tools, there are some other things to it, such as time zone sensing.

All of these have been tested fully on Mac, and will within short time be migrated to a linux box I am setting up.

All the python tools should run in windows, though I have not tested it.

1 Like

If you are not afraid of the command line, the Mapillary Tools at https://github.com/mapillary/mapillary_tools/tree/master/python will do the job. They have Python scripts for geotagging, interpolating direction, removing duplicates and uploading. They work very well on large amounts of images.

Personally I use exiftool https://sno.phy.queensu.ca/~phil/exiftool/ to geotag. It takes some studing of the manual to get started, but it is extremely powerfull with regarding to geotagging and adjusting the timestampes of images.

I have put my helper script up on https://github.com/simonmikkelsen/mapillary_scripts . They use mapillary_tools with the arguments I use and they creates nice log files that helps see what went wrong or what is done. I really like upload_unfinished_seqnences.sh which will find all Mapillary sequences and upload those which not have the logfile the script creates. undo-sequences.sh is also nice for undoing what the script does. The scripts run on Bash and requires something like Cygwin on Windows.

@Skippern do you have you scripts on Github or simmilar? I am very interested in how you are doing time zone sensing, as that is a manual process for me (and a real pain).

2 Likes

Thanks @tryl
I’m au fait with command line programs such a ffmpeg. I shall definitely investigate the upload script as I’m getting an error when uploading using the web page,

I’m slightly confused by “This script uploads images taken with any of the Mapillary apps”
Does it really restrict itself or is it actually any image as long as it has Exif data?

The script will upload any image that has time and is geotagged. If direction is not set, Mapillary will just set it to North. Just ask if you have issues running the scripts!

I havn’t put my script on GitHub yet, since it is completely tailored for my setup. My timezone sensing is done using the -z argument in date, I still have to figure out to do the same sensing in the mpeg files from my VIRB, since it timestamps with local time and not UTC which I hoped, that becomes a headache when travelling

As I can read from the man page, %z is a formatting option that prints the time zone offset. I assume you use something like date --reference 405MEDIA_Y4820388.jpg '+%z' and then it prints e.g. +0100
I don’t know if it will always work or only some times, but it is good to be aware that any copying of the files on a bad time (e.g. files taken with DST in effect and a copy made with DST not in effect) may break the solution.

The only good automatic solution I have found is to use a webservice to get the time zone offset and DST offset from a webservice, where you provide the coordinates and time as arguments. Doing it for the first picture of every sequence should usually do. But this subject is a pain and I always hope to find the perfect universal solution. I still do it by hand.

It works in some ways, but attempting to decipher the timezone data from the mpeg created_time flag didn’t work. I still need to research that part of it. For now I need to brute force my script to +1H or -1H when I know the video is taken in a different timezone than the computer clock. The plan was for the script to take care of that completely automatic.

I use curl/wget to upload my gpx files to OSM via their API. Is there a similar method with Mapillary?

@DaveF Mapillarys current API is documented at https://a.mapillary.com/ . This is not complete, so you may also look in their Python script (like the upload script) at https://github.com/mapillary/mapillary_tools/tree/master/python or try to reverse engineer it from the website.