derive a distance matrix for a set of locations given their longitude and latitude
coordinates
This program calculates the distance matrix of a set of locations, given
their coordinates, which must be defined in longitude and latitude
(unless the option
-a is used).
Resulting distances are in kilometres. The results are not entirely
accurate due to two assumptions which are neither entirely accurate:
- earth is a perfect sphere;
- earth has a circumference of 40000km.
The file with locations is a
coordinate
file with coordinates defined as longitude and latitude.
With the option
-a, the program switches to XY modus. The
coordinates are not in longitude and latitude, but are ordinary
X and Y coordinates in a rectangular grid. The resulting distances
are not in kilometres, but in whatever unit the grid uses.
The value to option -a is the aspect ratio between distances
along the X axis and the Y axis. It is a value equal to or
greater than 1. Distances along the X axis are reduced by
dividing them with this value.
If the option
-l is used to specify a
label file, the difference matrix for
that set of labels is created.
If no label file is specified, a
difference matrix for all locations is created, using the locations in
the order they are given in the file with locations.
The output file is a
difference matrix
file with distances defined in kilometres.