Bug report #12282

unable to gather unique values or to classify (graduated/categorized) values when using a numeric column in a esri file geodatabase

Added by Arnout verhoeve almost 10 years ago. Updated about 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/OGR
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:up/downstream
Crashes QGIS or corrupts data:No Copied to github as #:20464

Description

Wanneer ik bij een kaartlaag de unieke waarden wil oproepen bij de STYLE laageigenschappen (bv voor de opmaak van een legende via het classificeren op basis van categorieën of gradaties uit een attributenveld), lukt dit wel bij een shapefile, maar niet wanneer een kopie van dezelfde laag in een file gdb wordt ingeladen.
Hetzelfde probleem bij het gebruik van de expressiebuilder om features te selecteren, werkt het oproepen van unieke waarden uit een veld wel bij een shapefile, maar niet bij een file geodatabank (fgdb versie 10).

In bijlage heb ik een kaartlaag toegevoegd als shapefile en als filegeodatabank zodat jullie zelf het probleem kunnen nagaan.

shp.zip - shapefile zip (363 KB) Arnout verhoeve, 2015-02-27 01:45 AM

fgdb.zip - file geodatabank zip (644 KB) Arnout verhoeve, 2015-02-27 01:45 AM

fgdb.png (45.9 KB) Richard Duivenvoorde, 2015-02-27 02:18 AM

shapefile.png (58.7 KB) Richard Duivenvoorde, 2015-02-27 02:18 AM

History

#1 Updated by Richard Duivenvoorde almost 10 years ago

Translating to english:

Using 'unique value classification' all is fine when working with shapefile.

But when using a fgdb, the dialog seems not to create the right classification borders.

Attached are a test shp and fgdb (running windows 2.6.1).

Also attached example dialogs

#2 Updated by Giovanni Manghi almost 10 years ago

  • Affected QGIS version changed from 2.6.1 to 2.8.1
  • Category changed from Expressions to Symbology
  • Status changed from Open to Feedback
  • Assignee deleted (Richard Duivenvoorde)

confirmed here also on 2.8.1. Did it worked as expected in previous qgis releases?

#3 Updated by Jürgen Fischer almost 10 years ago

  • Target version changed from Version 2.10 to Future Release - High Priority

#4 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Feedback to Open

#5 Updated by Peter Ciavarella over 9 years ago

You get the same problem when you use Select by Expression on the attribute table. You can't get unique values for any column except column 1. Version is 2.8.2
To reproduce:
  • open the attribute table for a feature loaded from a file geodatabase
  • click the select by expression button and expand the Fields and Values tree
  • right click on any column except for the first one and select Load All Unique Values

#6 Updated by Giovanni Manghi over 9 years ago

  • Affected QGIS version changed from 2.8.1 to master
  • Subject changed from unable to gather unique values or to classify values when using a file gdb to unable to gather unique values or to classify (graduated) values when using a esri file geodatabase
  • Category changed from Symbology to Vectors

using toint(column) or toreal(column) then graduated/categorized symbology works, probably there is something wrong on how numeric column are directly evaluated by qgis in file geodatabase layers.

#7 Updated by Giovanni Manghi over 9 years ago

  • Subject changed from unable to gather unique values or to classify (graduated) values when using a esri file geodatabase to unable to gather unique values or to classify (graduated/categorized) values when using a numeric column in a esri file geodatabase

#8 Updated by Jürgen Fischer about 9 years ago

  • Category changed from Vectors to Data Provider/OGR
  • Resolution set to up/downstream

OGR reports all the columns in the filegdb as String fields (except NUMMER), but QGIS expects numeric fields. So only NUMMER is available for classification. Using it reveals a problem with the OpenFileGDB driver: QGIS does SELECT min(nummer) FROM knelpunten and SELECT max(nummer) FROM knelpunten on that data set. The OpenFileGDB driver apparently has a problem with that and produces a DateTime columm with a bogus value, while the FileGDB driver works. (GDAL 1.11.3 in OSGeo4W).

