You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting a hard crash when I call setGeometry from the processing framework. I can't figure out why my code is failing but in any case QGIS shouldn't be crashing like this. Looks to be a segfault based on the log.
segfault at 0 ip 00007fc63a2a846a sp 00007fff34f66f00 error 6 in libqgis_core.so.2.10.1[7fc63a14d000+7ce000]
A few odd things:
It doesn't crash all the time. The sample code below seems to crash about 80% of the time. But every once in a while it works without an issue. And when it works, I can run it again during the same session without problems. But if I restart QGIS it crashes again.
I also tried using the WKT of the geometry in the sample below. If I construct the geom from the WKT there is no crash. For reference, the WKT of the sample feature is "LINESTRING(11897018 7014346,11897266 7014236)" - the SRID is 2283.
Sample code (from the Python console)
#- note that roadsLayer is a PostGIS layer of type LINESTRING and primary key of "road_id")
#- and the code grabs a geom from one of the road features by looking up the geom
#- in a dictionary with keys of road_ids and values of geoms.
#- I've chosen an arbitrary road_id to illustrate.
#- imports
from qgis.core import *
from PyQt4.QtCore import QSettings, QVariant
from processing.tools import vector
#- fields
fields = QgsFields()
fields.append(QgsField('field1', QVariant.Int))
#- dict of road IDs and geoms (for convenience)
roads = dict()
for feat in vector.features(roadsLayer):
roads[feat['road_id']] = feat.geometry()
#- create the new feature
f = QgsFeature(fields)
f.setAttribute(0,0)
roadId = 6985
f.setGeometry(roads.get(roadId))
The text was updated successfully, but these errors were encountered:
Author Name: Spencer Gardner (@spencerrecneps)
Original Redmine Issue: 13616
Affected QGIS version: 2.10.1
Redmine category:python_plugins
I'm getting a hard crash when I call setGeometry from the processing framework. I can't figure out why my code is failing but in any case QGIS shouldn't be crashing like this. Looks to be a segfault based on the log.
segfault at 0 ip 00007fc63a2a846a sp 00007fff34f66f00 error 6 in libqgis_core.so.2.10.1[7fc63a14d000+7ce000]
A few odd things:
Sample code (from the Python console)
The text was updated successfully, but these errors were encountered: