Select to view content in your preferred language

Error updating Feature: Invalid Argument: !input_SR || !output_SR

1220
2
10-18-2017 07:10 AM
MichaelMoor
New Contributor II

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

0 Kudos
2 Replies
ChristopherMilack1
New Contributor III

Michael Moor‌ Did you get this resolved? I'm running into the same error with no clear cause.

Thanks!

0 Kudos
MichaelMoor
New Contributor II

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

0 Kudos