Project

General

Profile

Feature #9979

KML Export of GeoTaged Images

Added by Tobias Jakobs over 5 years ago. Updated about 5 years ago.

Status:
Fixed
Priority:
Low
Assignee:
Category:
Map / Geolocation
Target version:
-
Start date:
06/04/2014
Due date:
% Done:

100%

Estimated time:
Affected Version:
System:
bitness:
hardware architecture:
amd64/x86

Description

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] http://scribblesandsnaps.com/2011/10/12/show-photos-on-google-earth-and-google-maps-with-digikam/
[2] https://code.google.com/p/higgs/
[3] http://darktable.org/redmine/projects/darktable/wiki/LuaAPI#latitude-2
[4] http://darktable.org/redmine/projects/darktable/wiki/LuaAPI#longitude-2
[5] http://www.darktable.org/2013/09/using-lua-with-darktable/

kml_export.lua (4.64 KB) kml_export.lua Tobias Jakobs, 06/07/2014 08:42 AM
kml_export.lua (5.42 KB) kml_export.lua Tobias Jakobs, 06/08/2014 10:00 AM
kml_export.lua (7.51 KB) kml_export.lua Tobias Jakobs, 06/08/2014 07:03 PM
kml_export.lua (9.23 KB) kml_export.lua Tobias Jakobs, 06/11/2014 12:34 AM
kml_export.lua (9.69 KB) kml_export.lua Tobias Jakobs, 06/26/2014 10:22 PM

History

#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.

#2 Updated by Tobias Jakobs over 5 years ago

New version with some improvements, but still a lot to do. Any hints for fixing the ToDos are welcome.

#3 Updated by Tobias Jakobs over 5 years ago

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...

#5 Updated by Tobias Jakobs over 5 years ago

Thanks Jérémy, I changed that.
The unset fields are nan and not nil.

I even added KMZ export too. That is simply all files zipped to one file.

#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. :)
https://bugs.kde.org/show_bug.cgi?id=336061

#8 Updated by Tobias Jakobs over 5 years ago

Hi Jérémy,

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.

#9 Updated by Jérémy Rosen over 5 years ago

the problem hasn't changed ? you still get NAN reported ???

ok... I will test some more.

#10 Updated by Jérémy Rosen over 5 years ago

I just tested and I only get nil, never NAN... do you have an image reporting NAN I could test with ?

nil is the normal way to report invalid data. NAN is not...

#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:
https://github.com/darktable-org/lua-scripts/blob/master/contrib/kml_export.lua

Also available in: Atom PDF

Go to top