AnsweredAssumed Answered

Using a search Cursor I keep getting an error

Question asked by Leithhawkins on Feb 2, 2017
Latest reply on Feb 2, 2017 by Leithhawkins

Hi ,


So I am using a search cursor to run through each row and multi buffer  - having a few dramas and I cant seem to get my head around it!


I assume its to do with how I am calling row into the buffer ?



import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True

file_workspace = "r'N:\GIS\Projects\AA_Leith_Hawkins_TestBed\Search_Cursor\Search_Cursor.gdb"
env.workspace = file_workspace

Holdings = r'N:\GIS\Projects\AA_Leith_Hawkins_TestBed\Search_Cursor\Search_Cursor.gdb\Data\Holdings'
ofc = r'N:\GIS\Projects\AA_Leith_Hawkins_TestBed\Search_Cursor\Search_Cursor.gdb'
distances = [1000, 4000]
unit = "Meters"

with arcpy.da.SearchCursor(Holdings, ['Holding_Reference_Number'])as Holdings_Ref_cursor:
    for x in Holdings_Ref_cursor:
        print x[0]
        Poyl_name = row[0]
        arcpy.SelectLayerByAttribute_management('Holdings_Layer', 'NEW_SELECTION', '"' + Holdings + '" = \'' + Poyl_name + '\'')
        arcpy.MultipleRingBuffer_analysis('Holdings_Layer', 'ofc', distances, unit, "", "ALL")
       #arcpy.Buffer_analysis("Holdings_Layer", ofc, var_Buffer, "FULL", "ROUND", "ALL", "")
        print 'Buffer complete'
        print('Buffer Complete')