Bug report #10401
Styling layer by category fails to draw if field is of type char(x)
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Symbology | ||
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 |
Description
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.
History
#1 Updated by Giovanni Manghi over 10 years ago
- OS version deleted (
7) - Operating System deleted (
Windows)
Confirmed down until 1.8 included.
#2 Updated by Giovanni Manghi over 7 years ago
- Easy fix? set to No
- Regression? set to No
#3 Updated by Giovanni Manghi over 5 years ago
- Resolution set to end of life
- Status changed from Open to Closed
End of life notice: QGIS 2.18 LTR
Source:
http://blog.qgis.org/2019/03/09/end-of-life-notice-qgis-2-18-ltr/