4

Anyone know if would be possible to "convert" a File GDB with a set of features classes, which contain Domain values and Subtypes, in GPKG format (for editing purpose)? What I'm not understanding is, in particular, how to upload Domain values for fields in a GPKG.

Kadir Şahbaz
  • 76,800
  • 56
  • 247
  • 389
Omar Mauri
  • 41
  • 2

3 Answers3

3

As far as I know you cant import the Subtype and domain from File GDB to Geopackage.

One way to get almost the same functionality is to only import the layer to Geopackage then create a QGIS document where you set edit widget to replicate the subtype and domain (ESRI has tool to export domain as table if you export to the same GDB and import these domain table in GPKG you can use it to set up your widget ensuring that you get the exact same value in both software, if you have lot of domain it's also quicker).

This solution is only close to the ESRI way because even if you get the same editing functionality (ie. dropdown list that can be filtered depending on another field) this is only implemented at the document level and not at the database level so you have to set it up again for every new QGIS document (you can save the style to speed up creating new document)

EDIT :

Since version 3.26 it's possible to use QGIS Browser to add and manage domain to geopackage : Feature: Add field domain management capabilities to browser

J.R
  • 16,090
  • 1
  • 19
  • 52
0

Is there work on adding something equivalent to ESRI's Attribute Domains with subtypes to Geopackage? An enumerated data type in your GPKG perhaps? Could be done as described here for PostgreSQL

Is it possible to create Domains for an Oracle (non SDE) database?

Nico
  • 113
  • 7
0

To implement this at the database level, you will need to use an enumerated table.

Unfortunately SQLite databases do not have an ENUM data type. So you will need to create custom enumerated tables. A link here that discuss how to do this. How to create ENUM type in SQLite

Essentially create a REFERENCES table that contains a list of the accepted values.

CREATE TABLE PriceType (
  Type    CHAR(1)       PRIMARY KEY NOT NULL,
  Seq     INTEGER
);
INSERT INTO PriceType(Type, Seq) VALUES ('M',1);
INSERT INTO PriceType(Type, Seq) VALUES ('R',2);
INSERT INTO PriceType(Type, Seq) VALUES ('H',3);

Additionally, there is a solution in this question that extracts the domain list values from File Geodatabases into CSV or similar.

https://gis.stackexchange.com/questions/26215/export-all-coded-value-domains-from-a-geodatabase

Essentially your approach being to use the above tool to export the domain values from the File Geodatabase, import them into a table in your Geopackage database, then use the above REFERENCES statements to restrict the main source data table.

nr_aus
  • 3,535
  • 6
  • 26