No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENCE
insertGPX.js
package.json
readme.md

readme.md

Add GPX to routing_points.xml

This script inserts a track defined by a GPX file into the routing_points.xml file used by MapFactor Navigation so you can create a route and use it in the app. You will need to replace the routing_points.xml in your install directory on your device to see the added track.

As Route-Importer for MapFactor failed to work on my Android Marshmellow device, I had to resort to writing my own GPX convertor for long cycle rides.

To Run

node insertGPX.js <your_gpx_file> [random_sample_threshold]

Example usage:

# With waypoints from "brouter-leicester-cardiff.gpx", randomly pick to include any single way point
# with a 5% chance.
node insertGPX.js brouter-leicester-cardiff.gpx 0.05

Routers

Notes

Lat-long coordinates from GPX are in Decimal format vs Degrees Minutes Seconds (Milliseconds) format in the routing_points.xml file. http://stackoverflow.com/questions/17311316/convert-between-degree-and-miliseconds

// Degrees-Minutes-Seconds-MilliSeconds to Decimal
function DMSMS_to_DEC(ms){
    return (ms / 3600000) % 360;
}

// Reverse
function DEC_to_MS(deg){
    return Math.round(deg * 60 * 60 * 1000);
}

License

This software is licensed under GPLv2. See LICENCE file for details.