1-to-1 mapping between gpx schema and types

This commit is contained in:
vcoppe
2024-04-16 11:48:42 +02:00
parent 6dd945c284
commit 3dc9b7d703
7 changed files with 364 additions and 1042 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.DS_Store

View File

@@ -1,4 +1,4 @@
export { type GPXFile, type Metadata, type Waypoint, type Track, type TrackSegment, type TrackPoint, type Author } from './types';
export * from './types';
export { parseGPX } from './io';

View File

@@ -1,247 +1,61 @@
import { XMLParser } from "fast-xml-parser";
import { Author, GPXFile, Link, Metadata, Track, TrackPoint, TrackPointExtensions, TrackSegment, TrackStyleExtension, Waypoint } from "./types";
const arrayTypes = ['trk', 'trkseg', 'trkpt', 'wpt'];
import { GPXFile } from "./types";
export function parseGPX(gpxData: string): GPXFile {
const parser = new XMLParser({
isArray: (name: string) => arrayTypes.includes(name),
ignoreAttributes: false,
attributeNamePrefix: "",
removeNSPrefix: true,
isArray: (name: string) => {
return name === 'trk' || name === 'trkseg' || name === 'trkpt' || name === 'wpt';
},
attributeValueProcessor(attrName, attrValue, jPath) {
if (attrName === 'lat' || attrName === 'lon') {
return parseFloat(attrValue);
}
return attrValue;
},
transformTagName(tagName: string) {
if (tagName === 'power') {
// Transform the simple <power> tag to the more complex <gpxpx:PowerExtension> tag, the nested <gpxpx:PowerInWatts> tag is then handled by the tagValueProcessor
return 'PowerExtension';
}
return tagName;
},
tagValueProcessor(tagName, tagValue, jPath, hasAttributes, isLeafNode) {
if (isLeafNode) {
if (tagName === 'ele') {
return parseFloat(tagValue);
}
if (tagName === 'time') {
return new Date(tagValue);
}
if (tagName === 'hr' || tagName === 'cad' || tagName === 'atemp' || tagName === 'PowerInWatts' || tagName === 'opacity' || tagName === 'weight') {
return parseFloat(tagValue);
}
if (tagName === 'PowerExtension') {
// Finish the transformation of the simple <power> tag to the more complex <gpxpx:PowerExtension> tag
// Note that this only targets the transformed <power> tag, since it must be a leaf node
return {
'PowerInWatts': parseFloat(tagValue)
};
}
}
return tagValue;
},
transformAttributeName(attributeName) {
if (attributeName !== 'lat' && attributeName !== 'lon' && attributeName !== 'creator' && attributeName !== 'href') {
return `@_${attributeName}`;
}
return attributeName;
},
});
const parsed = parser.parse(gpxData);
const result: GPXFile = {
creator: parsed.gpx.creator ? parsed.gpx.creator : "",
metadata: parseMetadata(parsed.gpx.metadata),
waypoints: parsed.gpx.wpt ? parsed.gpx.wpt.map(parseWaypoint) : [],
tracks: parsed.gpx.trk ? parsed.gpx.trk.map(parseTrack) : [],
};
return result;
return parsed.gpx;
}
function parseMetadata(metadata: any): Metadata {
const result: Metadata = {};
if (metadata.name) {
result.name = metadata.name;
}
if (metadata.desc) {
result.desc = metadata.desc;
}
if (metadata.author) {
result.author = parseAuthor(metadata.author);
}
if (metadata.link) {
result.link = parseLink(metadata.link);
}
if (metadata.time) {
result.time = new Date(metadata.time);
}
return result;
}
function parseAuthor(author: any): Author {
const result: Author = {};
if (author.name) {
result.name = author.name;
}
if (author.email) {
result.email = author.email;
}
if (author.link) {
result.link = parseLink(author.link);
}
return result;
}
function parseLink(link: any): Link {
const result: Link = {
href: link.href,
};
if (link.text) {
result.text = link.text;
}
if (link.type) {
result.type = link.type;
}
return result;
}
function parseWaypoint(waypoint: any): Waypoint {
const result: Waypoint = {
lat: parseFloat(waypoint.lat),
lon: parseFloat(waypoint.lon),
};
if (waypoint.ele) {
result.ele = parseFloat(waypoint.ele);
}
if (waypoint.time) {
result.time = new Date(waypoint.time);
}
if (waypoint.name) {
result.name = waypoint.name;
}
if (waypoint.cmt) {
result.cmt = waypoint.cmt;
}
if (waypoint.desc) {
result.desc = waypoint.desc;
}
if (waypoint.link) {
result.link = parseLink(waypoint.link);
}
if (waypoint.sym) {
result.sym = waypoint.sym;
}
if (waypoint.type) {
result.type = waypoint.type;
}
return result;
}
function parseTrack(track: any): Track {
const result: Track = {
trkseg: track.trkseg.map(parseTrackSegment),
};
if (track.name) {
result.name = track.name;
}
if (track.cmt) {
result.cmt = track.cmt;
}
if (track.desc) {
result.desc = track.desc;
}
if (track.src) {
result.src = track.src;
}
if (track.link) {
result.link = parseLink(track.link);
}
if (track.type) {
result.type = track.type;
}
if (track.extensions && track.extensions.hasOwnProperty('gpx_style:line')) {
result.style = parseTrackStyleExtension(track.extensions['gpx_style:line']);
}
return result;
}
function parseTrackStyleExtension(extensions: any): TrackStyleExtension {
const result: TrackStyleExtension = {};
if (extensions.color) {
result.color = extensions.color;
}
if (extensions.opacity) {
result.opacity = parseFloat(extensions.opacity);
}
if (extensions.weight) {
result.weight = parseFloat(extensions.weight);
}
return result;
}
function parseTrackSegment(segment: any): TrackSegment {
return {
trkpt: segment.trkpt.map(parseTrackPoint),
};
}
function parseTrackPoint(point: any): TrackPoint {
const result: TrackPoint = {
lat: parseFloat(point.lat),
lon: parseFloat(point.lon),
};
if (point.ele) {
result.ele = parseFloat(point.ele);
}
if (point.time) {
result.time = new Date(point.time);
}
if (point.extensions) {
result.extensions = parseTrackPointExtensions(point.extensions);
}
return result;
}
function parseTrackPointExtensions(extensions: any): TrackPointExtensions {
const result: TrackPointExtensions = {};
if (extensions.hasOwnProperty('gpxtpx:TrackPointExtension')) {
const gpxtpxExtensions = extensions['gpxtpx:TrackPointExtension'];
if (gpxtpxExtensions.hasOwnProperty('gpxtpx:hr')) {
result.hr = parseFloat(gpxtpxExtensions['gpxtpx:hr']);
}
if (gpxtpxExtensions.hasOwnProperty('gpxtpx:cad')) {
result.cad = parseFloat(gpxtpxExtensions['gpxtpx:cad']);
}
if (gpxtpxExtensions.hasOwnProperty('gpxtpx:atemp')) {
result.atemp = parseFloat(gpxtpxExtensions['gpxtpx:atemp']);
}
if (gpxtpxExtensions.hasOwnProperty('gpxtpx:Extensions')) {
const gpxtpxInnerExtensions = gpxtpxExtensions['gpxtpx:Extensions'];
if (gpxtpxInnerExtensions.surface) {
result.surface = gpxtpxInnerExtensions.surface;
}
}
}
if (extensions.power) {
result.power = parseFloat(extensions.power);
} else if (extensions.hasOwnProperty('gpxpx:PowerExtension')) {
const gpxpxExtensions = extensions['gpxpx:PowerExtension'];
if (gpxpxExtensions.hasOwnProperty('gpxpx:PowerInWatts')) {
result.power = parseFloat(gpxpxExtensions['gpxpx:PowerInWatts']);
}
} else if (extensions.hasOwnProperty('gpxpx:PowerInWatts')) {
result.power = parseFloat(extensions['gpxpx:PowerInWatts']);
}
return result;
}

