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

"Merge attribute of selected features" tools set ignored attributes to NULL #21292

Closed
qgib opened this issue Aug 18, 2015 · 9 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats)

Comments

@qgib
Copy link
Contributor

qgib commented Aug 18, 2015

Author Name: Mathieu Bossaert (Mathieu Bossaert)
Original Redmine Issue: 13231
Affected QGIS version: 2.8.2
Redmine category:vectors
Assignee: Nyall Dawson


I don't know if its a bug or a feature request because I did not use that tool before (but I try it on both 2.8 and 2.10 versions for Win 7).
Anyway when I choose an attribute to be ignored during the merge operation (for example the id), it is set to NULL.

@qgib
Copy link
Contributor Author

qgib commented Aug 18, 2015

Author Name: Jürgen Fischer (@jef-n)


  • subject was changed from "Merge attribute of selected features" tools set ingored attributes to NULL to "Merge attribute of selected features" tools set ignored attributes to NULL

@qgib
Copy link
Contributor Author

qgib commented Aug 19, 2015

Author Name: Jukka Rahkonen (Jukka Rahkonen)


What do you suggest? If you merge features A and B which have an attribute X with values
a) for A: X=1, for B: X=1
b) for A: X=1, for B: X=2

In case a) it feels natural to set X=1 also for the new merged feature. How about case b), would you like to get concatenated string X=1,2? What if the datatype of the column is numeric, would it be 1+2 then, and how should we deal with Boolean values?

@qgib
Copy link
Contributor Author

qgib commented Aug 19, 2015

Author Name: Mathieu Bossaert (Mathieu Bossaert)


Maybe with do not talk about the same tool... It is not a feature aggregation, features are not merged :

http://docs.qgis.org/2.8/en/docs/user_manual/working_with_vector/editing_geometry_attributes.html#merge-attributes-of-selected-features

So if all selected features are conserved with this tool, I think it could be logical and usefull to be able to conserve the initial value of that attribute.

@qgib
Copy link
Contributor Author

qgib commented Aug 23, 2015

Author Name: Jukka Rahkonen (Jukka Rahkonen)


Right, we did not talk about the same tool.

I agree that there should be an option to leave the ignored attributes to their native value instead of setting them to NULL. It seems that the UI of this tool is a copy of the Merge features tool which lets user to select which value to give for the merged feature, including concatenate for strings and min/max/median/sum/mean for numbers.

If features are physically merged with the "Merge selected features" tool it is impossible to preserve the native attributes but there should be one more option for the "Merge attribute of selected features" tool: Keep native.

@qgib
Copy link
Contributor Author

qgib commented Oct 18, 2015

Author Name: Nyall Dawson (@nyalldawson)


Fixed in changeset "0bda18b6e04105d52cfe6f54792de2f2e2b4a925".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Oct 20, 2015

Author Name: Harrissou Santanna (@DelazJ)


I suspect it's introduced by this commit but I may be wrong. sorry then :(
Now, when you "merge attributes of selected features", the dialog opens with all the merge attributes set to "skipped" by default. Would be better to keep some pre-filled fields as it was in previous releases and as it is when using "merge selected features" tool.
Most of the times, you (I) just need to change few fields. We should not oblige the user to manually enter new value for all fields. If an user wants to change/skip all the fields or most of them, then he'll use the "Skip all fields" tool.
master 4cdf05f


  • status_id was changed from Closed to Reopened
  • assigned_to_id was configured as Nyall Dawson

@qgib
Copy link
Contributor Author

qgib commented Oct 20, 2015

Author Name: Nyall Dawson (@nyalldawson)


Now, when you "merge attributes of selected features", the dialog opens with all the merge attributes set to "skipped" by default.

This was an intentional change. I think for something like this which has the potential to lead to overwriting data that users should have to intentionally select the fields they want to replace rather than defaulting to replacing everything. It's also a better workflow for tables with many columns - it's not often you'd want to replace EVERYTHING in the features, so starting with all skipped and leaving it to the user to manually select the columns to merge is a better approach.


  • status_id was changed from Reopened to Closed

@qgib
Copy link
Contributor Author

qgib commented Oct 20, 2015

Author Name: Harrissou Santanna (@DelazJ)


Sorry, you're right. I mixed up "Skip" and "NULL" values.
It's indeed the best approach.

@qgib
Copy link
Contributor Author

qgib commented Oct 21, 2015

Author Name: Mathieu Bossaert (Mathieu Bossaert)


Thanks a lot for that work !

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats) labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
troopa81 pushed a commit to troopa81/QGIS that referenced this issue Jun 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! Vectors Related to general vector layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant