Opened 12 years ago
Closed 12 years ago
#844 closed defect (fixed)
SQL Server provider flipping X/Y coordinates for geometry (SRID between 4120 and 4999)
Reported by: | jng | Owned by: | romicadascalescu |
---|---|---|---|
Priority: | blocker | Milestone: | 3.8.0 |
Component: | SQLServer Spatial | Version: | 3.8.0 |
Severity: | 1 | Keywords: | |
Cc: | gluckett | External ID: |
Description
Create a new SQL Server database with the following table
CREATE TABLE [dbo].[COUNTRY]( [ID] [int] IDENTITY(1,1) NOT NULL, [COUNTRY] [varchar](50) NULL, [GEOM] [geometry] NULL, CONSTRAINT [PK_COUNTRY] PRIMARY KEY CLUSTERED ( [ID] ASC ) ) ON [PRIMARY]
Then execute the attached SQL script
The layer when seen from MapGuide OS 2.4/AIMS 2013/AutoCAD Map 2013 shows the points as lat/lon instead of lon/lat (see attached screenshots from SQL Server mgmt studio and MapGuide viewer)
Attachments (3)
Change History (8)
by , 12 years ago
Attachment: | canada_mapguide.png added |
---|
by , 12 years ago
Attachment: | canada_sqlserver.png added |
---|
comment:1 by , 12 years ago
comment:2 by , 12 years ago
This problem happens with any sql server geometry with an SRID in the range of 4120 and 4999 (inclusive).
I notice that such a check is done to determine if coordinates have to be flipped. Is there a reason we have to flip?
comment:3 by , 12 years ago
Summary: | SQL Server provider flipping X/Y coordinates for points (SRID = 4326) → SQL Server provider flipping X/Y coordinates for geometry (SRID between 4120 and 4999) |
---|
by , 12 years ago
Disable coordinate flipping for SRIDs between 4120 and 4999
comment:4 by , 12 years ago
Owner: | changed from | to
---|
comment:5 by , 12 years ago
Milestone: | 3.7.0 → 3.8.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Version: | 3.7.0 → 3.8.0 |
Fixed by code change:
Revision: 6586 Author: romicadascalescu Date: 10:53:51 AM, Tuesday, September 25, 2012 Message: Ticket #844: SQL Server provider flipping X/Y coordinates for geometry (SRID between 4120 and 4999)
Modified : /trunk/Providers/GenericRdbms/Inc/Geometry/Fgf/AllGeometry_c.h Modified : /trunk/Providers/GenericRdbms/Inc/Rdbi/methods.h Modified : /trunk/Providers/GenericRdbms/Inc/Rdbi/proto.h Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Connection/FdoRdbmsConnection.h Modified : /trunk/Providers/GenericRdbms/Src/Fdo/FeatureCommands/FdoRdbmsSimpleInsertCommand.cpp Modified : /trunk/Providers/GenericRdbms/Src/Fdo/FeatureCommands/FdoRdbmsSimpleSelectCommand.cpp Modified : /trunk/Providers/GenericRdbms/Src/Fdo/FeatureCommands/FdoRdbmsSimpleSelectCommand.h Modified : /trunk/Providers/GenericRdbms/Src/Fdo/FeatureCommands/FdoRdbmsSimpleUpdateCommand.cpp Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Other/FdoRdbmsSQLBuilder.h Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPropBindHelper.cpp Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcInsertHandler.cpp Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcUpdateHandler.cpp Modified : /trunk/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.cpp Modified : /trunk/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.h Modified : /trunk/Providers/GenericRdbms/Src/Gdbi/GdbiStatement.cpp Modified : /trunk/Providers/GenericRdbms/Src/Gdbi/GdbiStatement.h Modified : /trunk/Providers/GenericRdbms/Src/Geometry/Fgf/AllGeometry_c.cpp Modified : /trunk/Providers/GenericRdbms/Src/MySQL/Driver/geom_srid.cpp Modified : /trunk/Providers/GenericRdbms/Src/MySQL/Driver/geom_srid.h Modified : /trunk/Providers/GenericRdbms/Src/MySQL/Driver/rdbi_init.cpp Modified : /trunk/Providers/GenericRdbms/Src/ODBCDriver/geom.c Modified : /trunk/Providers/GenericRdbms/Src/ODBCDriver/proto_p.h Modified : /trunk/Providers/GenericRdbms/Src/ODBCDriver/rdbi_init.c Modified : /trunk/Providers/GenericRdbms/Src/PostGis/Driver/geom_srid.c Modified : /trunk/Providers/GenericRdbms/Src/PostGis/Driver/geom_srid.h Modified : /trunk/Providers/GenericRdbms/Src/PostGis/Driver/rdbi_init.c Modified : /trunk/Providers/GenericRdbms/Src/Rdbi/geom_srid.c Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/Fdo/FdoRdbmsSqlServerConnection.cpp Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/Fdo/FdoRdbmsSqlServerConnection.h Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/Fdo/FdoRdbmsSqlServerFilterProcessor.cpp Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/Fdo/FdoRdbmsSqlServerProcessors.cpp Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/Fdo/FdoRdbmsSqlServerProcessors.h Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/ODBCDriver/crt_cursor.c Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/ODBCDriver/fre_cursor.c Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/ODBCDriver/geom.c Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/ODBCDriver/proto_p.h Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/ODBCDriver/rdbi_init.c Modified : /trunk/Providers/GenericRdbms/Src/SQLServerSpatial/ODBCDriver/structs.h Modified : /trunk/Providers/GenericRdbms/Src/UnitTest/SQLServerSpatial/SqlServerFdoSqlCmdTest.cpp Modified : /trunk/Providers/GenericRdbms/Src/UnitTest/SQLServerSpatial/SqlServerFdoSqlCmdTest.h
Stupid attachment limit!
The SQL in question can be found here: https://raw.github.com/gist/3310688/c4acb902a0e87693b663ead73730b5e116d15b9b/sample%20geometry