Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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 Williams-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.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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