Hi,
I'm trying to update an AGSArcGISFeature (anlageFeature) with this code (offline):
self.anlageTable.update(anlageFeature, completion: { (error) in
print("error updating anlage: \(String(describing: error))")
})
But I'm getting an Error:
error updating anlage: Optional(Error Domain=com.esri.arcgis.runtime.error Code=2 "Invalid argument" UserInfo={NSLocalizedFailureReason=!input_SR || !output_SR, NSLocalizedDescription=Invalid argument, Additional Message=!input_SR || !output_SR})
Can anybody help me with this?
Thank you!
Cheers
Mike
Michael Moor Did you get this resolved? I'm running into the same error with no clear cause.
Thanks!
Hi Christopher,
sorry for the late response!
I resolved this error by sorting the layer IDs when downloading them:
var layerOptions = [AGSGenerateLayerOption]()
// it's very, very important that the layerIDs are in the correct order! otherwise we have the following error message:
// Error Domain=com.esri.arcgis.runtime.error Code=2 "Invalid argument" UserInfo={NSLocalizedFailureReason=!input_SR || !output_SR, NSLocalizedDescription=Invalid argument, Additional Message=!input_SR || !output_SR}
for layerID in layerIDs.sorted() {
let layerOption = AGSGenerateLayerOption(layerID: layerID)
layerOption.useGeometry = useGeo
layerOption.includeRelated = !useGeo
layerOption.whereClause = whereClause
layerOption.queryOption = .useFilter
layerOptions.append(layerOption)
}
//parameters
let params = AGSGenerateGeodatabaseParameters()
params.extent = areaToDownload
params.layerOptions = layerOptions
...
Hope that helps!
Cheers,
Mike