Feature request #2542

field calculator default behaviour

Added by Bernhard Ströbl almost 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Low
Assignee:Marco Hugentobler
Category:Vectors
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:12602

Description

Thank you for the field calculator it is a very welcome feature!
However its default behaviour (checkbox settings) is to update all records in the first existing field. This applies to QGIS 1.4.0-2.8 (OpenSuse).

To prevent users from corrupting their data I would expect it the other way round: update only selected records and ask for a new field.

Explanation

  • Most of the time I am using the field calculator, I want to update only selected records (graphical or logical selection). So I have to take extra care to check only update selected features. When I forget to do so, my data already being in the target field are gone. On the other hand if I want to update all records and the default would be only update selected features all I have to do is redoing the calculation after unchecking only update selected features.
  • The first existing field normally is an ID field. You do not want to update this field! But if you do not take extra care you do so. If update existing field would be unchecked the user has to do something in order to execute the calcualtion: either check update existing field and choose the field or enter a new field. Thus the risk of data corruption by accident is minimized.

I am totally aware that discarding the changes keeps the data as they are. But it is annoying to stop the edit mode, discard all(!) changes and redo all I did when I realize I made a mistake (if I realize!).

Proposal

  • If a selection exists on the table check only update selected features by default.
  • Uncheck update exisiting field by default.

History

#1 Updated by Jürgen Fischer almost 10 years ago

Replying to best:

I am totally aware that discarding the changes keeps the data as they are. But it is annoying to stop the edit mode, discard all(!) changes and redo all I did when I realize I made a mistake (if I realize!).

You can also undo (and redo) field calculator changes - without leaving editing mode.

#2 Updated by Bernhard Ströbl almost 10 years ago

Replying to [comment:1 jef]:

You can also undo (and redo) field calculator changes - without leaving editing mode.

Didn't know that, although I was looking for it (only in the table window, though :) I still think the current default settings are more error-prone than my proposal.

#3 Updated by Marco Hugentobler almost 10 years ago

The proposed changes sound good to me. I'm going to look at it.

#4 Updated by Marco Hugentobler almost 10 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Fixed in ccb101c1 (SVN r13047)

#5 Updated by Jürgen Fischer almost 10 years ago

Replying to [comment:2 best]:

Replying to [comment:1 jef]:

You can also undo (and redo) field calculator changes - without leaving editing mode.

Didn't know that, although I was looking for it (only in the table window, though :)
I still think the current default settings are more error-prone than my proposal.

Sure. I wasn't implying that your proposal was bad. I just thought you should know about another "very welcome feature". ;)

Also available in: Atom PDF