ngageoint / geopackage-android

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

Delete External Database do not delete physical file #59

Closed kttary closed 4 years ago

kttary commented 5 years ago

If i create external database with command manager.createAtPath(dbName, myPath) and then delete it with manager.delete(dbName) i found that the physical file is not deleted. But if i create with manager.create(dbName) and then manager.delete(dbName) then the physical file is gone. Did i miss some setup? I'm still using geopackage android 3.2.0. Thank you

bosborn commented 5 years ago

GeoPackages through external links are not managed in the app's memory space. Upon deletion, a GeoPackage internal to the app's memory space is deleted. However for an externally linked GeoPackage where the file exists outside of the app's memory space, only the link to the GeoPackage is deleted. The same thing would happen if you deleted the app.

When the file path is provided, the GeoPackage is treated as external.

External Creation Methods:

There are a number of external related methods to determine if a GeoPackage is external. For those, you could try delete the file on your own assuming your app has write access.

bosborn commented 5 years ago

Also, if you would like to import / copy the GeoPackage internally into the app space memory: