Bug report #7952

Merging of shapefiles looses attribute values when the size if different

Added by aperi2007 - over 6 years ago. Updated over 2 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/QGIS
Affected QGIS version:master Regression?:
Operating System: Easy fix?:
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16815

Description

I try to merge shapefiles in the new qgis-dev.

For the string attributes it creates the new shapefile is using the size of the first shapefile i see.
This is potentially wrong because if the other shapefiles has a size greater than the first the
merge operation leave it NULL.

An use case:
when producing the index-location using the gdaltindex utility.
It produces a single shapefile with the size needed for describe the paths.
If the user needs to merge all the index shapefile produced.
This operation this quite common in mapserver.

The operation fails in qgis because the string size of field location is never equal to the other index shapefiles.

I guess same thing can happen using the qgis-server.

The issue is in the merge operation that actually requires that all the shapefiles have the same size on same field.

Instead it should apply the greater size between the shapefiles merged.

Associated revisions

Revision 7d75fcc3
Added by Minoru Akagi over 6 years ago

fTools: fix MergeShapes and SpatialJoin
fix #7823
fix #7952
fix #8206

History

#1 Updated by Giovanni Manghi over 6 years ago

  • Category changed from C++ Plugins to 44

#2 Updated by Jürgen Fischer over 6 years ago

  • Subject changed from The merge shapefile lost attributes when the size if different to Merging of shapefiles looses attribute values when the size if different

#3 Updated by aperi2007 - over 6 years ago

I try to change the order of merging selecting the shapefile with greater size as first shapefile, but still the tool merge only one. :/
I don't know how really it work, but perhaps the issue is more complex rather than only a size question.

#4 Updated by Minoru Akagi over 6 years ago

  • Status changed from Open to Closed

#5 Updated by Giovanni Manghi over 2 years ago

The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

Also available in: Atom PDF