#801 closed bug (fixed)
Layer dissapears after change of legend color
Reported by: | horst.duester | Owned by: | nobody |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | |
Component: | Map Legend | Version: | Trunk |
Keywords: | Cc: | ||
Must Fix for Release: | Yes | Platform: | RedHat |
Platform Version: | Awaiting user input: | no |
Description
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.
Change History (8)
comment:1 by , 15 years ago
comment:2 by , 15 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.
Works fine.
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?
comment:3 by , 15 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()
QgsMapLayerRegistry.instance().addMapLayer(vlayer) canvas.setExtent(rect)
... snip ...
Shows the mentioned behaviour.
comment:4 by , 15 years ago
Further information:
When I hit the classification button twice at the first time it works for me too.
comment:5 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
It's a strange behaviour. Today I can't reproduce it. I'll close this ticket until I find a reproducable test case.
comment:6 by , 15 years ago
Component: | Symbology → Map Legend |
---|---|
Resolution: | wontfix |
Status: | closed → reopened |
Now I find a test case.
- Load a postgis layer
- chose layer properties
- select the unique value legend and a classification field
- close the layer properties with ok
- 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.
I find this behaviour only with PostGIS layer. GRASS and ESRI Shape Files don't dissapear.