Using the OpenFileGDB driver:

> set OGR_SKIP=FileGDB
> ogrinfo -so fgdb.gdb knelpunten 
Had to open data source read-only.
INFO: Open of `fgdb.gdb'
      using driver `OpenFileGDB' successful.

Layer name: knelpunten
Geometry: Point
Feature Count: 3799
Extent: (24988.503300, 153700.725300) - (253080.513500, 241128.074600)
Layer SRS WKT:
[...]
FID Column = OBJECTID
Geometry Column = Shape
NUMMER: Real (0.0)
KNLPT_STAT: String (0.0)
KNLPT_TYPE: String (0.0)
INSTANTIE: String (0.0)
USR_AANLOG: String (0.0)
KNLPT_BRON: String (0.0)
Q_GROOTTE: String (0.0)
PRIORITEIT: String (0.0)
ACTIE: String (0.0)
OMSCHR: String (0.0)

> ogrinfo -sql "SELECT min(nummer) FROM knelpunten" fgdb.gdb  
Had to open data source read-only.
INFO: Open of `fgdb.gdb'
      using driver `OpenFileGDB' successful.

Layer name: SELECT
Geometry: None
Feature Count: 1
Layer SRS WKT:
(unknown)
MIN_nummer: DateTime (0.0)
OGRFeature(SELECT):0
  MIN_nummer (DateTime) = (null)

> ogrinfo -sql "SELECT max(nummer) FROM knelpunten" fgdb.gdb  
Had to open data source read-only.
INFO: Open of `fgdb.gdb'
      using driver `OpenFileGDB' successful.

Layer name: SELECT
Geometry: None
Feature Count: 1
Layer SRS WKT:
(unknown)
MAX_nummer: DateTime (0.0)
OGRFeature(SELECT):0
  MAX_nummer (DateTime) = (null)

Using the FileGDB driver:

>set OGR_SKIP=OpenFileGDB 
>ogrinfo -so fgdb.gdb knelpunten 
INFO: Open of `fgdb.gdb'
      using driver `FileGDB' successful.

Layer name: knelpunten
Geometry: Point
Feature Count: 3799
Extent: (24988.503300, 153700.725300) - (253080.513500, 241128.074600)
Layer SRS WKT:
[...]
FID Column = OBJECTID
Geometry Column = Shape
NUMMER: Real (0.0)
KNLPT_STAT: String (0.0)
KNLPT_TYPE: String (0.0)
INSTANTIE: String (0.0)
USR_AANLOG: String (0.0)
KNLPT_BRON: String (0.0)
Q_GROOTTE: String (0.0)
PRIORITEIT: String (0.0)
ACTIE: String (0.0)
OMSCHR: String (0.0)

>ogrinfo -sql "SELECT min(nummer) FROM knelpunten" fgdb.gdb  
INFO: Open of `fgdb.gdb'
      using driver `FileGDB' successful.

Layer name: knelpunten
Geometry: None
Feature Count: 1
Layer SRS WKT:
(unknown)
MIN_nummer: Real (0.0)
OGRFeature(knelpunten):0
  MIN_nummer (Real) = 71

D:\\TEMP\\test\\12\\12282>ogrinfo -sql "SELECT max(nummer) FROM knelpunten" fgdb.gdb  
INFO: Open of `fgdb.gdb'
      using driver `FileGDB' successful.

Layer name: knelpunten
Geometry: None
Feature Count: 1
Layer SRS WKT:
(unknown)
MAX_nummer: Real (0.0)
OGRFeature(knelpunten):0
  MAX_nummer (Real) = 14387

#9 Updated by Jürgen Fischer about 9 years ago

See also GDAL #6160

#10 Updated by Jürgen Fischer about 9 years ago

  • Priority changed from High to Normal

#11 Updated by Jürgen Fischer about 9 years ago

  • Status changed from Open to Closed

Lightning fast fixed in GDAL by EvenR. Thanks

Also available in: Atom PDF