Hi.
I am having the following issue when i try to update an SDE Geodatabase featureclass geometry from arcpy
Using:
ArcGIS 10.3.1
SQL Server Geodatabase
Line featureclass with enabled: Archiving , Editor Tracking and Registered as Versioned.
The line featureclass also participates in a replica as the source layer.
The line fetureclass can be edited fine from arcmap.
The issue:
Because we do receive new updated line geometries (features) from another source i have bulid a python script that joins the 2 datasets based on an attribute key and and tries to update the geometry on the Line Featureclass.
I am using the following code tu update the geometry.
fieldNames <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'ID'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SHAPE@'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'SHAPE@WKT'</SPAN><SPAN class="punctuation token">]</SPAN>
edit<SPAN class="punctuation token">.</SPAN>startEditing<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
edit<SPAN class="punctuation token">.</SPAN>startOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>UpdateCursor<SPAN class="punctuation token">(</SPAN>line_layer<SPAN class="punctuation token">,</SPAN> fieldNames<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> updateCursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> tmpRow <SPAN class="keyword token">in</SPAN> updateCursor<SPAN class="punctuation token">:</SPAN>
tmpRow<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="comment token">#newgeometry that was read previusly</SPAN>
updateCursor<SPAN class="punctuation token">.</SPAN>updateRow<SPAN class="punctuation token">(</SPAN>tmpRow<SPAN class="punctuation token">)</SPAN>
edit<SPAN class="punctuation token">.</SPAN>stopOperation<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
edit<SPAN class="punctuation token">.</SPAN>stopEditing<SPAN class="punctuation token">(</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
The code runs without any error but the geometry is not updated. I tested the code for other attributes and they were updated correctly.
Any ideas ?
Thanks.