Bug report #801
Layer dissapears after change of legend color
|Affected QGIS version:||Regression?:||No|
|Operating System:||RedHat||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||10860|
I create a layer legend with individual colors for a classification. This works fine. When I change the color of the first legend row, the layer dissapears. This happens only with the 1. classification row. When I change the color of the 2. and later color it works fine.
#2 Updated by Jürgen Fischer almost 13 years ago
I can't reproduce that problem on Windows.
I tried to add a PostGIS polygon layer, assign the unique value renderer in it's properties, select a class field, hit classify and changed the first row.
Opening the layer's properties again and changing the fill color of the first class row also works fine for me.
Did you do something else?
#3 Updated by horst-duester - almost 13 years ago
Direct loading the layer via QGIS Postgis connection works for me too.
But all layer loaded via python plugin with:
... snip ...
uri = QgsDataSourceURI()
uri.setConnection("myHost", "5432", "myDB", "dbuser", "xxxx")
uri.setDataSource("shema", "table", "wkb_geometry", "archive=0")
vlayer = [[QgsVectorLayer]](uri.text(), "layerName", "postgres")
canvas = self.iface.getMapCanvas()
- keep the actial extent
rect = canvas.extent()
... snip ...
Shows the mentioned behaviour.
#6 Updated by horst-duester - almost 13 years ago
- Status changed from Closed to Feedback
- Resolution deleted (
Now I find a test case.
1. Load a postgis layer
2. chose layer properties
3. select the unique value legend and a classification field
4. close the layer properties with ok
5. reopen the layer properties dialog.
Take a look at the classification field. It changes to the next field of the list, but the classification valies persists when the geometry columns has a higher index as the classification field. After pressing OK of course the layer disappears.
The reason is the order of the geometry column with respect to the other columns of the DB table. All columns with higher order index than the geometry column shift by 1. Columns with lower order index than the geometry column are not influenced and the classifications field is correct.