| Simon Greener wrote: |
(Note: Google Maps uses Lat/Long - what does Virtual Earth use?)
| |
Simon,
Good to see you here! :-) But I must disagree with the above: The order of coordinates for "Latitude / Longitude" (also known as "lat/lon") projection in KML defined by Google is lon / lat.
See http://code.google.com/apis/kml/documentation/kml_tags_21.html
Let me switch gears to defend Microsoft, which I think is being unfairly distracted in this thread with discussion about parsing OGC mush. That's not the point. The point is about a new type, GEOGRAPHY, that can make life easier for some users. That's a different mission than something like GEOMETRY provided for use with existing GIS data by experienced GIS people.
I get the feeling that some folks reading this thread are new to geospatial data and don't realize that the common English phrase "Latitude / Longitude" data is exactly opposite to the way the data is actually ordered in the world of GIS data. You are not alone if that is what you expected.
That's not intended as a criticism, because instead it is a very solid argument for having the coordinate ordering the way it is in the GEOGRAPHY type if that is indeed intended for non-GIS people. If the point of having
GEOGRAPHY is to have something for non-GIS types the (lat,lon) ordering makes perfect sense.
The most natural thing in the world for someone new to geospatial data is to think, nay, to *expect* that when someone says they have "Latitude / Longitude" data that the coordinate ordering for that data is indeed in (lat,lon) order just like the English phrase commonly used to describe it says it is. People familiar with geospatial data understand that the English phrase is just a phrase, not a mathematical description of coordinate axis ordering, but beginners usually do not know that. Manifold has sold more heavy-duty GIS to new users than all other GIS vendors put together, so I assure readers this is a very real phenomenon.
Part of what SQL Server can do by adding spatial extensions is broadening the benefit of geospatial technology to a much wider audience. Microsoft has the reach to do that as other vendors cannot. Reconciling the expectations of geospatial beginners (even if they may be experts in DBMS and not at all beginners in programming) with the accumulated practice within terabytes of GIS data is not easy, but having two types is a useful innovation that can make it happen.
If Microsoft can make life easier for people new to geospatial data with coordinate ordering in GEOGRAPHY that's different from legacy GIS data, well, that's perfectly OK and a good enough reason for me. Whatever it is, we will support it. Microsoft has also implemented GEOMETRY for those using GIS data so there is no downside for those who are working with GIS data.
As I have nagged before, if you are using GIS data you had better be storing it in GEOMETRY so you don't lose essential information, like datum, required for accuracy. Use GEOMETRY with GIS data, whether it is "Latitude / Longitude" projection or not, and there is no issue whatsoever with coordinate ordering. Therefore, my advice to Simon would be to use GEOMETRY and be happy you have that.
Regards to all,
Dimitri
A postscript for those who like discussions of technical minutia:
Just so everyone knows I'm not capriciously arguing that the ordering in GEOGRAPHY is OK because I don't understand that (lon, lat) ordering is universal, let me cite some examples and correct some misconceptions that may have crept into this thread, beginning with the notion that anyone should care what OGC does or misconception over what GML or EPSG specifies.
First, OGC "standards" are nearly useless in real life. Isaac hit the nail on the head when he wrote "
Also, if we assume the specification covers geographic coordinates, we find that the specification is woefully inadequate." Well said!
Speaking of nearly-useless OGC "standards"
, that brings up GML, which has been famously described as "perhaps the worst format for geospatial data, second only to braille." Given that GML represents perhaps less than a millionth of the geospatial data out there I don't think it matters at all in a practical sense what coordinate ordering GML uses. But, if we are splitting hairs and pretending that GML matters, I must respectfully disagree with the suggestion that GML specifies (lat, lon) ordering.
The GML standard states that the order of coordinates should follow that of the projection. Not very useful from a practical point of view. So although GML does include means to explicitly specify the order of coordinate axes, it does not explicitly choose (lat,lon) order over (lon, lat) order. In any event the use of GML for lat/lon data is so rare we have yet to see a real-world GML file with lat/lon data regardless of coordinate order.
Regarding EPSG, I also respectfully disagree this is normally treated as (lat,lon) ordering: The EPSG guys designed their system so that the axes used by a coordinate system are numbered. I have never heard of anyone (Oracle, etc., ) reflecting the order of these axes on actual coordinate values. I can see the point of SQL Server doing it as it does in GEOGRAPHY and I respect that 100%, but I think all the justification one needs is that is how it is done in SQL Server, as how it is done there becomes the de facto standard we will follow.
I have been challenged in the past for stating that (lon,lat) ordering is "universal" practice in GIS data, so let me be specific why I state this is the case: Other notable formats that use (lon,lat) ordering for so-called "Latitude / Longitude" projections:
1. Coordinates in TIGER/Line data sets produced by the US Census Bureau are in lat/lon. The order of coordinates is lon/lat.
2. Coordinates in NTAD data sets produced by the US Bureau of Transportation Statistics are in lat/lon. The order of coordinates is lon/lat.
3. Coordinates in GDF and other data sets produced by TeleAtlas, a large European mapping company, are in lat/lon. The order of coordinates is lon/lat.
4. Coordinates in VMap data sets produced by the US Department of Defense may be in several different coordinate systems. For lat/lon coordinate systems the order of coordinates is lon/lat.
5. Coordinates in SHP (ESRI "shapefiles"), MIF (MapInfo) and other files produced by current GIS packages may be in many different coordinate systems. For lat/lon coordinate systems the order of coordinates is lon/lat in those systems.
6. Coordinates in DGN (Intergraph, Bentley), DWG (Autodesk and many others), DXF and similar files produced by current CAD packages may be in many different coordinate systems. For lat/lon coordinate systems the order of coordinates is lon/lat.
7. Coordinates in WKB / WKT values stored in traditional databases such as Oracle, DB/2, PostgreSQL and MySQL (which have no equivalents to the GEOGRAPHY type but are nonetheless used to store a lot of data in current circulation) may be in many different coordinate systems. For lat/lon coordinate systems the order of coordinates is lon/lat.
8. Depicting coordinates in a raster (Virtual Earth screen displays being an example) nearly always follows XY notation, which for lat/lon rasters nearly always means lon/lat.
9. When people start using SQL Server 2008 for storing spatial data, many of them will use the GEOMETRY type even though their data is in lat/lon, for various reasons. For these people the coordinate order will again be lon/lat and that order will be preserved when that data is used in GIS products.
Whew! ... that's what I mean by "universal" usage, as the above formats comprise, what? 99.99%? of the data out there. If anyone can point to even a single repository of "Latitude / Longitude" data that uses (lat, lon) ordering instead of (lon, lat) ordering, I'd be very grateful to see the URL to that repository.
For all the above, Microsoft's choice of ordering for GEOGRAPHY is spot on if, indeed, this can help folks new to geospatial data who take the phrase "Latitude / Longitude" literally, as they usually do. As proud as anyone might be about GIS usage to date, even 100% of all that data out there is not 1% of what is coming as geospatial technology goes mainstream, so what people new to the art expect is not something lightly to be discounted.
If it was me I probably would have been conventional and stuck to (lon, lat) ordering. But then there is no doubt I would have taken on the task of explaining over and over again to hundreds of millions of people in the future (not one of whom will be reading any documentation) that by "Latitude / Longitude" I really meant them to understand that they should be putting their coordinates in "Longitude / Latitude" order. Anyone who criticizes Microsoft in this choice should think twice about how they would handle that.