[Qgis-developer] crash when accessing geometry from Python console

Martin Dobias wonder.sk at gmail.com
Thu Jun 25 00:00:50 PDT 2015


Hi Bernhard

that's a long standing unresolved issue with python bindings:
http://hub.qgis.org/issues/777

Regards
Martin



On Thu, Jun 25, 2015 at 2:43 PM, Bernhard Ströbl
<bernhard.stroebl at jena.de> wrote:
> Hi everybody,
>
> I try to do the following from the Python console:
> g=iface.activeLayer().selectedFeatures()[0].geometry()
> returns a QgsGeometry objekt but as soon as I want to do anything with it
> QGIS crashes (layer is a memory line layer but a PostGIS linestring layer
> behaves the same). Any request like
> g.type()
> g.length()
> g.anything crashes QGIS
> g.asPolyline() crash if the line has three vertices, with only two vertices
> it returns an empty array.
>
> My goal is not the Python console but a plugin; the plugin crashes, too :-(
>
> tested with 2.8 on Win7 (64bit) and 2.8 & 2.9 on Ubuntu (64 bit) so it
> should not be connected to the geometry overhaul I reckon.
>
> any help appreciated
>
> Bernhard
>
>
>
> __________ Information from ESET Mail Security, version of virus signature
> database 11840 (20150625) __________
>
> The message was checked by ESET Mail Security.
> http://www.eset.com
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list