Opened 12 years ago
Closed 12 years ago
#4626 closed defect (fixed)
MSSQL Spatial and 3D issue
Reported by: | ngarel | Owned by: | tamas |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | OGR_SRS | Version: | 1.9.0 |
Severity: | major | Keywords: | mssql spatial |
Cc: |
Description
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?
Change History (4)
comment:1 by , 12 years ago
Owner: | changed from | to
---|
comment:2 by , 12 years ago
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
With regards to the native format it has now been fixed within the scope of this bug #4806. Still also require to fix for GeometryFormat=wkt and GeometryFormat=wkb