<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-06-29 10:51 GMT+02:00 Casper Børgesen (CABO) <span dir="ltr"><<a href="mailto:CABO@niras.dk" target="_blank">CABO@niras.dk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="DA">
<div>
<p class="MsoNormal"><span lang="EN-US">Hi!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I have previously been able to use the QGIS plugin QuickWKT to conveniently visualize geometries in QGIS. This has worked well using both 2D and 3D data where only the 2D part has been visualized. Recently I haven’t been
able to insert WKT polygons with Z-values.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I have tried the following in the Python console:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">> g = QgsGeometry.fromWkt('Polygon((0 0 0, 0 1 0, 1 1 0, 0 0 0))')<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">> f = QgsFeature()<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">> f.setGeometry(g)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">> iface.activeLayer().dataProvider().addFeatures([f])<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">My active layer is a scratch layer configured as Polygon. I get no exceptions and QGIS reports the layer containing 1 feature but nothing is shown. I have altered the above four python lines to only have the X and Y values
and this results in a visual result.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Repeating the above using a Point WKT instead works fine with both 2D and 3D data.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Is something broken in the WKT parser for polygons?
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I am using the weekly QGIS windows x64 release 61d81f0 and I wonder if this has something to do with the new geometry classes Marco wrote about on this list in late May 2015?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards, Casper<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
</div>
<br></blockquote><br><br></div><div class="gmail_quote">Hi,<br><br></div><div class="gmail_quote">I didn't have time to investigate this issue, but with the new geometry engine supporting Z/M geometries, I feel that WKT parser should support Z. I'd suggest you to file a ticket (if there is not already one).<br><br clear="all"></div><br>-- <br><div class="gmail_signature">Alessandro Pasotti<br>w3: <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div>
</div></div>