derive a distance matrix for a set of locations given their longitude and latitude
] [-l filename
- -a float
- switch to XY modus, using aspect ratio (>= 1.0)
- -l filename
- file with numbered labels
- -o filename
- output file
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
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.
File with locations
The file with locations is a coordinate
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.
File with numbered labels
If the option -l
is used to specify a
, 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
with distances defined in kilometres.