I'm working with an offline geodatabase with version 100.3 of the iOS SDK. I have an AGSFeatureTable and used create() to get a new feature. I set the geometry on the new feature and then attempt to save.
<SPAN class="keyword token">let</SPAN> table <SPAN class="operator token">=</SPAN> self<SPAN class="punctuation token">.</SPAN>esriGeodatabase<SPAN class="operator token">?</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">geodatabaseFeatureTable</SPAN><SPAN class="punctuation token">(</SPAN>withName<SPAN class="punctuation token">:</SPAN> tableName<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">let</SPAN> feature <SPAN class="operator token">=</SPAN> table<SPAN class="operator token">?</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">createFeature</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
feature<SPAN class="punctuation token">.</SPAN>geometry <SPAN class="operator token">=</SPAN> geometry
table<SPAN class="punctuation token">.</SPAN><SPAN class="token function">save</SPAN><SPAN class="punctuation token">(</SPAN>feature<SPAN class="punctuation token">,</SPAN> completion<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
I get the following error and stack trace (image attached):
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}
Note: Same as the error here: Error updating Feature: Invalid Argument: !input_SR || !output_SR
I've verified the following:
- The AGSFeatureTable spatial reference is set to 102100
- The spatial reference of the new feature's geometry is 102100
- The geometry is not nil and was created with an AGSSketchEditor
The error message and stack trace lead me to believe that a reprojection is occurring but I can't understand why, since the table SR matches the geometry SR. Regardless, I can't see why this would fail since the spatial reference is set on both the feature table and the new feature.
Any help on this would be much appreciated.