Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

singlepart to multipart broken in QGIS 2.0/master #17359

Closed
qgib opened this issue Sep 17, 2013 · 8 comments
Closed

singlepart to multipart broken in QGIS 2.0/master #17359

qgib opened this issue Sep 17, 2013 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@qgib
Copy link
Contributor

qgib commented Sep 17, 2013

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 8625
Affected QGIS version: master
Redmine category:processing/qgis


tested on both Linux and Windows

An error has occured while executing Python code:

Traceback (most recent call last):
  File "C:\\OSGeo4W\\apps\\qgis-dev\\python\\plugins\\fTools\\tools\\doGeometry.py", line 324, in run
    success = self.single_to_multi()
  File "C:\\OSGeo4W\\apps\\qgis-dev\\python\\plugins\\fTools\\tools\\doGeometry.py", line 384, in single_to_multi
    if idVar.strip() == i.strip() or merge_all:
AttributeError: 'QPyNullVariant' object has no attribute 'strip'

Python version:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]


QGIS version:
2.1.0-Master Master, 773e0d4

Python path: ['C:/OSGeo4W/apps/qgis-dev/./python/plugins\\\\sextante', 'C:/OSGeo4W/apps/qgis-dev/./python/plugins\\\\processing', 'C:/OSGeo4W/apps/qgis-dev/./python', u'C:\\\\Users\\\\giovanni/.qgis2/python', u'C:\\\\Users\\\\giovanni/.qgis2/python/plugins', 'C:/OSGeo4W/apps/qgis-dev/./python/plugins', 'C:\\\\Python27', 'C:\\\\mapnik-v2.2.0\\\\python\\\\2.7\\\\site-packages', 'C:\\\\OSGeo4W\\\\bin', 'C:\\\\OSGeo4W\\\\bin\\\\python27.zip', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\DLLs', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\plat-win', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\lib-tk', 'C:\\\\OSGeo4W\\\\apps\\\\Python27', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\PIL', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\win32', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\win32\\\\lib', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\Pythonwin', 'C:\\\\OSGeo4W\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\wx-2.8-msw-unicode', 'C:\\\\OSGeo4W\\\\apps\\\\qgis-dev\\\\python\\\\plugins\\\\fTools\\\\tools']


@qgib
Copy link
Contributor Author

qgib commented Dec 7, 2013

Author Name: Andrey Isakov (@Andrey-VI)


QGIS 2.0.1
Same error.
Vector -> Geometry Tools -> Singleparts to multipart

An error has occured while executing Python code:

Traceback (most recent call last):
  File "/usr/share/qgis/python/plugins/fTools/tools/doGeometry.py", line 325, in run
    success = self.single_to_multi()
  File "/usr/share/qgis/python/plugins/fTools/tools/doGeometry.py", line 385, in single_to_multi
    if idVar.strip() == i.strip() or merge_all:
AttributeError: 'float' object has no attribute 'strip'

Python version:
2.7.5+ (default, Sep 17 2013, 15:33:59) 
[GCC 4.8.1]


QGIS version:
2.0.1-Dufour Dufour, exported

Python path: ['/usr/share/qgis/python/plugins/processing', '/usr/share/qgis/python', '/home/andrey/.qgis2/python', '/home/andrey/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/home/andrey/.qgis2/python/plugins/mmqgis/forms', '/usr/share/qgis/python/plugins/fTools/tools'] 

@qgib
Copy link
Contributor Author

qgib commented Jan 7, 2014

Author Name: Salvatore Larosa (@slarosa)


This seems to happen when the layer has @null@ attribute values, I had proposed a "patch":#783 (comment) which
has not been applied because this commit cba57fa by Matthias solved the issue with @null@ values reported in the same PR, but I am still getting a QPyNullVariant error here.

Can anyone test the tool with the attached sample data?


  • 6625 was configured as sample_data_ftools.zip
  • tag was configured as easy

@qgib
Copy link
Contributor Author

qgib commented Jan 7, 2014

Author Name: Giovanni Manghi (@gioman)


Salvatore Larosa wrote:

but I am still getting a QPyNullVariant error here.

confirmed

An error has occured while executing Python code:

Traceback (most recent call last):
  File "/usr/share/qgis/python/plugins/fTools/tools/doGeometry.py", line 326, in run
    success = self.single_to_multi()
  File "/usr/share/qgis/python/plugins/fTools/tools/doGeometry.py", line 386, in single_to_multi
    if idVar.strip() == i.strip() or merge_all:
AttributeError: 'QPyNullVariant' object has no attribute 'strip'

@qgib
Copy link
Contributor Author

qgib commented Jan 7, 2014

Author Name: Matthias Kuhn (@m-kuhn)


Can confirm.

Some comments:

  • Just to be sure: What is the result expected to be? Should NULL values be grouped? From a database perspective it seems like "yes, but it is an edge-case":http://en.wikipedia.org/wiki/Null_%28SQL%29#When_two_nulls_are_equal:_grouping.2C_sorting.2C_and_some_set_operations
  • What about the option of removing the .strip() altogether? From a database perspective this would not be used (" a " is distinct from "a") but I can perfectly see that it may help new users to cover their data inconsistencies. What about making it an option, checked by default?
  • Your patch will lead to conflicts, when the user actually has the string u"NULL" as a value in his attributes. For my part, I'd like to get away from this substitute strings as good as possible.

@qgib
Copy link
Contributor Author

qgib commented Jan 9, 2014

Author Name: Giovanni Manghi (@gioman)


from a user point of view I would say "yes", group them. But if it is hard then a warning message (and ask to fill properly the null records) would be enough.

@qgib
Copy link
Contributor Author

qgib commented Jan 10, 2014

Author Name: Andrey Isakov (@Andrey-VI)


Matthias Kuhn wrote:

In some cases YES, in other — NO. So, I think we need an additional check-box for NULL values.

@qgib
Copy link
Contributor Author

qgib commented Jan 30, 2014

Author Name: Matthias Kuhn (@m-kuhn)


Fixed in changeset "e4f410b589c43ce346930fd2523b815741c6257a".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 24, 2019
@qgib qgib added this to the Future Release - High Priority milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant