bstroebl / DigitizingTools

A QGIS plugin, that subsumes different tools useful during digitizing sessions
GNU General Public License v2.0
22 stars 9 forks source link

Merge selected Features does not work for features wich have a sequence default value #32

Closed andywicht closed 6 years ago

andywicht commented 6 years ago

Hi Bernhard,

it's a bit of a follow-up to the last issue (https://github.com/bstroebl/DigitizingTools/issues/31). When splitting off more than 1 area and then directly trying to merge the split off areas into a new feature the tool does not produce any output (without an error thrown). I guess it has to do with the fact that none of the parts has an ID yet (just the nextval() string). Workaround is saving the edits after splitting to force an actual ID in the column and then merging.

Is there a possibility to avoid this extra step?

merge_1

bstroebl commented 6 years ago

Hi Andy, DigitizingTools' Merge is only useful in cases where a Primary Key already exists. In the cas you describe you should use QGIS' standard merge tool (which deletes all features and inserts a new one). But DigitizingTools should issue a warning or similar that the tool is not applicable if all features are new.

andywicht commented 6 years ago

Hi Bernhard, agreed, at least a warning should be issued. Thank you!

bstroebl commented 6 years ago

Hi Andy, after some thinking I changed my mind and will try to merge nonetheless. Merging will result in a new feature being added in case all features to be merged are new.

andywicht commented 6 years ago

Hi Bernhard, nice to hear! Then you should also take into account that merging also does not work if you try to merge 2 new features (split off, without id yet) with 1 existing feature. It will only merge 1 new with the existing one and ignore the second new one. I guess that might have the same cause.