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