Create (or modify) timestamps in an GPX file
npm install @mikaello/gpxfaketimerCreate timestamps for every trackpoint in a GPX file.
``ts
import { createTimestampsEvenly } from "@mikaello/gpxfaketimer";
const exampleGpx =
;
console.log(createTimestampsEvenly(exampleGpx, 0, 100000));
// => will return the same GPX file, only with inside every trkpt:
/*
*/
`
- _createTimestampsEvenly(gpxContent: string, startTime: number, endTime: number) => string_:gpxContent
returns the incoming enriched with timestamps in every trkptstartTime
element. and endTime are milliseconds since epoch.
Not specific for GPX, but just as helper functions
_getUniformDistribution(count: number, intervalStart: number, intervalEnd: number) => number[]_:count
returns an array of length with first element intervalStart and lastintervalEnd
element , all elements in between is evenly distributed between
these extremeties.
You can use the ./example project to ease developing. If you run
yarn start from that folder, you will start a server running a smallyarn dev` in another
application which loads the code from this module. Run
terminal to start to continously watch the code and recompile (and reload
server) when any code changes.
Contributions are welcome :-)