How to save Photos geotag in a column? (ODK Collect)

I have created a form which allows multiple photos to be taken. We’re using ODK Collect to capture data in the field.

I understand each photo has metadata and as such, it is geotagged (as long as the camera settings of the device, are set accordingly).

When i download the photos from KoboToolbox server and check their metadata, I can see the geotags are there. And that is great!
But when i export the data in CSV (from KoboToolbox), i don’t have access to this information. I only have access to the filenames and the urls.

So, I want to ask, is it possible to calculate and save the geotag on a specific column, when the user captures a photo?
If yes, then please tell me how, so that I can edit my XLSform accordingly.

@ivanradisson, could you share with the community a screenshot of the metadata that is present in the XLS format and a screenshot of the metadata that is not present in the CSV file? Maybe the screenshots should be able to visualize your issue pictorially.

Hey there @Kal_Lam
I apologize I couldn’t come back to you earlier. I’ve been away.

To clarify my initial request for support, which still stands.

When I export the data in CSV format, there’s no column that shows metadata for each photo (uploaded via KoboCollect). What I would like to get specifically is the geotag.

That’s why i asked if this could be done via calculation of some form, when the enumerator is filling the form and taking photos. So that I can get that metadata recorded in the database.

As i said before, i understand that information is also kept with the jpg file itself. And that is great!
But I would like to save it in a column, in the database.

Hi @ivanradisson, unfortunately this is not something that XLSForm supports. I would suggest adding a geopoint question alongside each image question so that the enumerator can at least explicitly set this each time they take a photo.

If you have some technical experience, you could write a script to extract the geo location from each image and append it to the submission — either posting it back to the submissions on the server or just locally on an export of the data. Alternatively, you could do something like I suggested here using the REST Services, but that could be quite convoluted.

1 Like

Hey there @Josh
Thanks for replying.
I understand your suggestion and I have a followup question. Is there a way to have the geopoint question hidden in the same page as the photo question? That way it would record automatically.

I’ll look into this. Since I’m using PowerBI, i might be able to do that in PowerBI (i’m not sure, i might have read something about it).

Yeah, this is too advanced for me.

Hi @ivanradisson, unfortunately there currently isn’t a method to trigger the current location automatically as one can do with the current time (now()). You can have a look at some of the suggestions in this thread for other workarounds:

As another alternative, I have a script here that you could run to download all your media files and then extract the location data from each image and append it to the downloaded submissions in the XLSX file.

1 Like

Thank you Josh for the amazing support,
I will explore these avenues.

2 Likes

Whilst recognising that this issue is marked solved, to add a note of caution - I have previously relied on Geotag data from the Camera and sometimes found the accuracy unreliable. Unless you have a relatively new phone with fast GPS positioning, you might get variable results (and if your enumerators are using their own phones, add that to the mix).

I would recommend using a Geopoint question directly after each photo capture (I don’t think there is yet a background that can be triggered as specific questions using XLSForm as @Josh says). I know this slows the process down slightly but for the quality of your data, add the question! You can set the visibility of the geopoint question to be dependent on the respective image (use Relevance), so that if the enumerator doesn’t take the nth picture they don’t have to locate the non-existent image…

Worth an experiment - compare the EXIF geotag with the Geopoint information from ODK Collect to see what the variance is (on a decent sample size, more than one phone), and maybe you can decide from there. I’ve found 100m+ differences but that’s on a Samsung Galaxy Note 4 with slow GPS fix - sometimes the camera records the previous location in the geotag even though it indicates a new fix, which is really unhelpful when you download the data!.

Good luck with your project(s)

2 Likes

@seewhy
That is amazing insight.
Thank you!

1 Like

You can download the multimedia files, and then in QGIS use the ImporPhoto plugin, which read the geotag and georeference the photo. Then, you can calculate X and Y, and export to csv to use wherever you want.

1 Like

@pschweitzer, :clap: :heart: :partying_face: