[Qgis-developer] QGIS QgsGeometry.fromWkt not accepting polygons with Z values?

Alessandro Pasotti apasotti at gmail.com
Mon Jun 29 23:22:53 PDT 2015


2015-06-29 10:51 GMT+02:00 Casper Børgesen (CABO) <CABO at niras.dk>:

>  Hi!
>
>
>
> 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.
>
>
>
> I have tried the following in the Python console:
>
>
>
> > g = QgsGeometry.fromWkt('Polygon((0 0 0, 0 1 0, 1 1 0, 0 0 0))')
>
> > f = QgsFeature()
>
> > f.setGeometry(g)
>
> > iface.activeLayer().dataProvider().addFeatures([f])
>
>
>
> 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.
>
>
>
> Repeating the above using a Point WKT instead works fine with both 2D and
> 3D data.
>
>
>
> Is something broken in the WKT parser for polygons?
>
>
>
> 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?
>
>
>
>
>
> Regards, Casper
>
>
>
>

Hi,

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).


-- 
Alessandro Pasotti
w3:   www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150630/9bea882c/attachment.html>


More information about the Qgis-developer mailing list