distgeocode(geocode1, geocode2 [, method] )
The distgeocode
function calculates the distance, in miles,
between two given geocodes. It uses the "Great Circle" method for
calculation by default, which is very accurate. A faster, but less
accurate, calculation can be done with the Pythagorean theorem. It is
not designed for distances on a sphere, however, and becomes somewhat
inaccurate at larger distances and on paths that approach the poles.
To use the Pythagorean theorem, pass a third string parameter,
"pythagorean
", to force that method. "greatcircle
"
can also be specified as a method.
For example:
EXAMPLE
For examples of using distgeocode
, see the geocode
script in the texis/samples
directory.
SEE ALSOdistlatlon
For a very fast method that leverages geocodes for selecting cities
within a certain radius, see the <code2geo>
and <geo2code>
functions in the Vortex manual.