Bar chart of the distance from Seattle to four stops: Spokane 368.7 kilometers, Chicago 2,796.1, Philadelphia 3,829.0 and Boston 4,011.0, with Seattle to Boston highlighted as 2,492.3 miles

Distance Between Two Points on the Earth With the geography Type

The distance between two points on the earth takes one method call once you store the points as a geography value. This post builds a small table of five US cities, turns latitude and longitude into points, and measures with STDistance in meters, kilometers and miles. It also compares the answer with a flat map formula and a sphere formula, and shows the error for swapped arguments.

Read More