2023-08-13 23:12:01 +02:00
|
|
|
/**
|
|
|
|
conversion de données gpx
|
|
|
|
conversion de données exif
|
|
|
|
**/
|
2023-08-14 16:55:58 +02:00
|
|
|
|
|
|
|
// @ts-ignore
|
2023-08-13 23:12:01 +02:00
|
|
|
import * as fs from 'node:fs';
|
2023-08-14 09:39:49 +02:00
|
|
|
// @ts-ignore
|
|
|
|
import path from "node:path";
|
2023-08-14 10:33:57 +02:00
|
|
|
// @ts-ignore
|
2023-08-14 09:39:49 +02:00
|
|
|
import minimist from 'minimist';
|
2023-08-21 16:20:53 +02:00
|
|
|
// @ts-ignore
|
2023-08-28 22:57:33 +02:00
|
|
|
const moment = require("moment");
|
2023-08-13 23:12:01 +02:00
|
|
|
|
2023-08-14 09:39:49 +02:00
|
|
|
// configs
|
|
|
|
let sequence_name: string = '3596977'
|
2023-08-14 12:22:05 +02:00
|
|
|
let folders_list_txt: any = [
|
2023-09-10 15:53:36 +02:00
|
|
|
"2785606" , "2785618" , "2785630" , "2785650" , "2785658" , "2785670" , "2785674" , "2785690" , "2785706" , "2785714" , "2785726" , "2785734" , "2785746" , "2785762" , "2785782" , "2785786" , "2785790" , "2785802" , "2785806" , "2785818" , "2785834" , "2785910" , "2785930" , "2785934" , "2785958" , "2785982" , "2786010" , "2786030" , "2786042" , "2786062" , "2786070" , "2786094" , "2786114" , "2786134" , "2786142" , "2786150" , "2786154" , "2786182" , "2786210" , "2786214" , "2786370" , "2786662" , "2786678" , "2787110" , "2787174" , "2787246" , "2787262" , "2787286" , "2787602" , "2787770" , "2788038" , "2788058" , "2788214" , "2788638" , "2789422" , "2789962" , "2789978" , "2790466" , "2790998" , "2791378" , "2791382" , "2791394" , "2791414" , "2791818" , "2791822" , "2792030" , "2792046" , "2792298" , "2792366" , "2792818" , "2793050" , "2793082" , "2793126" , "2793854" , "2793934" , "2793974" , "2794054" , "2794082" , "2794154" , "2794534" , "2794714" , "2794830" , "2794930" , "2795054" , "2795110" , "2795230" , "2795938" , "2796458" , "2796522" , "2796946" , "2797094" , "2797494" , "2797582" , "2798094" , "2798186" , "2798330" , "2798402" , "2798458" , "2798478" , "2798546" , "2798610" , "2798650" , "2798686" , "2798702" , "2798714" , "2798726" , "2798734" , "2798738" , "2798766" , "2798842" , "2798878" , "2798886" , "2798894" , "2798902" , "2798918" , "2798958" , "2799018" , "2799794" , "2799870" , "2799950" , "2800174" , "2800666" , "2800810" , "2801394" , "2801542" , "2801818" , "2801894" , "2802786" , "2803210" , "2803450" , "2803554" , "2803586" , "2803630" , "2803666" , "2803746" , "2803786" , "2803850" , "2803982" , "2804166" , "2804558" , "2804986" , "2805070" , "2805134" , "2805190" , "2805302" , "2805346" , "2805382" , "2805406" , "2805426" , "2805466" , "2805534" , "2805858" , "2805954" , "2806154" , "2806794" , "2807158" , "2807270" , "2807426" , "2807538" , "2807598" , "2807670" , "2807822" , "2807886" , "2808126" , "2808226" , "2808330" , "2808418" , "2808490" , "2808546" , "2808626" , "2808662" , "2808694" , "2808742" , "2809110" , "2809142" , "2809210" , "2809674" , "2809710" , "2809762" , "2809826" , "2809906" , "2810018" , "2810074" , "2810198" , "2810278" , "2810422" , "2810714",
|
|
|
|
|
|
|
|
// "3596249",
|
|
|
|
// "3596253", "3596977",
|
|
|
|
// "3675557", "3675577", "3716345", "4456921", "4457241", "4457257",
|
|
|
|
"4457273", // à récupérer
|
|
|
|
// "4457289", "4457689", "4457705", "4539913", "4539929", "4539945", "4559529",
|
|
|
|
// "4559545", "4559561", "4559577", "4559593", "4559609", "4559625", "4559641", "4559657", "4559673", "4559689", "4559705", "4559721", "4559737", "4559753",
|
|
|
|
// "4559769", "4559785", "4559801", "4559817", "4559833", "4559849", "4559865", "4904153", "4904233", "4904249", "4904265", "4904281", "4904297", "4904313",
|
|
|
|
// "4904329", "4904345", "4904361", "4904377", "4904393", "5192937", "5193161", "5193177", "5193193", "5193209", "5193225", "5193321", "5193337", "5193417",
|
|
|
|
// "5193433",
|
|
|
|
"5193449",
|
|
|
|
// "5201385", "5213385", "5213481", "5213529", "5234665", "5234857", "5234889", "5235001", "5324265", "5775977", "5775993",
|
|
|
|
"5776009",
|
|
|
|
// "5776025",
|
|
|
|
// "6081417", "6081433", "6081449", "6081465", "6081689", "6081705", "6092281", "6092313", "6101305", "6102457", "6102473", "6102489",
|
|
|
|
"6102521",
|
|
|
|
// "6102537", "6102569", "6127433", "6133465", "6242729", "6329129", "6329177", "6329241", "6329305", "6329321", "6738633", "6738809", "6738953", "6752761",
|
|
|
|
// "6752889",
|
|
|
|
// "6752905",
|
|
|
|
// "6752921",
|
|
|
|
// "6752937",
|
|
|
|
// "6752953",
|
|
|
|
// "6760985", "6761049", "6761289",
|
|
|
|
// "6794633",
|
|
|
|
// "7325929", "7326457", "7328265", "7330009", "7330025",
|
|
|
|
// "7330041",
|
|
|
|
// "7330057"
|
2023-08-14 12:22:05 +02:00
|
|
|
]
|
2023-08-14 12:47:17 +02:00
|
|
|
|
|
|
|
let enable_write_gpx_file = true;
|
2023-08-21 16:20:53 +02:00
|
|
|
let just_one_photo_in_folder = false;
|
2023-08-14 10:33:57 +02:00
|
|
|
let folder = "/home/poule/encrypted/stockage-syncable/photos/imagerie kartaview carto tel/kartaview_export_storage/share2tykayn/"
|
2023-08-28 22:57:33 +02:00
|
|
|
let folder_photos = folder + "photo"
|
2023-08-14 12:22:05 +02:00
|
|
|
let dossier_gpx: string = "./output_gpx"
|
2023-08-14 10:33:57 +02:00
|
|
|
let file_gpx: string = "3596249_d875a_60a0f9bf38f99.txt"
|
2023-08-13 23:12:01 +02:00
|
|
|
|
2023-08-14 10:33:57 +02:00
|
|
|
let mini_arguments: any = minimist(process.argv.slice(2))
|
2023-08-14 09:39:49 +02:00
|
|
|
console.log('mini_arguments', mini_arguments)
|
|
|
|
|
2023-08-14 10:33:57 +02:00
|
|
|
if (mini_arguments['sequence']) {
|
2023-08-14 09:39:49 +02:00
|
|
|
sequence_name = mini_arguments['sequence']
|
|
|
|
}
|
2023-08-14 10:33:57 +02:00
|
|
|
if (mini_arguments['folder']) {
|
|
|
|
folder = mini_arguments['folder']
|
|
|
|
}
|
|
|
|
if (mini_arguments['gpx-output']) {
|
|
|
|
dossier_gpx = mini_arguments['gpx-output']
|
|
|
|
}
|
|
|
|
if (mini_arguments['gpx-input']) {
|
|
|
|
file_gpx = mini_arguments['gpx-input']
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-08-21 16:20:53 +02:00
|
|
|
// let dossier_photo: string = folder + "test_photo_apply"
|
|
|
|
let dossier_photo: string = folder_photos
|
2023-08-14 10:33:57 +02:00
|
|
|
let dossier_gpx_input: string = folder + "metadata_file"
|
|
|
|
let path_gpx_input: string = dossier_gpx_input + "/" + sequence_name + "/" + file_gpx
|
|
|
|
|
|
|
|
if (mini_arguments['gpx-input-path']) {
|
|
|
|
path_gpx_input = mini_arguments['gpx-input-path']
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let gpxData: any = {}
|
2023-08-28 22:57:33 +02:00
|
|
|
let exif_commands: any = ['#!/bin/bash', '# apply exif data to photos']
|
2023-08-14 10:33:57 +02:00
|
|
|
|
2023-08-13 23:12:01 +02:00
|
|
|
|
2023-08-14 10:33:57 +02:00
|
|
|
function makeGpxFromKartaview(tableKartaviewTrace: any) {
|
|
|
|
|
|
|
|
console.log('make gpx')
|
2023-08-14 09:39:49 +02:00
|
|
|
let track_points: string = '';
|
2023-08-14 12:47:17 +02:00
|
|
|
|
2023-08-13 23:12:01 +02:00
|
|
|
tableKartaviewTrace.forEach((elem: any) => {
|
2023-08-14 16:25:24 +02:00
|
|
|
// console.log('elem', elem)
|
|
|
|
// console.log('elem', elem[6] *1000)
|
2023-08-28 22:57:33 +02:00
|
|
|
if (elem.length && elem[6]) {
|
|
|
|
let utc_time = new Date(elem[6] * 1000)
|
2023-08-14 12:47:17 +02:00
|
|
|
|
2023-08-28 22:57:33 +02:00
|
|
|
// console.log('utc_time', utc_time.toISOString())
|
|
|
|
track_points = `${track_points}<trkpt lat="${elem[0]}" lon="${elem[1]}">
|
2023-08-14 12:47:17 +02:00
|
|
|
<ele>${elem[2]}</ele>
|
|
|
|
<time>${utc_time.toISOString()}</time>
|
2023-08-14 09:39:49 +02:00
|
|
|
</trkpt>
|
|
|
|
`
|
2023-08-28 22:57:33 +02:00
|
|
|
}else{
|
|
|
|
console.log('!!!!!! makeGpxFromKartaview no good element in gpx', elem)
|
|
|
|
}
|
2023-08-13 23:12:01 +02:00
|
|
|
})
|
|
|
|
|
2023-08-14 09:39:49 +02:00
|
|
|
let content = `<?xml version='1.0' encoding='UTF-8'?>
|
|
|
|
<gpx version="1.1" creator="JOSM GPX export" xmlns="http://www.topografix.com/GPX/1/1"
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
|
|
|
|
<metadata>
|
|
|
|
<desc>trace_gpx_de_demo</desc>
|
|
|
|
<author>
|
|
|
|
<name>somebody</name>
|
|
|
|
</author>
|
|
|
|
<copyright author="somebody">
|
|
|
|
<year>2023</year>
|
|
|
|
<license>https://creativecommons.org/licenses/by-sa/2.5</license>
|
|
|
|
</copyright>
|
|
|
|
<keywords>nada</keywords>
|
|
|
|
</metadata>
|
|
|
|
<trk>
|
|
|
|
<trkseg>
|
|
|
|
${track_points}
|
|
|
|
</trkseg>
|
|
|
|
</trk>
|
|
|
|
</gpx>`
|
2023-08-13 23:12:01 +02:00
|
|
|
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
2023-08-14 16:25:24 +02:00
|
|
|
function reduceGpxPointsToInterval(sequence_name: any) {
|
|
|
|
|
|
|
|
let photos_count_in_sequence = photo_folders_counter[sequence_name].length
|
|
|
|
let interval = Math.round(gpxData[sequence_name].length / photos_count_in_sequence)
|
|
|
|
let ii = 1;
|
|
|
|
console.log('--------- sequence_name', sequence_name)
|
2023-08-14 16:55:58 +02:00
|
|
|
console.log('--------- nombre de photos ', photos_count_in_sequence)
|
|
|
|
console.log('--------- nombre de points gpx ', gpxData[sequence_name].length)
|
2023-08-14 16:31:58 +02:00
|
|
|
console.log('--------- interval: prendre une donnée gps tous les ', interval, 'points de la trace de séquence')
|
2023-08-14 16:55:58 +02:00
|
|
|
let jj = 0
|
2023-08-14 16:31:58 +02:00
|
|
|
let photo_counter = 0
|
|
|
|
gpxData[sequence_name].forEach((elem: any) => {
|
|
|
|
// only work on an interval of files to assign gps coordinates
|
|
|
|
jj++
|
|
|
|
ii--
|
2023-08-14 16:55:58 +02:00
|
|
|
if (ii <= 0) {
|
2023-08-14 16:31:58 +02:00
|
|
|
// set the gps coordinates to the picture in sequence
|
|
|
|
let timestamp = elem[6] * 1000
|
|
|
|
let lat = elem[0]
|
|
|
|
let lon = elem[1]
|
|
|
|
let date = new Date(timestamp)
|
2023-08-21 16:20:53 +02:00
|
|
|
let date_simezone_indicator = ''; // +2:00
|
2023-08-28 22:57:33 +02:00
|
|
|
let iso = moment(date).format('YYYY:MM:DD HH:mm:ss') + date_simezone_indicator
|
2023-08-14 16:55:58 +02:00
|
|
|
|
2023-08-21 16:20:53 +02:00
|
|
|
ii = interval * 1
|
2023-08-14 16:55:58 +02:00
|
|
|
|
2023-08-21 16:20:53 +02:00
|
|
|
let file_photo_name = photo_folders_counter[sequence_name][photo_counter]
|
2023-08-14 16:55:58 +02:00
|
|
|
|
2023-08-14 16:31:58 +02:00
|
|
|
|
2023-08-14 16:55:58 +02:00
|
|
|
if (file_photo_name) {
|
|
|
|
// set exif data
|
2023-08-21 16:20:53 +02:00
|
|
|
// console.log('file_photo_name to apply exif data', photo_counter, file_photo_name)
|
|
|
|
|
2023-08-28 22:57:33 +02:00
|
|
|
|
2023-08-21 16:20:53 +02:00
|
|
|
// -File:ModificationDateTime=="${iso}" \\
|
|
|
|
// -File:CreateDate="${iso}" \\
|
2023-08-28 22:57:33 +02:00
|
|
|
let exif_command = `\n
|
2023-08-21 16:20:53 +02:00
|
|
|
exiftool -overwrite_original \\
|
|
|
|
-GPSDateTime="${iso}" \\
|
|
|
|
-AllDates="${iso}" \\
|
|
|
|
-MediaCreateDate="${iso}" \\
|
|
|
|
-MediaModifyDate="${iso}" \\
|
|
|
|
-TrackCreateDate=="${iso}" \\
|
|
|
|
-TrackModifyDate=="${iso}" \\
|
|
|
|
-GPSLongitude="${lon}" \\
|
|
|
|
-GPSLatitude="${lat}" \\
|
2023-08-28 22:57:33 +02:00
|
|
|
"${dossier_photo + '/' + sequence_name + '/' + file_photo_name}"
|
2023-08-21 16:20:53 +02:00
|
|
|
`
|
|
|
|
|
|
|
|
// -GPSLongitudeRef="West" \
|
|
|
|
// -GPSLatitudeRef="North" \
|
|
|
|
// exiftool -overwrite_original '-AllDates<gpsdatetime' "${dossier_photo+'/'+sequence_name+'/'+file_photo_name}"
|
|
|
|
|
|
|
|
exif_commands.push(exif_command)
|
2023-08-14 16:55:58 +02:00
|
|
|
}
|
|
|
|
photo_counter++
|
2023-08-14 16:31:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
})
|
2023-08-28 22:57:33 +02:00
|
|
|
exif_commands.push(`geovisio upload --api-url https://panoramax.openstreetmap.fr "${dossier_photo}/${sequence_name}"`)
|
2023-08-21 16:20:53 +02:00
|
|
|
let exif_bash_file = exif_commands.join('\n')
|
|
|
|
|
2023-08-28 22:57:33 +02:00
|
|
|
writeFile(`_exif_commmand_sequence_${sequence_name}.sh`, exif_bash_file)
|
|
|
|
|
2023-08-21 16:20:53 +02:00
|
|
|
console.log('\n ----- apply exif data:', `\n bash ${dossier_gpx}/${exif_bash_file}`)
|
|
|
|
|
|
|
|
console.log('\n\nDONE for sequence_name', sequence_name)
|
2023-08-14 16:25:24 +02:00
|
|
|
}
|
2023-08-13 23:12:01 +02:00
|
|
|
|
2023-08-14 16:25:24 +02:00
|
|
|
function openKartaviewTxtGPX(filepath: any, sequence_name: string) {
|
2023-08-21 16:20:53 +02:00
|
|
|
console.log('openKartaviewTxtGPX filepath', filepath)
|
2023-08-14 12:22:05 +02:00
|
|
|
let boom = filepath.split('/')
|
|
|
|
let fileName = boom[boom.length - 1]
|
2023-08-28 22:57:33 +02:00
|
|
|
console.log('openKartaviewTxtGPX fileName', fileName,)
|
2023-08-13 23:12:01 +02:00
|
|
|
fs.readFile(filepath, 'utf8', (err, data) => {
|
|
|
|
if (err) {
|
|
|
|
throw err;
|
|
|
|
}
|
|
|
|
const gpx_content = data;
|
|
|
|
let lines = gpx_content.split('\n')
|
|
|
|
console.log('lines.length', lines.length)
|
2023-08-14 09:39:49 +02:00
|
|
|
|
2023-08-14 10:33:57 +02:00
|
|
|
let tableKartaviewTrace: any = [];
|
|
|
|
|
2023-08-14 09:39:49 +02:00
|
|
|
// loop on all lines, only take the lines that contain :g:
|
2023-08-13 23:12:01 +02:00
|
|
|
lines.forEach((elem: any) => {
|
|
|
|
if (elem.indexOf(":g:") > -1) {
|
2023-08-14 09:39:49 +02:00
|
|
|
// do stuff on gpxData to enrich it
|
2023-08-13 23:12:01 +02:00
|
|
|
let boom = elem.split(':')
|
2023-08-14 12:47:17 +02:00
|
|
|
let timestamp = boom[0]
|
|
|
|
|
2023-08-13 23:12:01 +02:00
|
|
|
let gpsmodel = boom[2]
|
|
|
|
let gps = gpsmodel.split(';')
|
2023-08-14 12:47:17 +02:00
|
|
|
gps.push(timestamp)
|
2023-08-13 23:12:01 +02:00
|
|
|
tableKartaviewTrace.push(gps)
|
2023-08-14 16:25:24 +02:00
|
|
|
// let date = new Date(boom[0] * 1000)
|
2023-08-14 12:22:05 +02:00
|
|
|
// console.log('*', date, gps[0], gps[1])
|
2023-08-13 23:12:01 +02:00
|
|
|
}
|
|
|
|
})
|
2023-08-14 16:25:24 +02:00
|
|
|
gpxData[sequence_name] = [...tableKartaviewTrace]
|
|
|
|
|
|
|
|
|
2023-08-28 22:57:33 +02:00
|
|
|
console.log(' makeGpxFromKartaview for sequence ', sequence_name)
|
2023-08-14 10:33:57 +02:00
|
|
|
let content_gpx = makeGpxFromKartaview(tableKartaviewTrace)
|
2023-08-13 23:12:01 +02:00
|
|
|
|
2023-08-14 12:47:17 +02:00
|
|
|
|
|
|
|
if (enable_write_gpx_file) {
|
|
|
|
|
|
|
|
writeFile('' + fileName + '_trace.gpx', content_gpx)
|
|
|
|
}
|
2023-08-14 16:55:58 +02:00
|
|
|
if (Object.keys(gpxData).length === folders_list_txt.length) {
|
2023-08-14 16:25:24 +02:00
|
|
|
gather()
|
|
|
|
}
|
2023-08-13 23:12:01 +02:00
|
|
|
// console.log('gpx_content', gpx_content)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-08-14 09:39:49 +02:00
|
|
|
let cwd = path.dirname(process.cwd()) + '/' + path.basename(process.cwd())
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get a list of all files in a path
|
|
|
|
* @param folderPath
|
|
|
|
*/
|
2023-08-14 10:33:57 +02:00
|
|
|
async function getAllFilesInFolder(folderPath: string) {
|
2023-08-14 09:39:49 +02:00
|
|
|
let filesList: any = []
|
|
|
|
|
2023-08-21 16:20:53 +02:00
|
|
|
console.log('------ reading folder ', folderPath)
|
2023-08-14 10:33:57 +02:00
|
|
|
filesList = fs.readdirSync(folderPath);
|
2023-08-21 16:20:53 +02:00
|
|
|
if (just_one_photo_in_folder) {
|
|
|
|
filesList = [filesList.shift()]
|
|
|
|
}
|
2023-08-14 10:33:57 +02:00
|
|
|
return filesList;
|
2023-08-14 09:39:49 +02:00
|
|
|
|
2023-08-13 23:12:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-08-14 09:39:49 +02:00
|
|
|
function writeFile(fileName: string, fileContent: any) {
|
|
|
|
console.log('write file', fileName)
|
|
|
|
return fs.writeFile(
|
|
|
|
`${dossier_gpx}/${fileName}`,
|
|
|
|
fileContent,
|
|
|
|
'utf8',
|
|
|
|
(err) => {
|
|
|
|
if (err) {
|
|
|
|
console.log(`Error writing file: ${err}`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2023-08-14 16:25:24 +02:00
|
|
|
let photo_folders_counter: any = {}
|
|
|
|
|
2023-08-14 12:47:17 +02:00
|
|
|
function listPhotos(sequence_number: string) {
|
2023-08-21 16:20:53 +02:00
|
|
|
console.log('------- listPhotos dossier_photo', dossier_photo + '/' + sequence_number)
|
2023-08-14 12:47:17 +02:00
|
|
|
let photo_folder = dossier_photo + '/' + sequence_number;
|
|
|
|
getAllFilesInFolder(photo_folder)
|
2023-08-14 12:22:05 +02:00
|
|
|
.then(listOfFiles => {
|
2023-08-14 16:25:24 +02:00
|
|
|
photo_folders_counter[sequence_number] = listOfFiles
|
2023-08-14 12:22:05 +02:00
|
|
|
})
|
|
|
|
}
|
2023-08-14 09:39:49 +02:00
|
|
|
|
2023-08-14 10:33:57 +02:00
|
|
|
async function getGPXAndEnrichExifOfPhotosInFolder(sequence_number: string) {
|
|
|
|
|
|
|
|
// get metadata txt file in metadata folder
|
|
|
|
getAllFilesInFolder(dossier_gpx_input + '/' + sequence_number)
|
|
|
|
.then(listOfFiles => {
|
2023-08-14 12:47:17 +02:00
|
|
|
|
2023-08-21 16:20:53 +02:00
|
|
|
console.log('listOfFiles', listOfFiles.length)
|
|
|
|
// console.log('listOfFiles', listOfFiles)
|
|
|
|
listOfFiles.forEach((jpg_file: string) => {
|
|
|
|
openKartaviewTxtGPX(dossier_gpx_input + '/' + sequence_number + '/' + jpg_file, sequence_number)
|
2023-08-14 10:33:57 +02:00
|
|
|
})
|
|
|
|
}, err => {
|
|
|
|
throw new Error(err)
|
|
|
|
})
|
|
|
|
|
2023-08-14 12:47:17 +02:00
|
|
|
listPhotos(sequence_number)
|
|
|
|
|
2023-08-14 16:25:24 +02:00
|
|
|
|
2023-08-14 10:33:57 +02:00
|
|
|
}
|
|
|
|
|
2023-08-14 16:55:58 +02:00
|
|
|
/**
|
|
|
|
* runs after all sequences have gotten their photo and gpx data
|
|
|
|
*/
|
2023-08-14 16:25:24 +02:00
|
|
|
function gather() {
|
|
|
|
|
|
|
|
|
|
|
|
// console.log('gpxData', gpxData)
|
|
|
|
console.log('sequences', folders_list_txt)
|
|
|
|
folders_list_txt.forEach((sequence: string) => {
|
|
|
|
|
|
|
|
reduceGpxPointsToInterval(sequence)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
2023-08-14 16:55:58 +02:00
|
|
|
|
|
|
|
function main() {
|
|
|
|
|
|
|
|
console.log('dossiers à traiter: ', folders_list_txt.length)
|
|
|
|
folders_list_txt.forEach((elem: string) => {
|
|
|
|
getGPXAndEnrichExifOfPhotosInFolder(elem).then(r => {
|
|
|
|
console.log('r', r)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// run it all
|
|
|
|
main()
|
|
|
|
|