Update: this has been reported to Microsoft.
In a simple (SQL Server 2012) table with a geography column (name geopoint) populated with a few simple rows points similar to this. POINT (-0.120875610750927 54.1165118880234) etc. executing
select [geopoint].[STAsText](),
[geopoint].Lat lat,
[geopoint].Long long
from mytable
produces this
Untitled1 lat long
POINT (-0.120875610750927 54.1165118880234) 54.1165118880234 -0.120875610750927
which looks like a bug, but it is too basic and should have been caught before release. So am I doing something wrong?
Added info
IT professionals should look for the details of Microsoft's implementation of SQL server on MSDN. As there can be differences in implementation. As per this case. As a proof of this I just checked PostGist's implementation of ST_AsText for a geographic column. This works fine! and result is as one would expect. Therefore the bug is in implementation of SQL. The correct result for the above example should be
POINT (54.1165118880234 -0.120875610750927 ) 54.1165118880234 -0.120875610750927
Dare I say there is a high likelihood that there are other bugs associated with functions working geographic columns. As basic functionality in this area has not been fully tested.
POINTare latitude followed by longitude, rather than longitude followed by latitude.STPointFromText:SET @g = geography::STPointFromText('POINT(-122.34900 47.65100)', 4326);. If you can provide me a link to a map showing the location on earth of that point (at a latitude of-122, as you claim) then you might have a point.-122.34900. Where on the globe do you think that this point is located? The convention in WKT islong lat, notlat long. This is different from the convention you may have expected but it's not a bug. What it may indicate is that because you assumed it waslat long, you've entered your data incorrectly.