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.38k stars 2.98k forks source link

Reading ESRI FileGDB domains into QGIS' attribute form widgets doesn't work #44123

Closed EranGeo closed 3 years ago

EranGeo commented 3 years ago

Describe the bug

Reading ESRI FileGDB domains into QGIS' attribute form widgets doesn't work. Translating coded values domain to their description in QGIS' attribute table doesn't work as well.

How to Reproduce

  1. Download attached sample FileGDB dataset. Test.gdb.zip
  2. Drag and drop Point_Test layer (its only layer) from QGIS' browser into the canvas. Alternatively you can use the 'Data Source Manager'.
  3. Toggle editing
  4. Add new feature
  5. Inspect the prompted attribute form. The field SettelmentType isn't being assigned with a value map widget despite its affiliation with a coded value domain.
  6. Inspect the layer's attribute table. This field is being loaded with its coded values rather than their description.

QGIS and OS versions

QGIS version 3.20.0-Odense QGIS code revision decaadbb31
Qt version 5.15.2
Python version 3.9.5
GDAL/OGR version 3.3.0
PROJ version 8.0.1
EPSG Registry database version v10.018 (2021-04-02)
GEOS version 3.9.1-CAPI-1.14.2
SQLite version 3.35.2
PDAL version 2.3.0
PostgreSQL client version 13.0
SpatiaLite version 5.0.1
QWT version 6.1.3
QScintilla2 version 2.11.5
OS version Windows 10 Version 2009
       
Active Python plugins db_managerMetaSearchprocessing

Additional context

In the last version of QGIS, a new behavior was introduced for reading field domains, from supported datasets types, into QGIS' attribute form widgets (1, 2). I've tested this, and it doesn't work for me.

Therefore I tested the underlying GDAL installation. Everything look good:

GDAL VERSION
GDAL 3.3.0, released 2021/04/26
ogrinfo --formats
[...]
FileGDB -vector- (rw+): ESRI FileGDB
ogrinfo -listmdd Test.gdb Point_Test
[...]
SettelmentType: Integer(Int16) (0.0), domain name=SetType
ogrinfo -fielddomain SetType Test.gdb
[...]
Domain SetType:
  Description: The Type Of The Settelment
  Type: coded
  Field type: Integer(Int16)
  Split policy: default value
  Merge policy: default value
  Coded values:
    1: City
    2: Town
    3: Kibutz

1: Point_Test (Point)

Some screenshots of the FileGDB in ArcGIS Pro image image image

roya0045 commented 3 years ago

It's guess this is more of a limitation of the driver rather than qgis as the format was/must be retro-engineered.

EranGeo commented 3 years ago

Hi @roya0045 , Thank you for your input.

As pointed out in the issue's body, the driver seem to work as expected.

nyalldawson commented 3 years ago

I've just tested and this works fine using the OpenFileGDB driver. Are you able to test with this driver so that we can narrow down the issue?

EranGeo commented 3 years ago

Hi @nyalldawson , I've disabled the FileGDB driver and left the OpenFiileGDB driver untouched (enabled) and restarted QGIS. Doing so, made QGIS to load the point layer with both its coded and range domains.

Disabling FileGDB driver disabling fgdb

Inspecting attribute table inspecting point attribute table

Inspecting layer's attributes form properties attributes form - SettelmentType

attributes form - range field