qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.6k stars 3.01k forks source link

Categorize symbols uses wrong field after table join #21986

Closed qgib closed 5 years ago

qgib commented 8 years ago

Author Name: Spencer Gardner (@spencerrecneps) Original Redmine Issue: 13972 Affected QGIS version: 2.10.1 Redmine category:symbology


I have two layers: Layer A and Layer B. Layer A is a shapefile. Layer B is from an ESRI File Geodatabase. If I join Layer B to Layer A using a common field and then try to categorize their symbols based on the joined field, it uses the values from the first field in Layer B, rather than the field I have selected for categorization.

I am testing on 2.10.1, Windows 7 installed via OSGEO4W.

Steps to reproduce:

  1. Join Layer A to Layer B using a common field, keeping only the field to be categorized
  2. Open the styling in layer properties for Layer A
  3. Select categorized styling
  4. Select the column from the joined table
  5. Click the "Classify" button

What happens: The correct number of classes are created, but the value that is used comes from the first column of the joined table, rather than coming from the joined field selected for categorization. The value appears to correspond to the first found instance of each class in the joined field.

What should happen: The classes are populated according to the values in the joined field.

I know there have been issues with the FGDB driver in the past using the wrong field for a variety of operations. This may be related but I can't find the relevant bug report at the moment.


Related issue(s): #22120 (relates) Redmine related issue(s): 14118


qgib commented 8 years ago

Author Name: Sebastian Dietrich (Sebastian Dietrich)


Does this only occur when joining to an ESRI File Geodatabase?

There has been some work done in the joining code (see #22120) recently. Can you test using the nightly build?

Can you attach small sample files to reproduce the error?


qgib commented 8 years ago

Author Name: Spencer Gardner (@spencerrecneps)


I don't have a nightly build at the moment. Will test when I have some free time but it might be a few days.

qgib commented 8 years ago

Author Name: Sebastian Dietrich (Sebastian Dietrich)


If you attach some sample data to reproduce the issue others can test on current master. Then you probably save the hassle of installing a nightly :-)

qgib commented 8 years ago

Author Name: Giovanni Manghi (@gioman)


just tested on 2.14.3 and works as expected, please reopen if necessary.