[Fdo-trac] [fdo-trac] #844: SQL Server provider flipping X/Y coordinates for geometry (SRID between 4120 and 4999) (was: SQL Server provider flipping X/Y coordinates for points (SRID = 4326))

Dan Stoica dan.stoica at autodesk.com
Mon Aug 13 14:27:12 PDT 2012


The reason for flipping the ordinates is very well explained here:

http://www.sql-server-helper.com/sql-server-2008/convert-latitude-longitude-to-geography-point.aspx/

I quote:

"As you can see from this UPDATE statement, the longitude is specified first before the latitude.  The reason is because in the Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation, the format is (x, y).  Geographic coordinates are usually specified by Lat/Long but between these two, the X is the Longitude while the Y is the Latitude.

You may be wondering why the X-coordinate is the Longitude while the Y-coordinate is the Latitude.  Think of the equator of the earth as the x-axis while the prime meridian is the Y-axis.  Longitude is defined as the distance from the prime meridian along the x-axis (or the equator).  Similarly, latitude is defined as the distance from the equator along the Y-axis"

In conclusion the SqlServer provider is working correctly because is flipping X/Y coordinates both on writing and reading.

-----Original Message-----
From: FDO [mailto:trac_fdo at osgeo.org] 
Sent: Friday, August 10, 2012 3:30 AM
Cc: fdo-trac at lists.osgeo.org
Subject: Re: [fdo-trac] #844: SQL Server provider flipping X/Y coordinates for geometry (SRID between 4120 and 4999) (was: SQL Server provider flipping X/Y coordinates for points (SRID = 4326))

#844: SQL Server provider flipping X/Y coordinates for geometry (SRID between
4120 and 4999)
---------------------------------+------------------------------------------
   Reporter:  jng                |       Owner:  danstoica
       Type:  defect             |      Status:  new      
   Priority:  blocker            |   Milestone:  3.7.0    
  Component:  SQLServer Spatial  |     Version:  3.7.0    
   Severity:  1                  |    Keywords:           
External_id:                     |  
---------------------------------+------------------------------------------

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/844#comment:3>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list