Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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  
  return'{'+str(uuid.uuid4()).upper()+'}'  

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
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. –  Arabella Jul 2 '12 at 5:21
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.