Copy feature layer while keeping the objectid

5426
3
09-25-2013 09:42 AM
GhassanKarwchan
New Contributor III
Hi
What is the geoprocessing tool (python arcpy) that will allow you to copy a feature table while keeping the object id?
3 Replies
markdenil
Occasional Contributor III
Add a field and calculate it to the object ID
OIDs are dynamic and system generated;
you cannot rely on them in any way over more than a very short time frame.
0 Kudos
RichardFairhurst
MVP Honored Contributor
Hi
What is the geoprocessing tool (python arcpy) that will allow you to copy a feature table while keeping the object id?


I believe the Copy tool will do that for simple features, but you should verify the result.  Complex relationships and feature types (topologies, network datasets, feature linked annotation) won't be ported and may not even work with that tool.
0 Kudos
DaleHoneycutt
Occasional Contributor III
Try using a featureSet load/copy, as in:

fs = arcpy.FeatureSet()
fs.load(input_table_path)
fs.save(output_table_path)