Bug report #16755

Virtual fields are stored as datatype integer

Added by Andre Joost almost 7 years ago. Updated almost 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Virtual Fields
Affected QGIS version:2.18.9 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:24654

Description

Steps to reproduce:

  1. Create a new project with a new point layer, leaving the id field only.
  2. Create virtual fields of type real, name lon and lat, with content $x and $y
  3. Add some arbitrary points, save and leave edit mode
  4. Check the attribute table: fiels look as expected
  5. Save As to a new shapefile, and add it too the canvas
  6. Check the attribute table: lon and lat fields are truncated to integer
  7. Check the properties: lon and lat fields are of type qlonglong (opposed to step 2)

Saving and reopening the project does not change anything, nor saving to CSV.

The MMQGIS plugin exports the attribute table correctly to CSV.

History

#1 Updated by Matthias Kuhn almost 7 years ago

Couldn't reproduce this with current master, saving to shapefiles.

Can you append a demo shapefile and project?

#2 Updated by Giovanni Manghi almost 7 years ago

  • Status changed from Open to Feedback

#3 Updated by Andre Joost almost 7 years ago

Seems to be fixed in version 2.18.10.

Please close as I don't have the privileges to do so.

#4 Updated by Giovanni Manghi almost 7 years ago

  • Resolution set to fixed/implemented
  • Status changed from Feedback to Closed

Also available in: Atom PDF