Hi All,<div><br></div><div>I wrote a blog post a couple of days ago about opening MS SQL Spatial geometries and it worked fine then but the latest revision can&#39;t seem to display them.</div><div><br></div><div>It opens the table correctly, detects the geometry type right and I can even browse the table but no geometries are displayed.  </div>

<div><br></div><div>This is the code I use in the Python console to open the layer and then test to see if the geometry is there.</div><div><br></div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

&gt;&gt;&gt; uri = &quot;MSSQL:server=SD0302;database=Test;tables=DRAINAGE;trusted_connection=yes&quot;<br>&gt;&gt;&gt; uri<br>&#39;MSSQL:server=SD0302;database=Test;tables=DRAINAGE;trusted_connection=yes&#39;<br>&gt;&gt;&gt; qgis.utils.iface.addVectorLayer(uri,&#39;drains1&#39;,&#39;ogr&#39;)<br>

&lt;qgis.core.QgsVectorLayer object at 0x1EBD96A8&gt;<br>&gt;&gt;&gt; can = qgis.utils.iface.mapCanvas()<br>&gt;&gt;&gt; can<br>&lt;qgis.gui.QgsMapCanvas object at 0x0667F7C8&gt;<br>&gt;&gt;&gt; can.currentLayer()<br>&lt;qgis.core.QgsVectorLayer object at 0x1EBD9F18&gt;<br>

&gt;&gt;&gt; can.currentLayer().dataProvider()<br>&lt;qgis.core.QgsVectorDataProvider object at 0x1EBD9F60&gt;<br>&gt;&gt;&gt; can.currentLayer().select(1)<br>&gt;&gt;&gt;  can.currentLayer().select(1)<br>&gt;&gt;&gt; layer.selectedFeatures()<br>

[&lt;qgis.core.QgsFeature object at 0x1EBD9E88&gt;]<br>&gt;&gt;&gt; item = layer.selectedFeatures()[0]<br>&gt;&gt;&gt; item<br>&lt;qgis.core.QgsFeature object at 0x1EBD96A8&gt;<br>&gt;&gt;&gt; item.isValid()<br>True<br>&gt;&gt;&gt; item.geometry()<br>

&lt;qgis.core.QgsGeometry object at 0x1EBD9F60&gt;<br>&gt;&gt;&gt; item.geometry().length()<br>14.968913045995375<br>&gt;&gt;&gt; item.geometry().asWkb()<br>&#39;\x01\x02\x00\x00\x00\x02\x00\x00\x00\xf9 \xdb{\xd2\xb5\x18A\xc5\x19\x0f\x19\x04?ZA\xd4=W\xfb\x96\xb5\x18A\xff\xcf\xea\x83\x04?ZA&#39;<br>

&gt;&gt;&gt; item.geometry().exportToWkt()<br>PyQt4.QtCore.QString(u&#39;LINESTRING(404852.620953 6880272.391547, 404837.745450 6880274.061207)&#39;)<br>&gt;&gt;&gt; </blockquote><div> </div><div>When I run  can.currentLayer().select(1) QGIS says in the status bar that there is 1 feature selected and I can zoom to the correct spot on the map but nothing is displayed.</div>

<div><br></div><div>Would anyone have any idea what&#39;s going on here?</div><div><br></div><div>OS: Windows XP</div><div>QGIS Version r15530</div><div>GDAL/OGR 1.8</div><div><br></div><div>- Nathan</div>