I want to convert latitude and longitude to a geography value, to save the data into a SQL Server table in a Geography
column.
I tried with
GeometryData = Microsoft.SqlServer.Types.SqlGeometry.Point(GoogleLatitude, GoogleLongitude, 4326)
and with
GeometryData = Microsoft.SqlServer.Types.SqlGeography.Point(GoogleLatitude, GoogleLongitude, 4326)
but with no success.
“but with no success.” what happened?
Why not just convert in SQL Server. For example: Select geoLatLng = geography::Point(42.360081, -71.058884, 4326)
Note that for geometry longitude comes first in point constructor
@siggemannen Never understood why in VB they went with Lng/Lat. In the real world (especially in distress) you always give Lat then Lng.
@JohnCappelletti yeah, it’s bitten me so many times, especially when one works with WKT strings as well.
Show 5 more comments