On 20 October 2017 at 18:30, Luigi Pirelli wrote:
> probably the problem is the facto that you use:
> https://qgis.org/api/2.18/classQgsFeature.html#ab0a934a1b173ce5ad8d13363c20ef3c8
> without cloning geometry... and then you remove the layer => the
> geometry pointer is no more
thanks for this solution.
My script now looks like this and works :-)
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.PyQt.QtWidgets import *
import processing
layer=None
for lyr in QgsMapLayerRegistry.instance().mapLayers().values():
if lyr.name() ==
probably the problem is the facto that you use:
https://qgis.org/api/2.18/classQgsFeature.html#ab0a934a1b173ce5ad8d13363c20ef3c8
without cloning geometry... and then you remove the layer => the
geometry pointer is no more valid.
try to do
geom = QgsGeometry( feature.geometry() )
or better
geom =
Hi,
I am trying to make a report by using a script.
The script looks as follows:
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.PyQt.QtWidgets import *
import processing
# selectiepolygoon layer contains one multipolygone
layer=None
for lyr in