Select to view content in your preferred language

Copy feature layer while keeping the objectid

6092
3
09-25-2013 09:42 AM
GhassanKarwchan
Occasional Contributor
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
Frequent Contributor
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 Alum
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
Deactivated User
Try using a featureSet load/copy, as in:

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