KML Export of GeoTaged Images
I would like to have an KML export like in digiKam1 in darktable:
I think wee have everything we need to write a export script with Lua. We can add new export options5, and we can get the latitude3 and longitude4 from the images.
For the KML we my be able to reuse parts from higgs2 (A way to generate KML dinamically with Lua)
#1 Updated by Tobias Jakobs over 5 years ago
I created a first version. To test it you have to add 'require "kml_export"' to '.config/darktable/luarc' and copy the file to '.config/darktable/lua/'.
There are still a lot of things to to. The biggest ToDo is that the thumbnails for the KML file are missing.
#3 Updated by Tobias Jakobs over 5 years ago
- % Done changed from 0 to 20
- Status changed from New to Incomplete
- File kml_export.lua kml_export.lua added
Now every thing works. Some parts could be improved, I've added ToDos in the script. And perhaps some parts could be solved better, but I'm still a Lua beginner. Any kind of review, improvement or fix are welcome.
Have fun with the script.
#4 Updated by Jérémy Rosen over 5 years ago
I had a quick read-through, pretty good script...
on line 65 you do
image_table = dt.gui.selection();
Which replaces the table of images provided to you with the current selection.
This might be unsafe, there is a very slight chance that the selection has changed since the export button was clicked (lua could do it... I don't think a user would be fast enough)
You seem to do that to be able to get the dt_lua_image_t object for exported images... you already have that info in the original table. The key of the image_table given to you is the image object (and the value is the temporary export file)
I am not sure what you are testing for with isnan() I assume you are testing that the value is not the floating point value NAN... I thought that unset fields would be nil in lua... can you confirm that ? maybe I need to change something on my side here, or check what's happening in DT. I don't like to have NAN out in the wilderness
overall, this looks pretty good (I don't know anything about kml itself so I can't comment on that) you probably would need a better UI integration, but you can't currently do that with lua. That's on my side I guess...
#6 Updated by Jérémy Rosen over 5 years ago
- % Done changed from 20 to 50
- Status changed from Incomplete to In Progress
Ok, I changed master to now properly report nil on unset values instead of NAN. Tell me if it works
Do you need anything more from the lua api at this point or should we change this FR to done ?
I consider UI elements too complicated for this FR, they will come in time, but let's not wait for that
#7 Updated by Tobias Jakobs over 5 years ago
I was for a short trip in Paris. Now I'm back with a lot of photos with GPS information to test. :)
I already found a bug in the KMZ export with Google Earth. I'll have to fix before I can close this FR.
To test your fix I'll have first to setup everything to get master.
An other bug i had with Marble is now fixed in in Marble. :)
#8 Updated by Tobias Jakobs over 5 years ago
I've now tested it with llatest git and the Problem with nil/NAN hasn't changed.
I've added a new version to the scrips wiki page and here. It has no known bugs and all works like planned. I think we can close this fr. Perhaps you can open a new bugreport for the nil/NAN problem.
#11 Updated by Tobias Jakobs about 5 years ago
- % Done changed from 50 to 100
- Status changed from In Progress to Fixed
The NAN problem is fixed in darktable 1.6. The latest Version of this script is online: