Bug report #8219
fTools "Convex hull(s)" does not work if a input field is specified
Status: | Closed | ||
---|---|---|---|
Priority: | Severe/Regression | ||
Assignee: | - | ||
Category: | Processing/QGIS | ||
Affected QGIS version: | master | Regression?: | |
Operating System: | Easy fix?: | ||
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 17033 |
Description
When I used "Convex hull(s)" tool with "Create convex hulls based on input field" option selected, the following error message was logged.
An error has occured while executing Python code: Traceback (most recent call last): File "C:\\OSGeo4W\\apps\\qgis-dev\\python\\plugins\\fTools\\tools\\doGeoprocessing.py", line 300, in run geos, feature, match, error = self.convex_hull( useField ) File "C:\\OSGeo4W\\apps\\qgis-dev\\python\\plugins\\fTools\\tools\\doGeoprocessing.py", line 490, in convex_hull vproviderA.rewind() AttributeError: 'QgsVectorDataProvider' object has no attribute 'rewind' Python version: 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] QGIS version: 1.9.0-Master Master, 630427f
Associated revisions
History
#1
Updated by Minoru Akagi about 11 years ago
In addition, it is necessary to check "Use only selected features" to replicate this error.
#2
Updated by Minoru Akagi about 11 years ago
Without feature selection, the following error was logged.
Traceback (most recent call last): File "C:\\OSGeo4W\\apps\\qgis-dev\\python\\plugins\\fTools\\tools\\doGeoprocessing.py", line 300, in run geos, feature, match, error = self.convex_hull( useField ) File "C:\\OSGeo4W\\apps\\qgis-dev\\python\\plugins\\fTools\\tools\\doGeoprocessing.py", line 550, in convex_hull if idVar.strip() == i.strip(): AttributeError: 'QPyNullVariant' object has no attribute 'strip'
#3
Updated by Minoru Akagi about 11 years ago
The reason of the error "'QPyNullVariant' object has no attribute 'strip'" is that there are NULL values in the field of my data.
#4
Updated by Daniel Vaz about 11 years ago
Please, attach the dataset you are using.
#5
Updated by Minoru Akagi about 11 years ago
- File polygons.zip added
The attribute table of the attached dataset has three fields. "id" and "name" are string type fields. "nvertex" is integer type field. The "name" field includes NULL values.
#6
Updated by Daniel Vaz about 11 years ago
I commented the line
vproviderA.rewind()so the program pass but I got a crash.
Fatal: QGIS died on signal 11 Stacktrace (piped through c++filt): qgis(myMessageOutput(QtMsgType, char const*)+0x24f)[0x55145c] /usr/lib/x86_64-linux-gnu/libQtCore.so.4(qt_message_output(QtMsgType, char const*)+0x30)[0x7f204193e4d0] /usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x71938)[0x7f204193e938] /usr/lib/x86_64-linux-gnu/libQtCore.so.4(qFatal(char const*, ...)+0x94)[0x7f204193eac4] qgis(qgisCrash(int)+0x1f)[0x55120b] /lib/x86_64-linux-gnu/libc.so.6(+0x370b0)[0x7f203ee460b0] /usr/lib/libgdal.so.1(swq_select_summarize(swq_select*, int, char const*)+0x93)[0x7f2043945ba3] /usr/lib/libgdal.so.1(OGRGenSQLResultsLayer::PrepareSummary()+0x162)[0x7f20437dcb22] /usr/lib/libgdal.so.1(OGRGenSQLResultsLayer::GetFeature(long)+0xbd)[0x7f20437de81d] /usr/local/lib/qgis/plugins/libogrprovider.so(QgsOgrProvider::uniqueValues(int, QList<QVariant>&, int)+0x553)[0x7f2020412ba9] /usr/lib/python2.7/dist-packages/qgis/core.so(+0x4e54cc)[0x7f2017c724cc] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5e75)[0x7f201945b8d5] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5c03)[0x7f201945b663] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5c03)[0x7f201945b663] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81a)[0x7f20194ef2fa] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0xff4a6)[0x7f20194ef4a6] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x4e)[0x7f2019521d8e] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(+0xa106d)[0x7f201949106d] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyObject_Call+0x4e)[0x7f2019521d8e] /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x47)[0x7f2019522b37] /usr/lib/python2.7/dist-packages/sip.so(+0x98e2)[0x7f2018fd88e2] /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so(+0x8c885)[0x7f2018be4885] /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so(+0xd79de)[0x7f2018c2f9de] /usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x7bbec)[0x7f2041948bec] /lib/x86_64-linux-gnu/libpthread.so.0(+0x7f8e)[0x7f203ebf9f8e] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f203ef08e1d] Aborted (core dumped)
The function
ftools_utils.getUniqueValues()is the crash point.
#7
Updated by Daniel Vaz about 11 years ago
Fixed in https://github.com/ddanielvaz/Quantum-GIS/commit/a7c8b9423880e79f89466dc299a70f28b8cbc233
Please see pull request: https://github.com/qgis/Quantum-GIS/pull/709
#8
Updated by Nathan Woodrow about 11 years ago
- Status changed from Open to Closed
Fixed in changeset b45b7d6f88d9165cce43a1f6a7573a56bd1d8a0e.
#9
Updated by Giovanni Manghi over 7 years ago
The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.