kml Placemark with file info from 2 different folders

Started by Serge, March 08, 2011, 09:00:03 PM

Previous topic - Next topic

Serge

Hello,
I'm trying to create a KML placemark that will display a picture and an audio clip for description of the picture. They need to be in the same Placemark - See sample code
It works fine doing it manually, but I'm having a difficult time automating it with ExifTools using a an .fmt file or something else
I have used the -p option to create the .kmz file for pictures only something like:
exiftool -fileOrder gpsdatetime -p kml.fmt -d %Y-%m-%dT%H:%M:%SZ C:\temp\ExiftoolGen\images\*.jpg > out.kml

It Works fantastic.
I have the images in a folder "/images" and the sound clips are in the folder "/audio"
Sound clips have the same file name as the image file for correlation - not all images have sound clips, inthat case we only show a picture.

This Portion loads the images from the folder "images/" works fine with the -p option 

<Placemark>
   <description><![CDATA[<br/><table><tr><td>
    <p><h3>$imagedescription#</h3></td></tr>
    <a href='images/$filename' target=_blank>
    <img src='images/$filename'
     width='$imagewidth' height='$imageheight'></a>
     </td></tr>

This Portion loads a Sound clip SWF format - description of the Picture froma different folder

       <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="115" HEIGHT="25">
       <PARAM NAME="movie" VALUE="audio/$filename.swf">
       <PARAM NAME="quality" VALUE="high">
       <PARAM NAME="bgcolor" VALUE="#FFFFFF">
       <EMBED src="audio/filename.swf" quality="high" bgcolor="#FFFFFF" WIDTH="115" HEIGHT="25" TYPE="application/x-shockwave-flash"
       PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
       </OBJECT>
         <tr><td>
       </td></tr></table>]]>
       </description>

This Portion is just the location and works fine
<LookAt>
<longitude>$gpslongitude#</longitude>
<latitude>$gpslatitude#</latitude>
<altitude>0</altitude>
<heading>$gpsimgdirection</heading>
<tilt>45</tilt>
<range>200</range>
</LookAt>
        <Snippet/>
        <name>$filename</name>
        <styleUrl>#Photo</styleUrl>
        <Point>
          <altitudeMode>clampedToGround</altitudeMode>
          <coordinates>$gpslongitude#,$gpslatitude#,0</coordinates>
        </Point>
      </Placemark>


Any help or ideas will be appreciated -Thank you!!

Phil Harvey

What exactly is the problem?  It looks like what you have done should work except that the audio file information will be generated regardless of whether or not the audio file actually exists, but I can't think of an easy way around this without getting into writing your own script.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).