main kartaview conversion

This commit is contained in:
tykayn 2023-08-28 22:57:33 +02:00
parent 6a6753d97c
commit 2afaf45d7e

View File

@ -4,13 +4,11 @@
**/
// @ts-ignore
import piexif from 'piexif';
import * as fs from 'node:fs';
// @ts-ignore
import path from "node:path";
// @ts-ignore
import minimist from 'minimist';
import * as Buffer from "buffer";
// @ts-ignore
const moment = require("moment");
@ -69,7 +67,6 @@ if (mini_arguments['gpx-input']) {
}
// let dossier_photo: string = folder + "test_photo_apply"
let dossier_photo: string = folder_photos
let dossier_gpx_input: string = folder + "metadata_file"
@ -92,6 +89,7 @@ function makeGpxFromKartaview(tableKartaviewTrace: any) {
tableKartaviewTrace.forEach((elem: any) => {
// console.log('elem', elem)
// console.log('elem', elem[6] *1000)
if (elem.length && elem[6]) {
let utc_time = new Date(elem[6] * 1000)
// console.log('utc_time', utc_time.toISOString())
@ -100,6 +98,9 @@ function makeGpxFromKartaview(tableKartaviewTrace: any) {
<time>${utc_time.toISOString()}</time>
</trkpt>
`
}else{
console.log('!!!!!! makeGpxFromKartaview no good element in gpx', elem)
}
})
let content = `<?xml version='1.0' encoding='UTF-8'?>
@ -229,7 +230,7 @@ function openKartaviewTxtGPX(filepath: any, sequence_name: string) {
gpxData[sequence_name] = [...tableKartaviewTrace]
// console.log('gpxData', gpxData)
console.log(' makeGpxFromKartaview for sequence ', sequence_name)
let content_gpx = makeGpxFromKartaview(tableKartaviewTrace)