ExifTool Forum

ExifTool => Newbies => Topic started by: dnhxx on November 15, 2020, 04:35:32 PM

Title: printFormat file for KML track extensions
Post by: dnhxx on November 15, 2020, 04:35:32 PM
Hello,

I am trying to create a amp using data from a dash cam mp4 file.  The example track printFormat file works great.  I am wondering if a printFormat file can be written to create a kml file that uses the KML extension for tracks <gx:Track> .  an example can be found here:

https://developers.google.com/kml/documentation/kmlreference?csw=1#trackexample (https://developers.google.com/kml/documentation/kmlreference?csw=1#trackexample)

For the dash cam, it would be nice to create extended data with speed and altitude (if present).

It is the extended data section that is got me stumped. I can't figure out how to extract the speed data and place that in the <ExtendedData><gx:value>  tags at the same time as placing gps location data in the <gx:coord> tag.  If I use two #[BODY], all the extracted data is placed together rather than where the [BODY] tags are.


#[BODY]<gx:coord>$gpslongitude#,$gpslatitude#,0</gx:coord>
#[SECT]      <ExtendedData>
#[SECT]             <SchemaData schemaUrl="#schema">
#[SECT]               <gx:SimpleArrayData name="cadence">
#[BODY]<gx:value>$gpsspeed#</gx:value>
#[ENDS]          </gx:SimpleArrayData>
#[ENDS]         </SchemaData>
#[ENDS]      </ExtendedData>
#[ENDS]     </gx:Track>


Just wondering if that is possible.


thank you
Title: Re: printFormat file for KML track extensions
Post by: StarGeek on November 15, 2020, 04:53:39 PM
There is a KML format file as part of the complete perl version on the main page and in the fmt_files (https://github.com/exiftool/exiftool/tree/master/fmt_files) directory on github.
Title: Re: printFormat file for KML track extensions
Post by: dnhxx on November 19, 2020, 11:42:17 AM
That is the file I used.  IT doesn't support the extended Track tag that I am looking for.
Title: Re: printFormat file for KML track extensions
Post by: Phil Harvey on November 20, 2020, 08:50:23 AM
I don't think you want to use SECT/ENDS.  Put all of the lines in the BODY.

- Phil