GPKGGeoPackageManager
Objective-C
@interface GPKGGeoPackageManager : NSObject <NSURLSessionDownloadDelegate>
Swift
class GPKGGeoPackageManager : NSObject, URLSessionDownloadDelegate
GeoPackage Database management. Maintains an active connection to the metadata database, close when done.
-
Metadata database connection
Declaration
Objective-C
@property (nonatomic, strong) GPKGMetadataDb *metadataDb;
Swift
var metadataDb: GPKGMetadataDb! { get set }
-
Validate the database header of an imported database
Declaration
Objective-C
@property (nonatomic) BOOL importHeaderValidation;
Swift
var importHeaderValidation: Bool { get set }
-
Validate the database integrity of a imported database
Declaration
Objective-C
@property (nonatomic) BOOL importIntegrityValidation;
Swift
var importIntegrityValidation: Bool { get set }
-
Validate the database header when opening a database
Declaration
Objective-C
@property (nonatomic) BOOL openHeaderValidation;
Swift
var openHeaderValidation: Bool { get set }
-
Validate the database integrity when opening a database
Declaration
Objective-C
@property (nonatomic) BOOL openIntegrityValidation;
Swift
var openIntegrityValidation: Bool { get set }
-
Initialize
Declaration
Objective-C
- (instancetype)init;
Swift
init!()
Return Value
manager
-
Close the manager connection
Declaration
Objective-C
- (void)close;
Swift
func close()
-
List all GeoPackage databases sorted alphabetically
Declaration
Objective-C
- (NSArray *)databases;
Swift
func databases() -> [Any]!
Return Value
database names
-
List GeoPackage databases that match the provided like argument
Declaration
Objective-C
- (NSArray *)databasesLike:(NSString *)like;
Swift
func databasesLike(_ like: String!) -> [Any]!
Parameters
like
like argument, using % as a wild card
Return Value
database names
-
List GeoPackage databases that do not match the provided like argument
Declaration
Objective-C
- (NSArray *)databasesNotLike:(NSString *)notLike;
Swift
func databasesNotLike(_ notLike: String!) -> [Any]!
Parameters
notLike
not like argument, using % as a wild card
Return Value
database names
-
Get the count of GeoPackage databases
Declaration
Objective-C
- (int)count;
Swift
func count() -> Int32
Return Value
database count
-
Get the path of the database
Declaration
Objective-C
- (NSString *)pathForDatabase:(NSString *)database;
Swift
func path(forDatabase database: String!) -> String!
Parameters
database
database name
Return Value
path
-
Get the documents path for the database
Declaration
Objective-C
- (NSString *)documentsPathForDatabase:(NSString *)database;
Swift
func documentsPath(forDatabase database: String!) -> String!
Parameters
database
database name
Return Value
documents path
-
Check if the database exists
Declaration
Objective-C
- (BOOL)exists:(NSString *)database;
Swift
func exists(_ database: String!) -> Bool
Parameters
database
database name
Return Value
true if exists, false if not
-
Size of the database in bytes
Declaration
Objective-C
- (int)size:(NSString *)database;
Swift
func size(_ database: String!) -> Int32
Parameters
database
database name
Return Value
bytes
-
Get a readable version of the database size
Declaration
Objective-C
- (NSString *)readableSize:(NSString *)database;
Swift
func readableSize(_ database: String!) -> String!
Parameters
database
database name
Return Value
string size
-
Delete a database
Declaration
Objective-C
- (BOOL)delete:(NSString *)database;
Swift
func delete(_ database: String!) -> Bool
Parameters
database
database name
Return Value
true if deleted
-
Delete a database and optionally the backing file
Declaration
Objective-C
- (BOOL)delete:(NSString *)database andFile:(BOOL)deleteFile;
Swift
func delete(_ database: String!, andFile deleteFile: Bool) -> Bool
Parameters
database
database name
deleteFile
true to delete the GeoPackage file
Return Value
true if deleted
-
Delete all databases
Declaration
Objective-C
- (BOOL)deleteAll;
Swift
func deleteAll() -> Bool
Return Value
true if deleted
-
Delete all databases and optionally the backing files
Declaration
Objective-C
- (BOOL)deleteAllAndFiles:(BOOL)deleteFiles;
Swift
func deleteAllAndFiles(_ deleteFiles: Bool) -> Bool
Parameters
deleteFiles
true to delete the backing GeoPackage files
Return Value
true if deleted
-
Create a new GeoPackage database
Declaration
Objective-C
- (BOOL)create:(NSString *)database;
Swift
func create(_ database: String!) -> Bool
Parameters
database
database name
Return Value
true if created
-
Create a new GeoPackage database in specified directory
Declaration
Objective-C
- (BOOL)create:(NSString *)database inDirectory:(NSString *)dbDirectory;
Swift
func create(_ database: String!, inDirectory dbDirectory: String!) -> Bool
Parameters
database
database name
dbDirectory
directory
Return Value
true if created
-
Import a GeoPackage file from a path
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path;
Swift
func importGeoPackage(fromPath path: String!) -> Bool
Parameters
path
Geopackage path
Return Value
true if imported
-
Import a GeoPackage file from a path and name it
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path withName:(NSString *)name;
Swift
func importGeoPackage(fromPath path: String!, withName name: String!) -> Bool
Parameters
path
GeoPackage path
name
creation name
Return Value
true if imported
-
Import a GeoPackage file from a path into a directory
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path inDirectory:(NSString *)dbDirectory;
Swift
func importGeoPackage(fromPath path: String!, inDirectory dbDirectory: String!) -> Bool
Parameters
path
GeoPackage path
dbDirectory
directory
Return Value
true if imported
-
Import a GeoPackage file from a path with existing file override option
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path andOverride:(BOOL)override;
Swift
func importGeoPackage(fromPath path: String!, andOverride override: Bool) -> Bool
Parameters
path
GeoPackage path
override
true to override an existing GeoPackage
Return Value
true if imported
-
Import a GeoPackage file from a path with existing file override and move instead of copy option
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path andOverride:(BOOL)override andMove:(BOOL)moveFile;
Swift
func importGeoPackage(fromPath path: String!, andOverride override: Bool, andMove moveFile: Bool) -> Bool
Parameters
path
GeoPackage path
override
true to override an existing GeoPackage
moveFile
true to move GeoPackage instead of copying
Return Value
true if imported
-
Import a GeoPackage file from a path into a directory with existing file override option
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path inDirectory:(NSString *)dbDirectory andOverride:(BOOL)override;
Swift
func importGeoPackage(fromPath path: String!, inDirectory dbDirectory: String!, andOverride override: Bool) -> Bool
Parameters
path
GeoPackage path
dbDirectory
directory
override
true to override an existing GeoPackage
Return Value
true if imported
-
Import a GeoPackage file from a path and name it with existing file override option
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path withName:(NSString *)name andOverride:(BOOL)override;
Swift
func importGeoPackage(fromPath path: String!, withName name: String!, andOverride override: Bool) -> Bool
Parameters
path
GeoPackage path
name
creation name
override
true to override an existing GeoPackage
Return Value
true if imported
-
Import a GeoPackage file from a path and name it into a directory
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path withName:(NSString *)name inDirectory:(NSString *)dbDirectory;
Swift
func importGeoPackage(fromPath path: String!, withName name: String!, inDirectory dbDirectory: String!) -> Bool
Parameters
path
GeoPackage path
name
creation name
dbDirectory
directory
Return Value
true if imported
-
Import a GeoPackage file from a path and name it into a directory with existing file overide option
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path withName:(NSString *)name inDirectory:(NSString *)dbDirectory andOverride:(BOOL)override;
Swift
func importGeoPackage(fromPath path: String!, withName name: String!, inDirectory dbDirectory: String!, andOverride override: Bool) -> Bool
Parameters
path
GeoPackage path
name
creation name
dbDirectory
directory
override
true to override an existing GeoPackage
Return Value
true if imported
-
Import a GeoPackage file from a path and name it with existing file overide and move instead of copy option
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path withName:(NSString *)name andOverride:(BOOL)override andMove:(BOOL)moveFile;
Swift
func importGeoPackage(fromPath path: String!, withName name: String!, andOverride override: Bool, andMove moveFile: Bool) -> Bool
Parameters
path
GeoPackage path
name
creation name
override
true to override an existing GeoPackage
moveFile
true to move GeoPackage instead of copying
Return Value
true if imported
-
Import a GeoPackage file from a path and name it into a directory with existing file overide and move instead of copy option
Declaration
Objective-C
- (BOOL)importGeoPackageFromPath:(NSString *)path withName:(NSString *)name inDirectory:(NSString *)dbDirectory andOverride:(BOOL)override andMove:(BOOL)moveFile;
Swift
func importGeoPackage(fromPath path: String!, withName name: String!, inDirectory dbDirectory: String!, andOverride override: Bool, andMove moveFile: Bool) -> Bool
Parameters
path
GeoPackage path
name
creation name
dbDirectory
directory
override
true to override an existing GeoPackage
moveFile
true to move GeoPackage instead of copying
Return Value
true if imported
-
Import a GeoPackage file from a URL
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url;
Swift
func importGeoPackage(from url: URL!)
Parameters
url
url
-
Import a GeoPackage file from a URL
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withSession:(NSURLSession *)session;
Swift
func importGeoPackage(from url: URL!, with session: URLSession!)
Parameters
url
url
session
session
-
Import a GeoPackage file from a URL and name it
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withName:(NSString *)name;
Swift
func importGeoPackage(from url: URL!, withName name: String!)
Parameters
url
url
name
creation name
-
Import a GeoPackage file from a URL and name it
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withSession:(NSURLSession *)session andName:(NSString *)name;
Swift
func importGeoPackage(from url: URL!, with session: URLSession!, andName name: String!)
Parameters
url
url
session
session
name
creation name
-
Import a GeoPackage file from a URL and name it into a directory
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withName:(NSString *)name inDirectory:(NSString *)dbDirectory;
Swift
func importGeoPackage(from url: URL!, withName name: String!, inDirectory dbDirectory: String!)
Parameters
url
url
name
creation name
dbDirectory
directory
-
Import a GeoPackage file from a URL and name it into a directory
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withSession:(NSURLSession *)session andName:(NSString *)name inDirectory:(NSString *)dbDirectory;
Swift
func importGeoPackage(from url: URL!, with session: URLSession!, andName name: String!, inDirectory dbDirectory: String!)
Parameters
url
url
session
session
name
creation name
dbDirectory
directory
-
Import a GeoPackage file from a URL and name it with progress callbacks
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withName:(NSString *)name andProgress:(NSObject<GPKGProgress> *)progress;
Swift
func importGeoPackage(from url: URL!, withName name: String!, andProgress progress: (any GPKGProgress)!)
Parameters
url
url
name
creation name
progress
progress callback
-
Import a GeoPackage file from a URL and name it with progress callbacks
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withSession:(NSURLSession *)session andName:(NSString *)name andProgress:(NSObject<GPKGProgress> *)progress;
Swift
func importGeoPackage(from url: URL!, with session: URLSession!, andName name: String!, andProgress progress: (any GPKGProgress)!)
Parameters
url
url
session
session
name
creation name
progress
progress callback
-
Import a GeoPackage file from a URL and name it with existing file overide option
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withName:(NSString *)name andOverride:(BOOL)override;
Swift
func importGeoPackage(from url: URL!, withName name: String!, andOverride override: Bool)
Parameters
url
url
name
creation name
override
true to override an existing GeoPackage
-
Import a GeoPackage file from a URL and name it with existing file overide option
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withSession:(NSURLSession *)session andName:(NSString *)name andOverride:(BOOL)override;
Swift
func importGeoPackage(from url: URL!, with session: URLSession!, andName name: String!, andOverride override: Bool)
Parameters
url
url
session
session
name
creation name
override
true to override an existing GeoPackage
-
Import a GeoPackage file from a URL and name it into a directory with progress callbacks
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withName:(NSString *)name inDirectory:(NSString *)dbDirectory andProgress:(NSObject<GPKGProgress> *)progress;
Swift
func importGeoPackage(from url: URL!, withName name: String!, inDirectory dbDirectory: String!, andProgress progress: (any GPKGProgress)!)
Parameters
url
url
name
creation name
dbDirectory
directory
progress
progress callback
-
Import a GeoPackage file from a URL and name it into a directory with progress callbacks
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withSession:(NSURLSession *)session andName:(NSString *)name inDirectory:(NSString *)dbDirectory andProgress:(NSObject<GPKGProgress> *)progress;
Swift
func importGeoPackage(from url: URL!, with session: URLSession!, andName name: String!, inDirectory dbDirectory: String!, andProgress progress: (any GPKGProgress)!)
Parameters
url
url
session
session
name
creation name
dbDirectory
directory
progress
progress callback
-
Import a GeoPackage file from a URL and name it into a directory with existing file overide option
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withName:(NSString *)name inDirectory:(NSString *)dbDirectory andOverride:(BOOL)override;
Swift
func importGeoPackage(from url: URL!, withName name: String!, inDirectory dbDirectory: String!, andOverride override: Bool)
Parameters
url
url
name
creation name
dbDirectory
directory
override
true to override an existing GeoPackage
-
Import a GeoPackage file from a URL and name it into a directory with existing file overide option
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withSession:(NSURLSession *)session andName:(NSString *)name inDirectory:(NSString *)dbDirectory andOverride:(BOOL)override;
Swift
func importGeoPackage(from url: URL!, with session: URLSession!, andName name: String!, inDirectory dbDirectory: String!, andOverride override: Bool)
Parameters
url
url
session
session
name
creation name
dbDirectory
directory
override
true to override an existing GeoPackage
-
Import a GeoPackage file from a URL and name it into a directory with existing file overide option and progress callbacks
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withName:(NSString *)name inDirectory:(NSString *)dbDirectory andOverride:(BOOL)override andProgress:(NSObject<GPKGProgress> *)progress;
Swift
func importGeoPackage(from url: URL!, withName name: String!, inDirectory dbDirectory: String!, andOverride override: Bool, andProgress progress: (any GPKGProgress)!)
Parameters
url
url
name
creation name
dbDirectory
directory
override
true to override an existing GeoPackage
progress
progress callback
-
Import a GeoPackage file from a URL and name it into a directory with existing file overide option and progress callbacks
Declaration
Objective-C
- (void)importGeoPackageFromUrl:(NSURL *)url withSession:(NSURLSession *)session andName:(NSString *)name inDirectory:(NSString *)dbDirectory andOverride:(BOOL)override andProgress:(NSObject<GPKGProgress> *)progress;
Swift
func importGeoPackage(from url: URL!, with session: URLSession!, andName name: String!, inDirectory dbDirectory: String!, andOverride override: Bool, andProgress progress: (any GPKGProgress)!)
Parameters
url
url
session
session
name
creation name
dbDirectory
directory
override
true to override an existing GeoPackage
progress
progress callback
-
Export a GeoPackage to a directory
Declaration
Objective-C
- (NSString *)exportGeoPackage:(NSString *)database toDirectory:(NSString *)directory;
Swift
func exportGeoPackage(_ database: String!, toDirectory directory: String!) -> String!
Parameters
database
database name
directory
directory
Return Value
exported file
-
Export a GeoPackage to a directory and name it
Declaration
Objective-C
- (NSString *)exportGeoPackage:(NSString *)database withName:(NSString *)name toDirectory:(NSString *)directory;
Swift
func exportGeoPackage(_ database: String!, withName name: String!, toDirectory directory: String!) -> String!
Parameters
database
database name
name
export save name
directory
directory
Return Value
exported file
-
Open a GeoPackage database
Declaration
Objective-C
- (GPKGGeoPackage *)open:(NSString *)database;
Swift
func open(_ database: String!) -> GPKGGeoPackage!
Parameters
database
database name
Return Value
GeoPackage
-
Validate the database header and integrity.
Declaration
Objective-C
- (BOOL)validate:(NSString *)database;
Swift
func validate(_ database: String!) -> Bool
Parameters
database
database name
Return Value
true if valid, false if not
-
Validate the database header. Checks the beginning bytes for the SQLite header string.
Declaration
Objective-C
- (BOOL)validateHeader:(NSString *)database;
Swift
func validateHeader(_ database: String!) -> Bool
Parameters
database
database name
Return Value
true if valid, false if not
-
Validate the database integrity. Performs a database integrity ok check.
Declaration
Objective-C
- (BOOL)validateIntegrity:(NSString *)database;
Swift
func validateIntegrity(_ database: String!) -> Bool
Parameters
database
database name
Return Value
true if valid, false if not
-
Copy a GeoPackage into the same directory
Declaration
Objective-C
- (BOOL)copy:(NSString *)database to:(NSString *)databaseCopy;
Swift
func copy(_ database: String!, to databaseCopy: String!) -> Bool
Parameters
database
database name
databaseCopy
new copy database name
Return Value
true if copied
-
Copy a GeoPackage with same directory option
Declaration
Objective-C
- (BOOL)copy:(NSString *)database to:(NSString *)databaseCopy andSameDirectory:(BOOL)sameDirectory;
Swift
func copy(_ database: String!, to databaseCopy: String!, andSameDirectory sameDirectory: Bool) -> Bool
Parameters
database
database name
databaseCopy
new copy database name
sameDirectory
true to copy into same directory, false to copy into manager default directory
Return Value
true if copied
-
Rename a GeoPackage and it’s file
Declaration
Objective-C
- (BOOL)rename:(NSString *)database to:(NSString *)newDatabase;
Swift
func rename(_ database: String!, to newDatabase: String!) -> Bool
Parameters
database
database name
newDatabase
new database name
Return Value
true if renamed
-
Rename a GeoPackage with rename file option
Declaration
Objective-C
- (BOOL)rename:(NSString *)database to:(NSString *)newDatabase andRenameFile:(BOOL)renameFile;
Swift
func rename(_ database: String!, to newDatabase: String!, andRenameFile renameFile: Bool) -> Bool
Parameters
database
database name
newDatabase
new database name
renameFile
true to rename file, false to preserve file name
Return Value
true if renamed
-
Move a GeoPackage to a different directory
Declaration
Objective-C
- (BOOL)move:(NSString *)database toDirectory:(NSString *)dbDirectory;
Swift
func move(_ database: String!, toDirectory dbDirectory: String!) -> Bool
Parameters
database
database name
dbDirectory
new directory location
Return Value
true if moved
-
Import a GeoPackage linking to an existing file
Declaration
Objective-C
- (BOOL)importGeoPackageAsLinkToPath:(NSString *)path withName:(NSString *)name;
Swift
func importGeoPackageAsLink(toPath path: String!, withName name: String!) -> Bool
Parameters
path
GeoPackage path
name
name to reference the database
Return Value
true if imported successfully