Bug report #801

Layer dissapears after change of legend color

Added by horst-duester - almost 17 years ago. Updated about 15 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Map Legend
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

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.

History

#1 Updated by horst-duester - almost 17 years ago

I find this behaviour only with PostGIS layer. GRASS and ESRI Shape Files don't dissapear.

#2 Updated by Jürgen Fischer almost 17 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?

#3 Updated by horst-duester - almost 17 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()
  1. keep the actial extent
    rect = canvas.extent()

    QgsMapLayerRegistry.instance().addMapLayer(vlayer)
    canvas.setExtent(rect)

... snip ...

Shows the mentioned behaviour.

#4 Updated by horst-duester - almost 17 years ago

Further information:

When I hit the classification button twice at the first time it works for me too.

#5 Updated by horst-duester - almost 17 years ago

  • Resolution set to wontfix
  • Status changed from Open to Closed

It's a strange behaviour. Today I can't reproduce it. I'll close this ticket until I find a reproducable test case.

#6 Updated by horst-duester - almost 17 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (wontfix)

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.

#7 Updated by Jürgen Fischer almost 17 years ago

  • Resolution set to fixed
  • Status changed from Feedback to Closed

fixed in 63e198c9 (SVN r7396)

#8 Updated by Anonymous about 15 years ago

Milestone Version 0.9.1 deleted

Also available in: Atom PDF