Dear all,
as I have some free time at my hands - badly injured my elbow when mountainbiking, recovery is a matter of another 6 weeks minimum - I decided to scratch a personal itch:
I very often track my movements with a GPS logger ,and during rawfile import, I write those coordinates into the raw file by means of exiftool. Now coordinates are nice and allow to see the image location on a map, but I want to see the postal-like address in the metadata of the image.
The openstreetmap-Nominatim servers allow reverse geocoding without all the privacy implications of google maps at al., and there is a very nice python module to query nominatim with a pair of coordinates and get back address data.
What I have accomplished so far is a lua post-import (or keyboard shortcut) triggered script that calls a python script to request the address data and return it in a lightroom style hierarchical location tag like “where|Italy|Emilia-Romagna|Bologna|Malpighi”. This tag then gets added to the darktable image.
My question to you is: Is this something that’s interesting for other people, too?
If yes I would put it on GitHub and invest some time to make it more configurable in terms of language and tag prefix.
The script currently uses the rate-limiting facilities of the geopy library, but as the script gets started anew on each run of the lua loop, the limiting does not take place.
I think of adding a timestamp to the python script parameters, which then could be used to make python wait until one second has passed.
Bad idea. I have to find a (portable) way how the script can detect when it was run last. The problem is, that the lua script gets triggered separately for each image during import, but runs in a loop on all marked images when called via shortcut. The loop is easier to slow down.
Another feature I am considering is making the language configurable, in which the adresses get retrieved from Nominatim
BTW - in my opinion, Discourse doesn’t handle the <del> tag very well; looks more like a highlight. Personally, I use ~~ to strikethrough the text — if that was what you wanted.
@springm - Here is the geoToolbox_ng.lua that @paperdigits was talking about. It’s a pure lua solution. It also gives you a choice of reverse geocoding engines. geoToolbox_ng.zip (12.2 KB)