<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><!--ppd1000010--><div class=WordSection1><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I&#8217;m relaunching the following thread:<o:p></o:p></p><p class=MsoNormal><a href="http://lists.osgeo.org/pipermail/gdal-dev/2011-June/029034.html">http://lists.osgeo.org/pipermail/gdal-dev/2011-June/029034.html</a><o:p></o:p></p><p class=MsoNormal>This time with GDAL 1.9 and the problem remains.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Further explanation of what I&#8217;m trying to achieve:<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I would like to write and read 3d spatial data. <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I have a 3d point(<i>-1092.7172471465196</i> <i>122.9009469897652</i> <i>-150.11442565917974)</i> and 3d line (-1363.889169860787 -5.255646621772087 -150.1144256591798,-1109.9664261063763 142.60863989620026 -17.396886979865542)<o:p></o:p></p><p class=MsoNormal>I&#8217;ve have the passed the DIM=3D parameter when creating the layer and made sure that the parameter is being read properly into gdal.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='text-autospace:none'>It seems that writing the LINESTRING into the spatial database is correct because I&#8217;ve been debugging <span style='font-size:9.5pt;font-family:Consolas'>OGRMSSQLSpatialTableLayer::CreateFeature </span>and the SQL statement seems alright for the line:<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'>INSERT INTO [dbo].[test01] (ogr_geometry) VALUES (geometry::STGeomFromText('LINESTRING <b>(-1363.889169860787 -5.255646621772087 -150.1144256591798,-1109.9664261063763 142.60863989620026 -17.396886979865542</b>)',0)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Now if I want to read the data back <b>the Z component seems to be mixed up with other components of other points</b>. Here is the output of ogrinfo when reading <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&gt;ogrinfo -al &quot;MSSQL:server=mm00786\mm00786;database=Spatial;tables=dbo.test01;trusted_connection=yes&quot;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>INFO: Open of `MSSQL:server=mm00786\mm00786;database=Spatial;tables=dbo.test01;trusted_connection=yes'<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using driver `MSSQLSpatial' successful.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Layer name: test01<o:p></o:p></p><p class=MsoNormal>Geometry: Unknown (any)<o:p></o:p></p><p class=MsoNormal>Feature Count: 2<o:p></o:p></p><p class=MsoNormal>Extent: (-1363.889170, -150.114426) - (142.608640, 122.900947)<o:p></o:p></p><p class=MsoNormal>Layer SRS WKT:<o:p></o:p></p><p class=MsoNormal>(unknown)<o:p></o:p></p><p class=MsoNormal>FID Column = ogr_fid<o:p></o:p></p><p class=MsoNormal>Geometry Column = ogr_geometry<o:p></o:p></p><p class=MsoNormal>OGRFeature(test01):1<o:p></o:p></p><p class=MsoNormal>&nbsp; POINT (-1092.7172471465196 122.9009469897652 -150.11442565917974)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>OGRFeature(test01):2<o:p></o:p></p><p class=MsoNormal>&nbsp; LINESTRING <b>(-1363.889169860787 -5.255646621772087 -1109.9664261063763,142.60863989620026 -150.1144256591798 -17.396886979865542)</b><o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Coordinates of the lines are WRONG. Check above with the example given above. <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>However IF I specify a different geometry format other than native the X and Y coordinates are read properly but Z is omitted. See below ogrinfo ouput:<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&gt;ogrinfo -al &quot;MSSQL:server=mm00786\mm00786;database=Spatial;tables=dbo.test01;trusted_connection=yes;<b>GeometryFormat=wkt;&quot;</b><o:p></o:p></p><p class=MsoNormal>INFO: Open of `MSSQL:server=mm00786\mm00786;database=Spatial;tables=dbo.test01;trusted_connection=yes;GeometryFormat=wkt;'<o:p></o:p></p><p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using driver `MSSQLSpatial' successful.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Layer name: test01<o:p></o:p></p><p class=MsoNormal>Geometry: Unknown (any)<o:p></o:p></p><p class=MsoNormal>Feature Count: 2<o:p></o:p></p><p class=MsoNormal>Extent: (-1363.889170, -5.255647) - (-1092.717247, 142.608640)<o:p></o:p></p><p class=MsoNormal>Layer SRS WKT:<o:p></o:p></p><p class=MsoNormal>(unknown)<o:p></o:p></p><p class=MsoNormal>FID Column = ogr_fid<o:p></o:p></p><p class=MsoNormal>Geometry Column = ogr_geometry<o:p></o:p></p><p class=MsoNormal>OGRFeature(test01):1<o:p></o:p></p><p class=MsoNormal>&nbsp; POINT (-1092.7172471465196 122.9009469897652)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>OGRFeature(test01):2<o:p></o:p></p><p class=MsoNormal>&nbsp; LINESTRING <b>(-1363.889169860787 -5.255646621772087,-1109.9664261063763 142.60863989620026</b>)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Can you <b>please</b> tell me if the problem is from the writing or reading of GDAL or maybe I&#8217;m simply missing some information during writing or reading?!<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Please reply to me. <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><b><span lang=EN-GB style='font-size:10.0pt;color:#1F497D;mso-fareast-language:EN-AU'>Nicolas Garel </span></b><b><span lang=EN-GB style='font-size:10.0pt;color:#0070C0;mso-fareast-language:EN-AU'>|</span></b><span lang=EN-GB style='font-size:10.0pt;color:#1F497D;mso-fareast-language:EN-AU'> Junior Software Engineer<o:p></o:p></span></p><p class=MsoNormal><b><span lang=EN-GB style='font-size:10.0pt;color:#1F497D;mso-fareast-language:EN-AU'>M</span></b><span lang=EN-GB style='font-size:10.0pt;color:#1F497D;mso-fareast-language:EN-AU'>icromine Product<br><b>Email </b></span><b><span lang=EN-GB style='font-size:10.0pt;color:#0070C0;mso-fareast-language:EN-AU'>|</span></b><b><span lang=EN-GB style='font-size:10.0pt;color:#1F497D;mso-fareast-language:EN-AU'> </span></b><span lang=EN-GB style='font-size:10.0pt;color:#1F497D;mso-fareast-language:EN-AU'><a href="mailto:ngarel@micromine.com"><span style='color:blue'>ngarel@micromine.com</span></a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;color:#1F497D;mso-fareast-language:EN-AU'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;color:#1F497D;mso-fareast-language:EN-AU'><a href="http://www.micromine.com/"><span style='color:blue'>http://www.micromine.com</span></a><o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><br /><br />
<DIV align=left>
<P align=left><IMG style="MARGIN: 0px" border=0 alt="" 
src="cid:mm_corp_emailsig_perth.gif@5b728f68f250493398f956fb4b364ca1">&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P></DIV></body></html>