georust / geozero

Zero-Copy reading and writing of geospatial data.
Apache License 2.0
323 stars 30 forks source link

Implement an sqlx (sqlite) driver #113

Closed RuboGubo closed 11 months ago

RuboGubo commented 1 year ago

I know there is already an implementation for other databases, so it would be nice if this could be expanded for the sqlite db.

I am happy to try to help out, but my rust is not very good, so i don't know how much I could do myself.

nyurik commented 1 year ago

@RuboGubo could you elaborate on what exactly you are thinking of? What kind of functionality, and for which of the formats? Thx!

RuboGubo commented 1 year ago

Well, essentially the same as for the PostgreSQL implementation, Having the ability to encode and decode different geography into one column.

pka commented 1 year ago

The GPKG driver does read from and write to SQLite using SQLx:

https://github.com/georust/geozero/blob/9b3f6b440cc7591ae6a78d10d08b62e4e3847260/geozero/src/gpkg/mod.rs#L11-L25

Writing is limited, since a spatial extension like SpatiaLite is required for most operations.

GDAL has two and a half SQLite drivers: https://gdal.org/drivers/vector/gpkg.html, https://gdal.org/drivers/vector/sqlite.html

Is your intention supporting non-GPKG SQLite?