Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#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


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 horst.duester, 15 years ago

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

comment:2 by jef, 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 horst.duester, 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 horst.duester, 15 years ago

Further information:

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

comment:5 by horst.duester, 15 years ago

Resolution: wontfix
Status: newclosed

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 horst.duester, 15 years ago

Component: SymbologyMap Legend
Resolution: wontfix
Status: closedreopened

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.

comment:7 by jef, 15 years ago

Resolution: fixed
Status: reopenedclosed

fixed in r7395

comment:8 by (none), 14 years ago

Milestone: Version 0.9.1

Milestone Version 0.9.1 deleted

Note: See TracTickets for help on using tickets.