Open ffrosch opened 4 months ago
I'd be happy to submit a pull request to implement this feature :-)
If there is anything else I would have to pay attention to or add, please let me know.
Hi @ffrosch Thank for your interest in GeoAlchemy2! This feature could be interesting indeed. I'm just wondering if another lib can not already do this? Because GeoAlchemy2 is supposed to just be a 'simple' wrapper for spatial types, so I would prefer to stay focused on these specific types as much as possible. Though in this case I think the changes for this feature should be quite small in the code so we could add it. Anyway, if you have some time to create a PR for this I would be happy to review it :)
Describe the feature
Add non-spatial tables to
gpkg_contents
according to the Geopackage specification (2.4 Attributes and 1.1.2.1.2. Table Data Values).Differences compared to spatial tables:
data_type="attributes"
srs_id=0
Example Use
This feature request is important for end users handling Geopackage data in GUI applications.
Here is a quick sketch for the additional code needed.
geopackage.after_create adds an entry to
gpkg_contents
for every non-spatial table:geopackage.before_drop removes the entry from
gpkg_contents
for every non-spatial table:Use cases
All tables in a Geopackage should be listed in the table
gpkg_contents
to make sure they are discoverable by all applications.QGIS does not properly recognize non-spatial tables that are not listed in
gpkg_contents
. By adding them togpkg_contents
they work as expected in QGIS.