Hi,
I have an application that downloads a zip file that contains the network files, and save it in Documents application folder.
The problem is that some networks don't have the _ND_historical_traffic inside .tn folder. When this happens and i try to get the default params, i get the issue bellow:
Error Domain=com.esri.arcgis.runtime.error Code=3072
"The transportation network data files could not be opened, and may be missing."
UserInfo={
Additional Message=Network_index::open_file_sections_,
NSLocalizedFailureReason=Network_index::open_file_sections_,
NSLocalizedDescription=The transportation network data files could not be opened,
and may be missing.
}
Here my code:
let folderPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
let gdbPath = folderPath.appending("/network/data.geodatabase")
self.routeTask = AGSRouteTask(fileURLToDatabase: URL(string:gdbPath)!, networkName: "network_ND")
self.getDefaultParameters()
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>func getDefaultParameters() {
self.routeTask.defaultRouteParameters(completion: {(params: AGSRouteParameters?, error: Error?) -> Void in
if let error = error {
print(error)
}
else {
self.params = params
}
})
}<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>