SQL Server geography latitude longitude error
问题 I'm using geography data type for calculating shortest distance. CREATE TABLE Landmark ( Id int, Latitude FLOAT, Longitude FLOAT ) INSERT Landmark VALUES (1, 49.242458, -123.153465), (2, 49.249381, -122.866683) WITH GeographyLandmark AS ( SELECT Id, geography::STPointFromText('POINT(' + CAST(Latitude AS VARCHAR(20)) + ' ' + CAST(Longitude AS VARCHAR(20)) + ')', 4326) Location FROM Landmark ) --this query calculates distance between point and localizations in meters SELECT Id, geography: