When creating maps for others to use it is sometimes helpful to provide descriptions such as "After 5.4 miles you will see the trail head on the right." Determining the distance along a long, non-linear track can be difficult if your favorite GIS tools don't have that functionality. The Track Distance (TrkDis) utility calculates a running distance total from each end and appends the values to each point within the track.
Download the TrkDis utility and place the executable file in any convenient location. Putting the executable in a directory that is within your system PATH will allow the utility to be executed from any directory.
The utility takes a CSV file (longitude,latitude) of a track as input and calculates the running distance total from each end. These values are appended to the original point values and output in CSV format to STDOUT. Here is a sample input file:
Running the utility with the input file produces the following output:
The utility defaults to calculating distances in miles. Options are provided to specify the unit of distance to be feet, kilometers or meters - run the utility with no parameters to display the full program usage.
The calculation used (Haversine formula) assumes a perfect (spherical) earth but seems accurate enough for this purpose.
Last updated: 1 December 2008
Copyright © 2006-2017 David Gadberry