TCX Laps to GeoJSON Markers

13 lines
JSON.stringify({
  "type": "FeatureCollection",
  "features": [...tcx.matchAll(/<Lap[^]+?<Position>[^]*?<LatitudeDegrees>(.+)<\/[^]*?<LongitudeDegrees>(.+)<\//g)].map(([_, lat, lng]) => ({
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [
          +lng, +lat
        ]
      }
    }))
})