Thanks to Paul Ramsey, Bill Dollins, Morten Nielsen and others, Microsoft has said that they plan to implement longitude-latitude ordering in WKB and WKT for both the geography and geometry types. Bill put it best IMO as to why this change needed to happen with SQL Server 2008.
For me, the issue is consistency. Regardless of the mindsets of professionals vs. non-professionals or the imprecision of the OGC spec, the bottom line is that the same call behaves differently for two related data types.
Now sure it would have been possible to work around this, but it makes no sense for Microsoft to do things different from everyone else. Now I still see Microsoft using the GML example of axis order to justify their choice, but given that the standard is long/lat I can’t understand why they’d want to be different.
Now you know why folks such as Howard Butler were “unhappy” that Google named their blog Google LatLong rather than the more correct Google LongLat.
Man, this place looks expensive. I feel like I’m wasting a fortune just standing here.


12 responses so far ↓
1
J Wallis
// Dec 28, 2007 at 5:59 am
THANK YOU MICROSOFT! Once again, MS waits for everyone to do it their way, then they come in and find a market doing it right.
2
Christopher Schmidt
// Dec 28, 2007 at 6:57 am
Note that Microsoft was not totally in the wrong here — simply misunderstanding.
It is true that GML, with geographic coordinate systems, does do y,x ordering — because that’s the way the CRS is defined. However, the GML example is a poor comparison for a couple reasons:
Implementors of GML seldom actually do this. MapServer, for example, is ignorant of coordinate order — in large part because the only place that it is actually described is in the ordering of XML elements in a GML CRS document! Hardly the most intuitive leap for most developers.WKT *is not GML* — and because it’s not GML, it does not have, for example, the ability to include information about the coordinate system in use inside the text itself, which makes it somewhat incomplete for the “it’s like GML” argument.
Unlike many others, I don’t think Microsoft was trying to ignore a de facto standard, or create a new spec — they simply couldn’t figure out what they were supposed to do. Having fallen into a similar mess with OpenLayers myself (the OpenLayers ‘center’ points are called LonLat, even when projected, because I didn’t know any better), I’m aware of how easy it is.
In any case, they’ve fallen into a trap that’s easy to fall into, and hard to dig out of — I’m glad that they weren’t so deeply entrenched as to make it impossible at this stage in the game, and I’m sure the community as a whole is grateful for the change.
3
Dave Smith
// Dec 28, 2007 at 7:42 am
I’ll carry my comments over from Paul Ramsey’s blog -
The order depends on the context. Usually the order is well-defined in the EPSG database for the specific CRS in question.
Further, I’d argue there is NOT any “overwhelming community consensus” that it should be Long/Lat versus Lat/Long - as examples organizations like OGC, OASIS, IETF, and ISO more often than not use the convention of Lat/Long versus Long/Lat - you will see KML 3.0 with Lat/Long, as an example.
Seems that often folks just skim the surface and rapidly arrive at a conclusion, as opposed to digging a bit deeper and actually filling in all the pieces - and this is the case with lat/long order, which, on the surface, might not appear to be explicitly defined, but instead be seen as a one-size-fits-all, when in fact, there may actually BE explicit definitions elsewhere, and cases which specifically vary from one CRS or application to the next.
You say “toe-MAH-toe” and he says “tah-MAY-dah”… But at the end of the day it’s still a tomato, no matter how sliced, pureed, et cetera…
4
Christopher Schmidt
// Dec 28, 2007 at 9:14 am
Dave:
There *is* an overwhelming community consensus that *WKT* is long/lat. (I would assume that WKB follows along the same lines.) Since the discussion here is *entirely* about WKT — not GML, KML, or anything else — your statement that there is not an overwhelming community consensus is, so far as I can tell, Just Plain Wrong.
No one is arguing here that coordinate ordering in all cases is well-defined to be long/lat. However, for WKT, it is, and that’s the technology in question.
5
Dave Smith
// Dec 28, 2007 at 9:46 am
My point was that WKT is just one part of a much bigger issue. Not everything in the GIS world uses or recognizes WKT.
The reasons cited by Microsoft for using Lat/Long in that order were specifically cited as taken from a GML reference - which they evidently contorted into their WKT implementation. I chalk that up to lack of adequate research.
And as I stated above - they need to dig much deeper. The GIS world (and I find this to be particularly the case with the Google/VE/NeoGeo world in particular) is typically only skimming the surface on many of these issues, and missing a lot of the depth and breadth that is out there, with respect to communities of practice, conventions, standards, and the existing corpus of knowledge on cartography, geodesy, data, applications, algorithms and related material. This phenomenon is plainly evident in many of the implementations seen out there of late.
So, in short, while there definitely needs to be consensus on WKT (which I never disputed), the world is much bigger than just WKT, and in that context, my comment about “lack of consensus” regarding Lat/Long versus Long/Lat remains - and probably will remain.
6
Christopher Schmidt
// Dec 28, 2007 at 10:14 am
Okay, I think we’re in violent agreement here — we both think that WKT is, in all cases other than the current release of MS’s offering, Long/Lat. We both agree that all other representations may differ. (Some do, some don’t, some change across versions.)
Microsoft got the implementation of WKT wrong. I think we both agree on that. The reason they got it wrong doesn’t make them more right.
There was a statement you made:
“Further, I’d argue there is NOT any “overwhelming community consensus” that it should be Long/Lat versus Lat/Long - as examples organizations like OGC, OASIS, IETF, and ISO more often than not use the convention of Lat/Long versus Long/Lat - you will see KML 3.0 with Lat/Long, as an example.”
There is an overwhelming community consensus on the ordering of WKT, and that’s the only thing in question in this discussion.
7
Dylan Beaudette
// Dec 28, 2007 at 11:00 am
Aside from anything related to WKT or GML, mathematics (upon which geodesy, cartography, and GIS are founded) has long used the (x,y) coordinate pair to describe coordinate spaces. It is not surprising that those without a background in the fundamentals of geodesy and cartography re-implement them poorly?
8
sstein
// Dec 28, 2007 at 11:41 am
@Dylan: Bravo!!! that’s something I agree with (and let’s call x=easting and y=northing: just to make it more clear ;o)
9
George Silva
// Dec 28, 2007 at 11:50 am
Doesnt ArcGis uses Long/Lat format?
10
Morten
// Dec 28, 2007 at 6:57 pm
Dylan: We have long used X and Y to describe _cartesian_ coordinate systems, but never for describing coordinates in a spheric coordinate system which we are talking about here. I believe ρ and φ are commonly used here, but when it comes to earth, we have always used latitude and longitude (in what ever order - I don’t care, I just look at the postfix for north/south and east/west).
Microsofts argument was exactly that X,Y was made for planar, and they had come up with a new geography type that wasn’t covered specifically by OGC’s WKT and WKB, and thought it was best to look at their other standards where spheric coordinate systems was covered.
Although I can see where Microsoft was coming from this, I also think its a good thing they swapped them back for interoperability.
A whole other discussion is whether OGC got this right and based coordinate ordering on the EPSG definition in the first place. Personally I think it is a mess; coordinate ordering should instead only be applied at the presentation layer. Just look at how much more complex WMS1.3.0 has become just because we now have to look up into an SR database to figure out the coordinate ordering before we can create or parse a WMS request (they could at least have placed coordinate ordering in the Capabilities instead so every WMS implementation doesn’t need an EPSG database)
11
Morten
// Dec 28, 2007 at 7:17 pm
>I believe ρ and φ are commonly used here
Whoops, I meant φ and θ (ρ is what would be the equivalent of the height). Furthermore in matemathics φ,θ is the common* order which incidently corresponds to lat,long (or zenith,azimuth for some mathematicians).
*as common as it can get with this “rare” coordinate system
To me conceptionally long=x and lat=y (meaning that’s how I imagine it in my head because I can’t help project it onto a flat map with north up).
12
Cellulose
// Jan 4, 2008 at 10:34 am
The blame for this lies squarely in the hands of the OGC. Despite their proclamations of having an interoperability standard, it’s more like a loose set of guidelines.
This whole thing is complicated by the fact that current implementations are certified to an older standard that pre-dates the coordinate-system ordering consensus… it’s unclear whether the current WKT/WKB should be lon/lat lat/lon since I have yet to find a DB certified to the latest version.
But then, this is typicial for standards organizations. I was punished once for complaining too much about a standard and nominated to participate on a standard committee. There’s just so many competing interests that it makes it very difficult to get a good standard.
Leave a Comment