[digiKam-users] KML export: Feedback

Michael McEllin mchlmclln at gmail.com
Sun Aug 8 20:18:26 BST 2021

The structure of KML files is not actually very complex - though I admit that the explanation on the Google website is not as transparently obvious as it could be, and there are a few kinks that seem not to be well-described at all. Frankly, the easiest way to learn it is just look at lots of examples, which is what I did. You soon see that it is pretty straightforward. (But note that there are differences between what you can do with a pure KML file and the compressed, “KMZ", version, which can contain additional types of material such as icon images. One of those things that people in the know never get round to mentioning explicitly.) Google have also been known to change the rules of what they allow you to do arbitrarily at short notice (which those of us who have constructed websites with embedded Google maps know to our cost). 

However, if you need to transform any type of XML-based file (KML is a dialect of XML) into an alternative, generally also XML, format in a batch-process, the most efficient way to do it is via an “Extensible Style Sheet”, or XSL file, formatted according to XSLT (also a dialect of XML), which is a language for defining a transformation between an input structure and an output structure - generally both different forms of XML though this is not essential. Give the XSL style sheet, your KML file to a generic XSLT processor (of which there are many available) and out would come your transformed file containing just the information you need there. The downside is that you need to learn the XSLT language, which takes a modest amount of effort, reading the docs (again, easiest just to generalise from examples in my experience). The W3 Schools also have useful tutorials. The upside is that having mastered the idea (which is not that difficult) you have an extremely general tool at your fingertips with lots of potential uses.  A decade ago I was doing work that involved passing a lot of information between different systems in XML based formats, and got to appreciate the flexibility and ease of constructing these transformations.  

You probably don’t want to invest the time if you have only a modest amount of material (or it is a one-time requirement) but if you have any amount of this type of stuff to do, then I found that it soon repays the investment of learning.


> On 7 Aug 2021, at 20:43, Yann Bouger <ybouger at hotmail.com> wrote:
> I like this feature of building a kml file with the geotagged photos and opening it in Google Earth.
> However, I come across 2 problems:
> the name of the photos is displayed, whether you like it or not, which, when you have several, makes a messy screen in GE. Further to that, you could want to remove these names of the placemarks or change the font used for display, but then you are forced to do it one by one. You could create a folder of the placemarks and batch change the style but then you lose the icons as a miniature of the photo. This problem needs a serious expertise in kml programming which I don't have for modifying the kml file in Notepad or equivalent.  If Digikam could have at least a radio button for the display of the names or not that would be handy.
> after opening the file in GE you would like to save in "My Places". Once done, you will notice that that the photos will not show up as if the link was broken. Quite annoying but this issue belongs certainly to GE and not Digikam.
> Any comment would be welcome.
> YB

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-users/attachments/20210808/6b209517/attachment.htm>

More information about the Digikam-users mailing list