View File

@@ -1,8 +1,8 @@
export type GPXFile = {
creator: string;
metadata: Metadata;
waypoints: Waypoint[];
tracks: Track[];
wpt: Waypoint[];
trk: Track[];
};
export type Metadata = {
@@ -40,10 +40,14 @@ export type Track = {
link?: Link;
type?: string;
trkseg: TrackSegment[];
style?: TrackStyleExtension;
extensions?: TrackExtensions;
};
export type TrackStyleExtension = {
export type TrackExtensions = {
line?: LineStyleExtension;
};
export type LineStyleExtension = {
color?: string;
opacity?: number;
weight?: number;
@@ -62,12 +66,22 @@ export type TrackPoint = {
};
export type TrackPointExtensions = {
TrackPointExtension?: TrackPointExtension;
PowerExtension?: PowerExtension;
};
export type TrackPointExtension = {
hr?: number;
cad?: number;
atemp?: number;
power?: number;
surface?: string;
};
Extensions?: {
surface?: string;
};
}
export type PowerExtension = {
PowerInWatts?: number;
}
export type Author = {
name?: string;

View File

@@ -18,481 +18,641 @@
<trkpt lat="50.790867" lon="4.404968">
<ele>109.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.790714" lon="4.405036">
<ele>110.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.790336" lon="4.405259">
<ele>110.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.790165" lon="4.405331">
<ele>110.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.790008" lon="4.405359">
<ele>110.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.789818" lon="4.405359">
<ele>109.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.789409" lon="4.40534">
<ele>107.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.789105" lon="4.405411">
<ele>106.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.788799" lon="4.405527">
<ele>108.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.788645" lon="4.405606">
<ele>109.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.7885" lon="4.405711">
<ele>110.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78822" lon="4.405959">
<ele>112.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787956" lon="4.406092">
<ele>112.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787814" lon="4.406143">
<ele>113.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787674" lon="4.406177">
<ele>114.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787451" lon="4.406199">
<ele>115.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787297" lon="4.406177">
<ele>114.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78716" lon="4.406098">
<ele>114.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787045" lon="4.405984">
<ele>114.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786683" lon="4.405653">
<ele>114.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786538" lon="4.405543">
<ele>115.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78635" lon="4.405441">
<ele>115.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786275" lon="4.40542">
<ele>115.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786182" lon="4.405435">
<ele>116.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786121" lon="4.405475">
<ele>115.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786042" lon="4.405558">
<ele>115.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785821" lon="4.405925">
<ele>114.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785672" lon="4.406119">
<ele>112.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785516" lon="4.406256">
<ele>110.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785384" lon="4.406364">
<ele>109.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785126" lon="4.406475">
<ele>106.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784697" lon="4.406537">
<ele>104.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784591" lon="4.40657">
<ele>104.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784507" lon="4.406612">
<ele>103.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784435" lon="4.40669">
<ele>103.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784209" lon="4.407148">
<ele>103.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784162" lon="4.407257">
<ele>103.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784077" lon="4.407372">
<ele>104.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784006" lon="4.407435">
<ele>105.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783924" lon="4.407471">
<ele>106.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783837" lon="4.407486">
<ele>107.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783771" lon="4.407472">
<ele>108.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783697" lon="4.407428">
<ele>109.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783626" lon="4.407363">
<ele>110.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783548" lon="4.407274">
<ele>110.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783458" lon="4.407134">
<ele>110.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783123" lon="4.406435">
<ele>111.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782982" lon="4.406168">
<ele>112.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782871" lon="4.406044">
<ele>113.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78279" lon="4.406021">
<ele>113.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782714" lon="4.406018">
<ele>113.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782607" lon="4.406047">
<ele>113.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782405" lon="4.406194">
<ele>114.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782175" lon="4.406413">
<ele>115.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781749" lon="4.407018">
<ele>118.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781654" lon="4.407316">
<ele>119.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781563" lon="4.407764">
<ele>121.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781487" lon="4.407984">
<ele>122.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781422" lon="4.408216">
<ele>122.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781395" lon="4.408508">
<ele>123.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781399" lon="4.409114">
<ele>126.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781367" lon="4.409428">
<ele>128.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781286" lon="4.409607">
<ele>129.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78116" lon="4.409789">
<ele>130.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.780804" lon="4.409993">
<ele>130.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.780389" lon="4.410334">
<ele>131.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.780232" lon="4.410563">
<ele>132.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.780094" lon="4.410827">
<ele>132.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.779723" lon="4.411582">
<ele>135.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.779591" lon="4.411791">
<ele>135.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.779125" lon="4.412435">
<ele>132.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.778676" lon="4.412979">
<ele>134.0</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.778194" lon="4.413466">
<ele>136.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.777427" lon="4.414302">
<ele>137.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.777165" lon="4.414736">
<ele>137.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776927" lon="4.415201">
<ele>137.5</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776778" lon="4.415613">
<ele>137.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776553" lon="4.416425">
<ele>134.8</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776326" lon="4.417304">
<ele>132.3</ele>
<extensions>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776129" lon="4.418383">
<ele>129.5</ele>
<extensions>
<power>210</power>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>210</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
</trkseg>

View File

@@ -1,658 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.topografix.com/GPX/gpx_style/0/2 http://www.topografix.com/GPX/gpx_style/0/2/gpx_style.xsd"
xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1"
xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"
xmlns:gpx_style="http://www.topografix.com/GPX/gpx_style/0/2" version="1.1" creator="https://gpx.studio">
<metadata>
<name>with_power</name>
<author>
<name>gpx.studio</name>
<link href="https://gpx.studio"></link>
</author>
</metadata>
<trk>
<name>with_power</name>
<type>Cycling</type>
<trkseg>
<trkpt lat="50.790867" lon="4.404968">
<ele>109.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.790714" lon="4.405036">
<ele>110.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.790336" lon="4.405259">
<ele>110.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.790165" lon="4.405331">
<ele>110.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.790008" lon="4.405359">
<ele>110.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.789818" lon="4.405359">
<ele>109.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.789409" lon="4.40534">
<ele>107.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.789105" lon="4.405411">
<ele>106.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.788799" lon="4.405527">
<ele>108.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.788645" lon="4.405606">
<ele>109.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.7885" lon="4.405711">
<ele>110.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78822" lon="4.405959">
<ele>112.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787956" lon="4.406092">
<ele>112.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787814" lon="4.406143">
<ele>113.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787674" lon="4.406177">
<ele>114.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787451" lon="4.406199">
<ele>115.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787297" lon="4.406177">
<ele>114.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78716" lon="4.406098">
<ele>114.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.787045" lon="4.405984">
<ele>114.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786683" lon="4.405653">
<ele>114.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786538" lon="4.405543">
<ele>115.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78635" lon="4.405441">
<ele>115.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786275" lon="4.40542">
<ele>115.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786182" lon="4.405435">
<ele>116.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786121" lon="4.405475">
<ele>115.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.786042" lon="4.405558">
<ele>115.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785821" lon="4.405925">
<ele>114.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785672" lon="4.406119">
<ele>112.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785516" lon="4.406256">
<ele>110.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785384" lon="4.406364">
<ele>109.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.785126" lon="4.406475">
<ele>106.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784697" lon="4.406537">
<ele>104.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784591" lon="4.40657">
<ele>104.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784507" lon="4.406612">
<ele>103.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784435" lon="4.40669">
<ele>103.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784209" lon="4.407148">
<ele>103.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784162" lon="4.407257">
<ele>103.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784077" lon="4.407372">
<ele>104.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.784006" lon="4.407435">
<ele>105.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783924" lon="4.407471">
<ele>106.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783837" lon="4.407486">
<ele>107.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783771" lon="4.407472">
<ele>108.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783697" lon="4.407428">
<ele>109.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783626" lon="4.407363">
<ele>110.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783548" lon="4.407274">
<ele>110.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783458" lon="4.407134">
<ele>110.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.783123" lon="4.406435">
<ele>111.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782982" lon="4.406168">
<ele>112.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782871" lon="4.406044">
<ele>113.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78279" lon="4.406021">
<ele>113.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782714" lon="4.406018">
<ele>113.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782607" lon="4.406047">
<ele>113.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782405" lon="4.406194">
<ele>114.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.782175" lon="4.406413">
<ele>115.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781749" lon="4.407018">
<ele>118.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781654" lon="4.407316">
<ele>119.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781563" lon="4.407764">
<ele>121.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781487" lon="4.407984">
<ele>122.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781422" lon="4.408216">
<ele>122.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781395" lon="4.408508">
<ele>123.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781399" lon="4.409114">
<ele>126.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781367" lon="4.409428">
<ele>128.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.781286" lon="4.409607">
<ele>129.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.78116" lon="4.409789">
<ele>130.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.780804" lon="4.409993">
<ele>130.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.780389" lon="4.410334">
<ele>131.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.780232" lon="4.410563">
<ele>132.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.780094" lon="4.410827">
<ele>132.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.779723" lon="4.411582">
<ele>135.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.779591" lon="4.411791">
<ele>135.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.779125" lon="4.412435">
<ele>132.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.778676" lon="4.412979">
<ele>134.0</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.778194" lon="4.413466">
<ele>136.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.777427" lon="4.414302">
<ele>137.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.777165" lon="4.414736">
<ele>137.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776927" lon="4.415201">
<ele>137.5</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776778" lon="4.415613">
<ele>137.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776553" lon="4.416425">
<ele>134.8</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776326" lon="4.417304">
<ele>132.3</ele>
<extensions>
<gpxpx:PowerExtension>
<gpxpx:PowerInWatts>200</gpxpx:PowerInWatts>
</gpxpx:PowerExtension>
</extensions>
</trkpt>
<trkpt lat="50.776129" lon="4.418383">
<ele>129.5</ele>
<extensions>
<power>210</power>
</extensions>
</trkpt>
</trkseg>
</trk>
</gpx>

View File

@@ -13,9 +13,9 @@ describe("Parsing tests", () => {
expect(result.metadata.author.name).toBe("gpx.studio");
expect(result.metadata.author.link.href).toBe("https://gpx.studio");
expect(result.tracks.length).toBe(1);
expect(result.trk.length).toBe(1);
const track = result.tracks[0];
const track = result.trk[0];
expect(track.name).toBe("simple");
expect(track.type).toBe("Cycling");
expect(track.trkseg.length).toBe(1);
@@ -40,14 +40,14 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
expect(result.tracks.length).toBe(2);
expect(result.trk.length).toBe(2);
const track_1 = result.tracks[0];
const track_1 = result.trk[0];
expect(track_1.name).toBe("track 1");
expect(track_1.trkseg.length).toBe(1);
expect(track_1.trkseg[0].trkpt.length).toBe(49);
const track_2 = result.tracks[1];
const track_2 = result.trk[1];
expect(track_2.name).toBe("track 2");
expect(track_2.trkseg.length).toBe(1);
expect(track_2.trkseg[0].trkpt.length).toBe(28);
@@ -58,9 +58,9 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
expect(result.tracks.length).toBe(1);
expect(result.trk.length).toBe(1);
const track = result.tracks[0];
const track = result.trk[0];
expect(track.trkseg.length).toBe(2);
expect(track.trkseg[0].trkpt.length).toBe(49);
expect(track.trkseg[1].trkpt.length).toBe(28);
@@ -71,9 +71,9 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
expect(result.waypoints.length).toBe(1);
expect(result.wpt.length).toBe(1);
const waypoint = result.waypoints[0];
const waypoint = result.wpt[0];
expect(waypoint.lat).toBe(50.7836710064975);
expect(waypoint.lon).toBe(4.410764082658738);
expect(waypoint.ele).toBe(122.0);
@@ -88,7 +88,7 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
const track = result.tracks[0];
const track = result.trk[0];
const segment = track.trkseg[0];
for (let i = 0; i < segment.trkpt.length; i++) {
@@ -104,16 +104,17 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
const track = result.tracks[0];
const track = result.trk[0];
const segment = track.trkseg[0];
for (let i = 0; i < segment.trkpt.length; i++) {
expect(segment.trkpt[i]).toHaveProperty('extensions');
expect(segment.trkpt[i].extensions).toHaveProperty('hr');
expect(segment.trkpt[i].extensions).toHaveProperty('TrackPointExtension');
expect(segment.trkpt[i].extensions.TrackPointExtension).toHaveProperty('hr');
}
expect(segment.trkpt[0].extensions.hr).toBe(150);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.hr).toBe(160);
expect(segment.trkpt[0].extensions.TrackPointExtension.hr).toBe(150);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.TrackPointExtension.hr).toBe(160);
});
it("Cadence", () => {
@@ -121,16 +122,17 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
const track = result.tracks[0];
const track = result.trk[0];
const segment = track.trkseg[0];
for (let i = 0; i < segment.trkpt.length; i++) {
expect(segment.trkpt[i]).toHaveProperty('extensions');
expect(segment.trkpt[i].extensions).toHaveProperty('cad');
expect(segment.trkpt[i].extensions).toHaveProperty('TrackPointExtension');
expect(segment.trkpt[i].extensions.TrackPointExtension).toHaveProperty('cad');
}
expect(segment.trkpt[0].extensions.cad).toBe(80);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.cad).toBe(90);
expect(segment.trkpt[0].extensions.TrackPointExtension.cad).toBe(80);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.TrackPointExtension.cad).toBe(90);
});
it("Temperature", () => {
@@ -138,16 +140,17 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
const track = result.tracks[0];
const track = result.trk[0];
const segment = track.trkseg[0];
for (let i = 0; i < segment.trkpt.length; i++) {
expect(segment.trkpt[i]).toHaveProperty('extensions');
expect(segment.trkpt[i].extensions).toHaveProperty('atemp');
expect(segment.trkpt[i].extensions).toHaveProperty('TrackPointExtension');
expect(segment.trkpt[i].extensions.TrackPointExtension).toHaveProperty('atemp');
}
expect(segment.trkpt[0].extensions.atemp).toBe(21);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.atemp).toBe(22);
expect(segment.trkpt[0].extensions.TrackPointExtension.atemp).toBe(21);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.TrackPointExtension.atemp).toBe(22);
});
it("Power 1", () => {
@@ -155,16 +158,17 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
const track = result.tracks[0];
const track = result.trk[0];
const segment = track.trkseg[0];
for (let i = 0; i < segment.trkpt.length; i++) {
expect(segment.trkpt[i]).toHaveProperty('extensions');
expect(segment.trkpt[i].extensions).toHaveProperty('power');
expect(segment.trkpt[i].extensions).toHaveProperty('PowerExtension');
expect(segment.trkpt[i].extensions.PowerExtension).toHaveProperty('PowerInWatts');
}
expect(segment.trkpt[0].extensions.power).toBe(200);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.power).toBe(210);
expect(segment.trkpt[0].extensions.PowerExtension.PowerInWatts).toBe(200);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.PowerExtension.PowerInWatts).toBe(210);
});
it("Power 2", () => {
@@ -172,33 +176,17 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
const track = result.tracks[0];
const track = result.trk[0];
const segment = track.trkseg[0];
for (let i = 0; i < segment.trkpt.length; i++) {
expect(segment.trkpt[i]).toHaveProperty('extensions');
expect(segment.trkpt[i].extensions).toHaveProperty('power');
expect(segment.trkpt[i].extensions).toHaveProperty('PowerExtension');
expect(segment.trkpt[i].extensions.PowerExtension).toHaveProperty('PowerInWatts');
}
expect(segment.trkpt[0].extensions.power).toBe(200);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.power).toBe(210);
});
it("Power 3", () => {
const path = "test-data/with_power_3.gpx";
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
const track = result.tracks[0];
const segment = track.trkseg[0];
for (let i = 0; i < segment.trkpt.length; i++) {
expect(segment.trkpt[i]).toHaveProperty('extensions');
expect(segment.trkpt[i].extensions).toHaveProperty('power');
}
expect(segment.trkpt[0].extensions.power).toBe(200);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.power).toBe(210);
expect(segment.trkpt[0].extensions.PowerExtension.PowerInWatts).toBe(200);
expect(segment.trkpt[segment.trkpt.length - 1].extensions.PowerExtension.PowerInWatts).toBe(210);
});
it("Surface", () => {
@@ -206,16 +194,18 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
const track = result.tracks[0];
const track = result.trk[0];
const segment = track.trkseg[0];
for (let i = 0; i < segment.trkpt.length; i++) {
expect(segment.trkpt[i]).toHaveProperty('extensions');
expect(segment.trkpt[i].extensions).toHaveProperty('surface');
expect(segment.trkpt[i].extensions).toHaveProperty('TrackPointExtension');
expect(segment.trkpt[i].extensions.TrackPointExtension).toHaveProperty('Extensions');
expect(segment.trkpt[i].extensions.TrackPointExtension.Extensions).toHaveProperty('surface');
}
expect(segment.trkpt[0].extensions.surface).toBe("asphalt");
expect(segment.trkpt[segment.trkpt.length - 1].extensions.surface).toBe("cobblestone");
expect(segment.trkpt[0].extensions.TrackPointExtension.Extensions.surface).toBe("asphalt");
expect(segment.trkpt[segment.trkpt.length - 1].extensions.TrackPointExtension.Extensions.surface).toBe("cobblestone");
});
it("Track style", () => {
@@ -223,16 +213,17 @@ describe("Parsing tests", () => {
const data = fs.readFileSync(path, 'utf8');
const result = parseGPX(data);
const track = result.tracks[0];
const track = result.trk[0];
expect(track).toHaveProperty('style');
expect(track).toHaveProperty('extensions');
expect(track.extensions).toHaveProperty('line');
expect(track.style).toHaveProperty('color');
expect(track.style).toHaveProperty('opacity');
expect(track.style).toHaveProperty('weight');
expect(track.extensions.line).toHaveProperty('color');
expect(track.extensions.line).toHaveProperty('opacity');
expect(track.extensions.line).toHaveProperty('weight');
expect(track.style.color).toBe("2d3ee9");
expect(track.style.opacity).toBe(0.5);
expect(track.style.weight).toBe(5);
expect(track.extensions.line.color).toBe("2d3ee9");
expect(track.extensions.line.opacity).toBe(0.5);
expect(track.extensions.line.weight).toBe(5);
});
});