Feature request #3010
ftools (merge shapefiles tool): patch to add option to select attribute table structure
|Pull Request or Patch supplied:||Resolution:||fixed|
|Easy fix?:||Copied to github as #:||13070|
The attached patch allows the user to choose one of the input payers as the source for the new attribute table.
Also, sets the attributes of the new layer based on the field name rather then the order in which it appears. When the field is not found in the current layer, it tries to set the value "-9999".
#2 Updated by cfarmer - about 10 years ago
- Status changed from Open to In Progress
Please attach the .ui file with the above changes rather than the generated ui_.py file.
Also, am unsure whether using a default of -9999 is a good idea, given that some users might be using this value for some other purpose. May be better to leave fields blank?
#5 Updated by Alexander Bruy almost 10 years ago
Replying to [comment:5 lutra]:
I'm not the author of the patch, so maybe is better to wait for his feedback. In any case your suggestion makes sense.
I see :-). So I'll start to modify Merge tool to gather all fields from input files.
By the way... any feedback by the author of mmqgis? is he going to contribute his tools in the qgis repos?
Unfortunatelly I have no info about this. I think we should ask Carson
#6 Updated by Rui Pedro Henriques almost 10 years ago
Replying to [comment:4 alexbruy]:
May be it is better to gather all attributes from input shapes into output shape, as in MMQGIS?
Hi! I don't know how MMQGIS works, but what would be the behaviour exactly? If there is field X in shapefile A and field X in shapefile B, what would be the output? All values go to the new field X in output file or will there be two fields: A_X and B_X? I've seen both behaviours before and although the first one might work, the second one tends to be bad and to fail in large groups of layers with the same field names.
The option to choose the shapefile that will be the model for the new attribute table had a "trick" behind it: if I wanted to add or remove fields it's easy to create a new empty shapefile with the desired fields and, therefore, choosing it will cause unwanted fields to be dropped and wanted fields to be created, eliminating the need to further edition on the output shapefile.
As I see it, the best option - maybe not for now - would be to show the user a list of all the fields and to let the user choose which ones should appear in the output.
I'm still struggling with QT and python trying to create the *.ui file that Carson asked for...