Module[{fs,data,f,p},
Echo@SetDirectory["C:\\drorbn\\Album\\Summaries"];
fs=FileNames["../*/*.gpx"]⋃FileNames["../*/*.kml"];
fs=Complement[fs,
Union[
StringReplace[{"@.gpx"->".gpx", "@.kml"->".kml"}]/@Select[fs,StringPart[#,-5]=="@"&],
(*FileNames["../2024_Greater_Toronto_Stay_in_Place/*.gpx"],
FileNames["../2025_Greater_Toronto_Stay_in_Place/*.gpx"],*)
{
"..\\2022.05.08-12_Napoli_and_Around\\Day1Path.kml","..\\2022.05.08-12_Napoli_and_Around\\Day2Path.kml","..\\2022.05.08-12_Napoli_and_Around\\Day3Path.kml","..\\2022.05.08-12_Napoli_and_Around\\Day4Path.kml","..\\2022.05.08-12_Napoli_and_Around\\Day5Path.kml",
"..\\2021.07.03_Stratford_-_New_Hamburg_-_Wellesley_Loop\\2021-07-03_06-04_Sat.gpx"
}
]
];
If[Or[
!FileExistsQ["AllTracksData.m"],Max[FileDate/@fs]>FileDate["AllTracksData.m"]
],
Monitor[Short[data=Union@Table[
"Geometry"/.Import[f,"Data"]/.p:GeoPosition[{_,None}]:>Nothing[Print["In ",f," removed ",p,"."]],
{f,fs}]],f];
data=DeleteCases[data,Line[GeoPosition[{_,_,0}]],∞];
Put[data,"AllTracksData.m"],
data=Get["AllTracksData.m"]
];
Echo@ResetDirectory[];
data
]