ngageoint / geopackage-android

GeoPackage Android Library
http://ngageoint.github.io/geopackage-android
MIT License
94 stars 32 forks source link

Open GeoPackage file by absolute path #57

Closed sveta-wl closed 5 years ago

sveta-wl commented 5 years ago

Hi there,

is it possible to open GeoPackage file providing an absolute path? I have some GeoPackages stored on a SD card, so I can create a simple SQLite connection to read them, but in GeoPackage Library I found only a way to provide App Context, which always takes a context.databasePath. Is there a way to write something like this

File dbFile = new File(storageDir, "myDatabase.gpkg");
GeoPackage mySdCardGeoPackage = new GeoPackage(dbFile.getAbsolutPath());

or any way to provide own database connection?

Version Information:

Thank you for any help.

bosborn commented 5 years ago

Assuming the file is externally readable (and potentially writable), have you tried the external link imports? The file is not copied and is read and/or modified at the external location.

bosborn commented 5 years ago

We did lose the ability to open a GeoPackage on a SD card as writable a few years back and I never revisited it, but read only still worked.

There is currently no ability to pass in your own SQLiteDatabase connection to the GeoPackage. Doesn't mean it could not be added, just currently not there.

sveta-wl commented 5 years ago

Hi @bosborn

with external link import it works great, thank you!