Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OGR Field domain creation: properly convert QVariant to expect OGR data type #53314

Merged
merged 1 commit into from
Jun 4, 2023

Conversation

rouault
Copy link
Contributor

@rouault rouault commented May 31, 2023

(fixes #52318)

This fixes the main issues: crashes / data corruption.

Note however that currently the GeoPackage driver doesn't really support storing the data type of a field domain, so on reading, range domains are always read as of type Real (unless there is a layer field associated with that domain). An idea could be to (ab)use the description field of the GeoPackage system table to include a conventional suffix like " (type Integer)" that would be automatically set and stripped off by the OGR GPKG driver.

It could also be nice that the QGIS GUI only proposes types that make sense for the underlying provider, but there's a lack of infrastructure for that.

…ta type (fixes qgis#52318)

This fixes the main issues: crashes / data corruption.

Note however that currently the GeoPackage driver doesn't really support
storing the data type of a field domain, so on reading, range domains
are always read as of type Real (unless there is a layer field
associated with that domain). An idea could be to (ab)use the
description field of the GeoPackage system table to include a
conventional suffix like " (type Integer)" that would be automatically
set and stripped off by the OGR GPKG driver.

It could also be nice that the QGIS GUI only proposes types that make
sense for the underlying provider, but there's a lack of infrastructure
for that.
@lbartoletti lbartoletti merged commit b9736bd into qgis:master Jun 4, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Field domain created incorrectly
3 participants