View Source GPXEr (GPXEr v0.0.1)
Implements high level functions for working with GPX files. The gpx struct is a wrapper around the gpx data and implements the Access behaviour. This means that you can use the Access/Kernel functions to access the data.
It also implements some helper functions for working with the track data.
Examples
{:ok, doc} = GPXEr.load("test/test.gpx")
Kernel.get_in(doc, [:name]) == "Capital Ring"
doc = Kernel.put_in(doc, [:name], "Test")
Kernel.get_in(doc, [:name]) == "Test"
{:ok, gpx} = GPXEr.load("test/test.gpx")
# TODO: Add example for Track map
{:ok, gpx} = GPXEr.load("test/test.gpx")
# Add distance data to the gpx data
gpx = GPXEr.Track.put_in_distance(gpx)
# TODO: Add example for Track map
Summary
Functions
Calculates the great-circle distance between two GPS/GPX points on the Earth's surface (specified in kilometers).
Load a GPX file from a file path. Returns a tuple of {:ok, gpx} or {:error, reason}
Saves a GPX struct to the give file path in the gpx format. Returns a tuple of :ok or {:error, reason}
Functions
Calculates the great-circle distance between two GPS/GPX points on the Earth's surface (specified in kilometers).
The two points must be specified as {latitude, longitude} tuples.
Load a GPX file from a file path. Returns a tuple of {:ok, gpx} or {:error, reason}
Saves a GPX struct to the give file path in the gpx format. Returns a tuple of :ok or {:error, reason}