Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. # import arcpy and set path
  2. import arcpy
  3. import numpy
  4. path = 'C:/Users/Something Wicked/Desktop/Work/Python/Python Scripts/Python Code Project/Sumner County Files'
  5. arcpy.env.workspace = path
  6.  
  7. #Update Feature Class
  8. COUNTY = 'Sumner_County'
  9. FEATURE = 'SumnerGCS83_joined'
  10. UTheme = arcpy.da.UpdateCursor((FEATURE + '.shp'), ['THEME1','THEME2','THEME3','THEME4']) # You're trying to convert to string text that's already a string str('.shp')
  11. for row in UTheme:
  12. if row == 1:
  13. row = 'Early Exploration'
  14. elif row == 2:
  15. row = 'Early Settlement'
  16. elif row == 3:
  17. row = 'Agriculture'
  18. elif row == 4:
  19. row = ' '
  20. elif row == 5:
  21. row = 'Transportation'
  22. elif row == 6:
  23. row = 'Religion/Philosophy Movements & Leaders'
  24. elif row == 7:
  25. row = 'Political/Government'
  26. elif row == 8:
  27. row = 'Military Affairs'
  28. elif row == 9:
  29. row = 'Education'
  30. elif row == 10:
  31. row = 'Science & Technology'
  32. elif row == 11:
  33. row = 'Art & Technology'
  34. elif row == 11:
  35. row = 'Society & Customs'
  36. elif row == 13:
  37. row = 'Humanitarian'
  38. elif row == 99:
  39. row = 'Other'
  40. # Update the cursor with the updated list
  41. cursor.updateRow(row)
  42. del UTheme
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement