Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #Make a feature layer for the neighourhoods
  2. arcpy.MakeFeatureLayer_management(neighbourhood, "neighbourhoodLayer")
  3. arcpy.MakeFeatureLayer_management(parcel, "parcelLayerTest1")
  4. #Setup cursor to update new NBHD field
  5. with arcpy.da.UpdateCursor(parcel, (parcelIDField,nbhdField)) as parRows:
  6. for par in parRows:
  7. # Create a query string for the current patrol zone
  8. #parcelIDstring = par[0]
  9. #queryString = '"' + str(parcelIDField) + '" =' + "'" + str(parcelIDstring) + "'"
  10.  
  11. #Select parcels based on location contained within neighbourhood
  12. arcpy.SelectLayerByLocation_management("parcelLayerTest1", "HAVE_THEIR_CENTER_IN", neighbourhood)
  13.  
  14. nbhdTable = arcpy.SearchCursor(neighbourhood)
  15. for nbhd in nbhdTable:
  16. nbhdValue = nbhd.getValue("Neighbourh")
  17. if nbhdValue:
  18. par[1] = nbhdValue
  19. parRows.updateRow(par)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement