
Because the valued-case algorithm is significantly slower than the unvalued-case algorithm, ignore.eval should be set to TRUE wherever possible. Setting ignore.eval=FALSE will change this behavior, with edge values being interpreted as distances where edge values reflect proximity or tie strength, transformation may be necessary. geodist (without loss of generality) treats all paths as directed, a fact which should be kept in mind when interpreting geodist output.īy default, geodist ignores edge values (except for NAed edges, which are dropped when na.omit=TRUE). Note that the choice of infinite path length for disconnected vertex pairs is non-canonical (albeit common), and some may prefer to simply treat these as missing values. 3) = round(54972.271.3)īoth ellipsoid and spherical distances calculated by geodist are accurate to machine precision (to the millimeter).This routine is used by a variety of other functions many of these will allow the user to provide manually precomputed geodist output so as to prevent expensive recomputation. FlindersPeak to Buninyong using GRS80 ellipsoid Geodist lat1 lon1 lat2 lon2, gen(ds) sphere Geodist lat1 lon1 lat2 lon2, gen(dWGS84) // just to compare * used by -geodist- for distances on a shpere is 6371km. * of the ellipsoid by using a very large flattening ratio.

* Use Vincenty's equations to check spherical distances. Rainsford line (e), International ellipsoid Rainsford line (d), International ellipsoid Rainsford line (c), International ellipsoid Rainsford line (b), International ellipsoid * on the ellipsoid with application of nested equations, Survey Review 22(176): (1975) Direct and inverse solutions of geodesics * Duplicate all 5 examples Vincenty used to compare his results with those of Here's a small subset:Ĭode: * Choose to run this script under the executable versionĬscript "geodist - Stata version `c(stata_version)' " adofile geodist With respect to the validity of the results produced by my programs, I'm always happy to provide all certification scripts that I use upon request. That's because ArcGIS works with projected coordinate systems.



I'm no expert on ArcGIS, but as far as I can tell, ArcGIS has historically calculated Euclidean distances between features. The Haversine and Laws of Cosine equations (which are mathematically equivalent) are used if the earth is modeled as a sphere. By default, the shape of the earth is approximated using the WGS 1984 reference ellipsoid (what GPS devices and Google Earth/Map use) and distances are computed using Vincenty's inverse solution equations. Both are available from SSC.Īs explained in detail in the help file, geodist calculates the length of the shortest curve between two points along the surface of a mathematical model of the earth. I'm the author of geodist, which is a standalone version of the distance routines I wrote for geonear, a program that finds nearest neighbors using geodetic distances.
