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

Adding Geopackage support #410

Closed
caspervdw opened this issue Nov 30, 2022 · 5 comments
Closed

Adding Geopackage support #410

caspervdw opened this issue Nov 30, 2022 · 5 comments

Comments

@caspervdw
Copy link

caspervdw commented Nov 30, 2022

Hi @adrien-berchet , first of all, thanks for maintaining this very useful package. We use it intensively to manage our spatialite files.

Recently I investigated whether we could also interface geopackage files with sqlalchemy + geoalchemy. After some tinkering I found that by calling SELECT EnableGpkgAmphibiousMode(), you can actually use geoalchemy as-is to use the ORM to read/write in existing geopackage files. Apparently the spatialite driver has support for geopackage (see https://www.gaia-gis.it/gaia-sins/spatialite-sql-5.0.1.html#p16gpkg)

See here for my implementation: https://github.com/nens/threedi-modelchecker/blob/1eca28ca8854d68df1f4fa136903ce15ea0d9701/threedi_modelchecker/threedi_database.py#L64

As geopackage is quite a common format nowadays, I think it might be interesting for geoalchemy to make this a fully supported option. Stuff that I can see that would need attention:

  • discerning geopackage and spatialite dialects and calling the EnableGpkgAmphibiousMode()
  • inspecting geometry columns and indexes
  • adding / removing geometry columns
  • adding / removing spatial indexes

Please let me know what you think about this. I also might be able to help out here in implementing or testing.

@adrien-berchet
Copy link
Member

Hi @caspervdw
That's a great idea! Thanks for introducing me to this feature, I didn't know that.
I think we should solve #395 first so then we can add this new feature in the appropriate module. I will try to work on it soon so then we can work on what you propose.

@adrien-berchet
Copy link
Member

Hey
I took some time to reorganize the code in #414, so the dialects-specific stuffs are separated. So now we can add support for GeoPackage into geoalchemy2.dialects.sqlite. I will not have time to work on this before the end of the year (at least) but if anyone is willing to start a PR on this topic I will be glad to review it and help.

@caspervdw
Copy link
Author

Hi @adrien-berchet , at my company we'd like to know the options for implementing this new feature.
We might have resources available to work on this some time in the coming months. Are you still interested in helping / reviewing?

Could we get in touch via mail? I couldn't find an email address, mine is casper.vanderwel@nelen-schuurmans.nl

@adrien-berchet
Copy link
Member

Hi @caspervdw
Sure, any help is always welcome :)
I will send you an email to speak about this soon.

@adrien-berchet
Copy link
Member

Solved by #456

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants