id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 4626,MSSQL Spatial and 3D issue,ngarel,tamas,"Topic: http://osgeo-org.1560.n6.nabble.com/gdal-dev-MSSQL-Spatial-and-3D-issue-td4892552.html After investigation from the message posted, the writing is probably fine. The reading is not. Using MS SQL Server management tool, I can query the proper 3d coordinates using: SELECT TOP 1000 [ogr_fid] ,[ogr_geometry].AsTextZM() FROM [Spatial].[dbo].[test01] According to this blog: http://blogs.msdn.com/b/davidlean/archive/2008/11/01/sql-2008-spatial-samples-part-2-of-n-background-on-spatial-types-well-known-text-wkt.aspx AsTextZM displays 4 dimensions... STAsText displays 2. Don't know what STAsBinary does.. In OGRMSSQLSpatialTableLayer::BuildFields if ( poDS->GetGeometryFormat() == MSSQLGEOMETRY_WKB ) { osFieldList += ""].STAsBinary() as [""; osFieldList += pszGeomColumn; } else if ( poDS->GetGeometryFormat() == MSSQLGEOMETRY_WKT ) { osFieldList += ""].STAsText() as [""; osFieldList += pszGeomColumn; } Should AsTextZM() be used somewhere? ",defect,closed,high,,OGR_SRS,1.9.0,major,fixed,mssql spatial,