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 feel like this should be really simple and I am missing something. All I wish to do is assign a unique ID to each polygon since I have multiple identical FID values. In MS excel I would simply type 1 then run this value down the rows of the column and it would automatically assign 1,2,3.....n. Can I do something in Arc10? Thanks

share|improve this question
    
See gis.stackexchange.com/questions/22979/… for a solution. –  whuber Oct 1 '12 at 14:26
add comment

2 Answers

According to http://forums.arcgis.com/threads/6710-GIVING-SEQUENTIAL-NUMBERS-TO-A-FIELD

Copy the following code to the field calculator code block (python):

rec=0
def autoIncrement():
 global rec
 pStart = 1 #adjust start value, if req'd 
 pInterval = 1 #adjust interval value, if req'd
 if (rec == 0): 
  rec = pStart 
 else: 
  rec = rec + pInterval 
 return rec

Copy this to the window below the code block:

autoIncrement()
share|improve this answer
    
I have used this piece of code in several different scenarios, absolutely brilliant. –  Arabella Oct 3 '12 at 11:04
add comment

Try this;

  1. Right click on the field to be calculated and Choose "Calculate"
  2. Type [FID]+1
share|improve this answer
    
This won't create unique IDs since there are "multiple identical FID values" (according to the question). –  user3461 Oct 3 '12 at 11:12
    
By definition, FID's are unique: support.esri.com/en/knowledgebase/techarticles/detail/37480. If your FID's are not unique, you may have an editing session active, or you are no longer in an ArcGIS environment. –  pgager Jan 23 '13 at 5:53
    
Agreed that FIDs should be unique in most cases. Presumably something happened to the data in question that has corrupted the FIDs. –  user3461 Jan 23 '13 at 12:54
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.