Solved! Go to Solution.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *gdbPath = [paths objectAtIndex:0]; gdbPath = [gdbPath stringByAppendingPathComponent:@"ltg.geodatabase"]; if ([[NSFileManager defaultManager] fileExistsAtPath:gdbPath]) { //create GDB here }
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *gdbPath = [paths objectAtIndex:0]; gdbPath = [gdbPath stringByAppendingPathComponent:@"ltg.geodatabase"]; if ([[NSFileManager defaultManager] fileExistsAtPath:gdbPath]) { //create GDB here }
Thanks for reporting. This seems to be an issue in the SDK. We'll work on fixing it.
A work around for it is to use iTunes File Sharing and share the geodatabase through it.
To enable file sharing in your app, set the property "Application supports iTunes file sharing" to YES in Info.plist file. Then you should be able to add the geodatabase as described here
You can then create the geodatabase as follows:NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *gdbPath = [paths objectAtIndex:0]; gdbPath = [gdbPath stringByAppendingPathComponent:@"ltg.geodatabase"]; if ([[NSFileManager defaultManager] fileExistsAtPath:gdbPath]) { //create GDB here }
Hope this helps, please let us know if you have more questions.
Which file type got worked .gdb or .geodatabase?
We are also facing same problem i.e unable to read data from .gdb file.
How we have to add it : locally in app or in documents directory?