I have a feature class that has a unique id field. The field is populated using some basic code (using the Calculate Field tool in ArcGIS):

def CalcGUID():  
  import uuid  

When ever the feature class is updated, the unique id fields needs to be recalculated. This issue is that the feature class is associated with a stand alone attribute table and is related using the unique id field. How can the unique id fields in both files be recalculated while still maintaining the relationship?

This work was originally performed using FME and was a straight forward process. However, FME is no longer available to perform the updates. I have access to ArcGIS.

  • 1
    Am I understanding correctly - you are relating two tables based on a unique ID, but everytime you update the feature class, the unique ID is recalculated? The quickest way I know is to add a field prev_id to retain the previous value of the unique ID field and then recalculate so that you can still join/relate your tables as before. – Cindy Jayakumar Jul 2 '12 at 5:21

Modify the code to only recalculate the value if the unique ID field is empty/blank/null. This will keep the values unique, but not constantly changing.

| improve this answer | |
  • Great idea. Can anyone help in modifying the code? – dchaboya Jul 3 '12 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.