2024-04-15 14:26:34 +02:00
|
|
|
export type GPXFile = {
|
2024-04-16 13:02:22 +02:00
|
|
|
attributes: GPXFileAttributes;
|
2024-04-15 14:26:34 +02:00
|
|
|
metadata: Metadata;
|
2024-04-16 11:48:42 +02:00
|
|
|
wpt: Waypoint[];
|
|
|
|
trk: Track[];
|
2024-04-15 14:26:34 +02:00
|
|
|
};
|
|
|
|
|
2024-04-16 13:02:22 +02:00
|
|
|
export type GPXFileAttributes = {
|
|
|
|
creator: string;
|
|
|
|
[key: string]: string;
|
|
|
|
};
|
|
|
|
|
2024-04-15 14:26:34 +02:00
|
|
|
export type Metadata = {
|
|
|
|
name?: string;
|
|
|
|
desc?: string;
|
|
|
|
author?: Author;
|
|
|
|
link?: Link;
|
|
|
|
time?: Date;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type Link = {
|
2024-04-16 13:02:22 +02:00
|
|
|
attributes: LinkAttributes;
|
2024-04-15 14:26:34 +02:00
|
|
|
text?: string;
|
|
|
|
type?: string;
|
|
|
|
};
|
|
|
|
|
2024-04-16 13:02:22 +02:00
|
|
|
export type LinkAttributes = {
|
|
|
|
href: string;
|
|
|
|
};
|
|
|
|
|
2024-04-15 14:26:34 +02:00
|
|
|
export type Waypoint = {
|
2024-04-16 13:02:22 +02:00
|
|
|
attributes: Coordinates;
|
2024-04-15 14:26:34 +02:00
|
|
|
ele?: number;
|
|
|
|
time?: Date;
|
|
|
|
name?: string;
|
|
|
|
cmt?: string;
|
|
|
|
desc?: string;
|
|
|
|
link?: Link;
|
|
|
|
sym?: string;
|
|
|
|
type?: string;
|
|
|
|
};
|
|
|
|
|
2024-04-16 13:02:22 +02:00
|
|
|
export type Coordinates = {
|
|
|
|
lat: number;
|
|
|
|
lon: number;
|
|
|
|
};
|
|
|
|
|
2024-04-15 14:26:34 +02:00
|
|
|
export type Track = {
|
|
|
|
name?: string;
|
|
|
|
cmt?: string;
|
|
|
|
desc?: string;
|
|
|
|
src?: string;
|
|
|
|
link?: Link;
|
|
|
|
type?: string;
|
|
|
|
trkseg: TrackSegment[];
|
2024-04-16 11:48:42 +02:00
|
|
|
extensions?: TrackExtensions;
|
2024-04-16 09:54:41 +02:00
|
|
|
};
|
|
|
|
|
2024-04-16 11:48:42 +02:00
|
|
|
export type TrackExtensions = {
|
2024-04-16 13:02:22 +02:00
|
|
|
'gpx_style:line'?: LineStyleExtension;
|
2024-04-16 11:48:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export type LineStyleExtension = {
|
2024-04-16 09:54:41 +02:00
|
|
|
color?: string;
|
|
|
|
opacity?: number;
|
|
|
|
weight?: number;
|
2024-04-15 14:26:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export type TrackSegment = {
|
|
|
|
trkpt: TrackPoint[];
|
|
|
|
};
|
|
|
|
|
|
|
|
export type TrackPoint = {
|
2024-04-16 13:02:22 +02:00
|
|
|
attributes: Coordinates;
|
2024-04-15 14:26:34 +02:00
|
|
|
ele?: number;
|
|
|
|
time?: Date;
|
2024-04-16 09:54:41 +02:00
|
|
|
extensions?: TrackPointExtensions;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type TrackPointExtensions = {
|
2024-04-16 13:02:22 +02:00
|
|
|
'gpxtpx:TrackPointExtension'?: TrackPointExtension;
|
|
|
|
'gpxpx:PowerExtension'?: PowerExtension;
|
2024-04-16 11:48:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export type TrackPointExtension = {
|
2024-04-16 13:02:22 +02:00
|
|
|
'gpxtpx:hr'?: number;
|
|
|
|
'gpxtpx:cad'?: number;
|
|
|
|
'gpxtpx:atemp'?: number;
|
|
|
|
'gpxtpx:Extensions'?: {
|
2024-04-16 11:48:42 +02:00
|
|
|
surface?: string;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export type PowerExtension = {
|
2024-04-16 13:02:22 +02:00
|
|
|
'gpxpx:PowerInWatts'?: number;
|
2024-04-16 11:48:42 +02:00
|
|
|
}
|
2024-04-15 14:26:34 +02:00
|
|
|
|
|
|
|
export type Author = {
|
|
|
|
name?: string;
|
|
|
|
email?: string;
|
|
|
|
link?: Link;
|
|
|
|
};
|