I have two feature class source and target. Target feature class has all the columns that matches with source feature class but target feature class also has some extra fields. Total number of columns in source feature class is 5 and total number of columns in target feature class is 10. Now i want to copy(not append) all the features from source to target. The reason for copying is i want to preserve the value of GlobalID field. Can some one help me to achieve this using arcpy
Thanks
Hi Suraj,
I know you said you don't want to append. However, have you considered the Preserve GlobalIDs environment setting? It applies to the append GP tool. I haven't used it personally but it might help. Let me know what works for you as this is of interest to me as well.
Preserve Global IDs (Environment setting)—Geoprocessing | ArcGIS Desktop
Regards,
Micah
Maybe cursors could help you?
searchCur <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>inFC<SPAN class="punctuation token">)</SPAN> inCur <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>InsertCursor<SPAN class="punctuation token">(</SPAN>outFC<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">for</SPAN> Row <SPAN class="keyword token">in</SPAN> searchCur<SPAN class="punctuation token">:</SPAN> inCur<SPAN class="punctuation token">.</SPAN>insertRow<SPAN class="punctuation token">(</SPAN>Row<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.