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.2
Solution 1:
It looks like you've got the latitude and longitude switched. A couple of things:
An easy sanity check is to use the
Latand/orLongextended properties. Here is the doc forLong.Another extension that Microsoft's implementation provides is the
Pointstatic method for creating points. So instead of having to create the WKT for a point to pass toSTPointFromText, you can just dogeography::Point(Latitude, Longitude, SRID). Here is the doc for that.
Post a Comment for "Sql Server Geography Latitude Longitude Error"