6

I've been reading Pro Spatial with SQL Server 2012. It discusses the various spatial-reference systems (SRS) that can be used when defining a coordinate system. According to the book, Google uses WGS 84.

Prior to my exposure the SQL Server's functionality (i.e. Geography data type), I've used the Haversine formula to calculate distances between two lat/lng pairs. I'm assuming that it (the Haversine function) makes some assumptions about the Earth's geoid (perhaps the great-circle distance), which suggests that it is using a particular SRS. Is this correct? Could one make use of other SRS (at least ones that use lat/lng pairs) with the function just by changing the great-circle distance?

** edit **

Said another way, does the Haversine formula care is the coordinates are WGS84, NAD83, or another other geodetic datum?

5
  • 3
    The haversine formula computes great circle distances on a sphere. The 'r' in the equation (if using Wikipedia's formulation) is the radius of the sphere.
    – mkennedy
    Commented Sep 11, 2015 at 18:05
  • 1
    A more accurate formula is Vincenty's Formula which factors in the fact that the earth is an ellipsoid
    – Steven Kay
    Commented Sep 11, 2015 at 18:43
  • The errors made when using the Haversine formula to compute geodetic distances are analyzed in the closely related thread at gis.stackexchange.com/questions/25494. Their magnitudes are so enormous compared to the differences between WGS84, NAD83, or any whole-earth geodetic datum, that one could justify answering this question in the negative.
    – whuber
    Commented Sep 11, 2015 at 20:26
  • So, the errors from using a spherical datum (Haversine) when compared to the other shapes (WSG84,NAD83) far outweigh the errors that are introduced by using a lat/lng pair from any of these other datum with the Haversine function. Is this correct? Was the Haversine function designed w/ a particular coordinate system in mind?
    – craig
    Commented Sep 11, 2015 at 20:36
  • Haversine is correct only for spherical coordinates (latitude or colatitude, plus longitude) on a perfect sphere. Haversine is a formula: it's not a datum. It is inappropriate to apply it to geodetic coordinates relative to an ellipsoidal datum, but it is a decent approximation to the extent the ellipsoid can be considered to be perfectly spherical.
    – whuber
    Commented Sep 12, 2015 at 20:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.