Bug report #12171

Processing Refactor fields: can't change an "int" field to "double" with 0 precision

Added by Filipe Dias about 9 years ago. Updated almost 5 years ago.

Category:Data Provider/OGR
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:20363


Steps to reproduce:

- Run Refactor fields using the attached shapefile

- Go to field "Nt", change its type to "double" and set Precision to 0

- The new field still has "Nt" as "int". If the Precision is changed to 1 or more, it works.

sample.zip (1.89 KB) Filipe Dias, 2015-02-10 01:49 AM


#1 Updated by Arnaud Morvan about 9 years ago

FieldsMapper use standard processing function "output.getVectorWriter" to create output storage, and give it selected type and precision.
With type double and precision 0, I confirm that resulting field is displayed as integer in fields tab of layer properties dialog.

#2 Updated by Victor Olaya over 8 years ago

  • Status changed from Open to Feedback

IS this a Processing issue or a QGIS one? Processing just passes the precision value to the QgsField object, and it seems that QGIs is not handling it as it should

#3 Updated by Giovanni Manghi about 8 years ago

  • Status changed from Feedback to Open

Still true on master, please change the category if it is a QGIS issue rather than a Processing one.

#4 Updated by Alexander Bruy about 8 years ago

  • Assignee deleted (Victor Olaya)
  • Category changed from Processing/QGIS to Data Provider/OGR

This is not a Processing bug and even not QGIS one. Seems GDAL does not allow to create float fields with zero precision

#5 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#6 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Open to Closed
  • Resolution set to end of life

Also available in: Atom PDF