Bug report #12894

Processing: memory layers saved using QGIS tools have all attributes converted to string

Added by Nicolas Rochard over 9 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/QGIS
Affected QGIS version:2.8.2 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:20984

Description

When using processing plugin (up to date) on PostGIS layer.
When I use an algorithm and generate a memory layer for result : every attribute become string type

before_dissolve.png (211 KB) Nicolas Rochard, 2015-06-08 02:06 AM

dissolve.png (114 KB) Nicolas Rochard, 2015-06-08 02:06 AM

after_dissolve.png (169 KB) Nicolas Rochard, 2015-06-08 02:06 AM

save_selection_as.png (113 KB) Nicolas Rochard, 2015-06-08 02:06 AM

after_save_selected.png (172 KB) Nicolas Rochard, 2015-06-08 02:06 AM

polygon_centroid.png (123 KB) Nicolas Rochard, 2015-06-08 02:06 AM

after_polygon_centroid.png (178 KB) Nicolas Rochard, 2015-06-08 02:06 AM

Associated revisions

Revision 38a247f2
Added by Victor Olaya over 9 years ago

[processing] fixed attribute types in memory layers
fixes #12894

History

#1 Updated by Giovanni Manghi over 9 years ago

  • Category set to 94
  • Status changed from Open to Feedback

please specify the tool that caused the issue.

#2 Updated by Giovanni Manghi over 9 years ago

  • Category changed from 94 to Processing/Core

#3 Updated by Nicolas Rochard over 9 years ago

All in Processing
See screenshots tested with dissolve, polygon centroid and save selected feature as script.

Giovanni Manghi wrote:

please specify the tool that caused the issue.

#4 Updated by Giovanni Manghi over 9 years ago

  • Subject changed from Memory layer corrupt type field to Processing: memory layers saved using QGIS tools have all attributes converted to string
  • Assignee set to Victor Olaya
  • Status changed from Feedback to Open
  • Category changed from Processing/Core to Processing/QGIS

#5 Updated by Paolo Cavallini over 9 years ago

Maybe this is related? Applying the Processing buffer on a memory layer returns an error:

2015-06-08T08:25:25    2    Uncaught error while executing algorithm
            Traceback (most recent call last):
                          File "/home/paolo/python/plugins/processing/core/GeoAlgorithm.py", line 225, in execute
                             self.processAlgorithm(progress)
                          File "/home/paolo/python/plugins/processing/algs/qgis/FixedDistanceBuffer.py", line 72, in processAlgorithm
                              dissolve, segments)
                          File "/home/paolo/plugins/processing/algs/qgis/Buffer.py", line 45, in buffering
                              total = 100.0 / float(len(features))
                          ZeroDivisionError: float division by zero

#6 Updated by Victor Olaya over 9 years ago

  • Status changed from Open to Closed

#7 Updated by Victor Olaya over 9 years ago

Paolo's error is casused by trying to running the buffer with an empty layer. I will fix that separately, to handle that case more gracefully instead of breaking and showing an error trace

#8 Updated by Nicolas Rochard over 9 years ago

Thanks for your work, I will test it in my master version asap.

Victor Olaya wrote:

Fixed in changeset 38a247f26cc4e0d23ae01cc48b2590a41968ad5a.

Also available in: Atom PDF