Select to view content in your preferred language

Copy Features from one feature class to another

1801
2
08-11-2017 02:22 AM
SurajJha1
Regular Contributor

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

2 Replies
JohannesBierer
Frequent Contributor

Maybe cursors could help you?

searchCur = arcpy.SearchCursor(inFC)
inCur = arcpy.InsertCursor(outFC)

for Row in searchCur:
    inCur.insertRow(Row)
0 Kudos
MicahBabinski
Frequent Contributor

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