0

I want to post this question on esri community, but I was not able to login there.

I created the offline geo database and showing the layers from it to the map.

My issue is when i download the geoDatabse and show the data from it is working fine for the first time. But when I restart the app and create the AGSGeodatabase object from path then the "self.generatedGeodatabase.load" function gives error

Error Domain=com.esri.arcgis.runtime.error Code=14 "File not found" UserInfo={NSLocalizedFailureReason=, NSLocalizedDescription=File not found, Additional Message=}

my created url is :-

file:///var/mobile/Containers/Data/Application/60CF7AE1-2DE1-4FA0-805A-6140D4829E89/Documents/GeoDatabase/2018-05-134T18:29:01+0530.geodatabase

and I'm creating object is like this :-

         if let geoDatabasePath = URL(string: SettingsManager.geoDatabasePath) {
            self.generatedGeodatabase = AGSGeodatabase(fileURL: geoDatabasePath)
            self.displayLayersFromGeodatabase()
        }

and error is coming when this function runs:-

 self.generatedGeodatabase.load(completion: { [weak self] (error:Error?) -> Void in
        if let error = error {
            print(error)
        }
})
Parv Bhasker
  • 1,773
  • 1
  • 20
  • 39
  • If you add a check with the FileManager, does the .geodatabase file actually exist in that location? – Nixta May 31 '18 at 17:25
  • Hi Nixta, thanks for the response, I get this issue resolved. Previously I was just saving the path of the geodatabse to preference and app is not detecting the geodatabse at that location even the file is there. The solution to this problem I find is to detect the geoDatabse at runtime and create path using FInelManager. Then it works. – Parv Bhasker Jun 01 '18 at 05:14

1 Answers1

0

Previously I was just saving the path of the geoDatabse to preference (when creating the geoDatabse) and app is not detecting the geoDatabse at that location when I restart the app even the file is there.

The solution to this problem I find is to detect the geoDatabse path at runtime and create path using FileManager. Then it works.

Parv Bhasker
  • 1,773
  • 1
  • 20
  • 39