Bug report #10401
Styling layer by category fails to draw if field is of type char(x)
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||end of life|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||18817|
My PostGIS polygon layer has a field, "prob", with values H, M and L. If I select a categorized style using the "prob" field I get the expected three values plus an extra empty one. However, the layer is drawn using the style of the extra category - in the screenshot the pink lines and not the solid blues as expected.
To fix it I had to change the "prob" field type from char(x) to varchar(x). The probability field was a char field 50 characters wide, i.e 'H and then 49 spaces'. I reloaded the data into PostGIS with the field as varchar(x) and now it works as expected (although I still get the extra empty category added and I can delete it). Storing the data in Postgresql as varchar is preferable as it uses less space.
The rules based renderer worked if I had a rule like: "prob" LIKE 'H%' or TRIM but that doesn't fix the categorised style issue.
#3 Updated by Giovanni Manghi over 2 years ago
- Resolution set to end of life
- Status changed from Open to Closed
End of life notice: QGIS 2.18 LTR