Bug report #6063
ftools "Convex hull(s)": wrong attributes in output
|Affected QGIS version:||master||Regression?:|
|Operating System:||Easy fix?:|
|Pull Request or Patch supplied:||Yes||Resolution:||fixed|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||15424|
When creating convex hulls from a point layer (.shp) based on a common attribute ("create convex hulls based on input field"), one would expect that the resulting polygon layer would at least contain this attribute in the table.
But in opposite to this, the resulting table structure is just a complete copy of the points attributes table and most of its fields are empty (of course, cause most point values differ).
Two fields get populated though, but only with strange numbers which i can't identify.
This behaviour reduces the usability of convex hull enormously, cause i planned to use them as a coverage layer for Atlas and fill the map title with the attribute from the convex hull layer without extra steps ... would all be a real time saver for 300 + x overview maps!
p.s. The closed bug #2529 is similar, but explicitly refers to postgis
pps.: just managed to retrieve my attribute in the table by deleting the first column in my point shape: Now the first column in the polygon layer represents the chosen attribute (3rd column in point layer), field name is of course still wrong.
#3 Updated by Fabian Stenzel over 8 years ago
Still using Version 1.8 of QGIS (standard packages for ubuntu), I can't say if this issue is fixed by now, but I had the same problem, missing/losing the attribute I based my convex hull on.
As Salvatore mentioned, it seems that the newly created convex_hull_shape copies all fields of the old table, but overwrites the first three columns in the creation process with: convexHull_based_field(TYPE),Area(FLOAT),Perimeter(FLOAT) regardless of the types the actual first three fields have. Converting from Float to Integer or String seems to work fine, but if the first field is an Integer (what the ID field usually is) and the convex_hull was based on a String-field the content the convex-hull was based on gets lost.
Work around: use table-manager, create 3 new fields before all the others with the Types: convex_hull_based_field_type,Float,Float.
#7 Updated by Giovanni Manghi about 8 years ago
- Resolution set to fixed
- Status changed from Open to Closed
Daniel Vaz wrote:
What is the supposed behavior of convex hull when create convex hulls based on input field?
Please, give some dataset and correct supposed behavior.
and again... today it seems to work ok... sorry (again) for the noise.
#10 Updated by Giovanni Manghi about 8 years ago
- Status changed from Reopened to In Progress
- Resolution deleted (
- Pull Request or Patch supplied changed from No to Yes
Daniel Vaz wrote:
Please Giovanni and Bernd Vogelgesang, can you try https://github.com/qgis/Quantum-GIS/pull/731 ?
I will ASAP. What exactly does fix your patch? Today it seemed to work ok.
#14 Updated by Daniel Vaz about 8 years ago
- File polygons.zip added
Choose Vector -> Geoprocessing -> Convex Hull -> Create a convex hull based on input field -> Choose any field -> Click Ok
The generated convex hull polygons don't preserve the parent(s) field(s) polygon(s).
The patch fix it.
Thanks in advance