I am trying to use a search cursor to print three columns of data (out of the existing 10). I run a dissolve early in the code and use raw_input so I can specify which fields to use for the dissolve parameter. My endgame is so I can use this on various datasets. Anyway, when I get to the search cursor, it kicks back and error stating "not a spatial reference."
Here is my code after the dissolve. I use the many print field statements to make sure it is printing the text correctly. Ultimately, what I am trying to do is have it automatically use the fields I use for the dissolve as the search cursor. I am not sure how I do not have a spatial reference when
codes_fc is the
dissolved_lu layer. Dissolve_items contains the field names in the dissolve. They are typed in as
LU12;LABEL12;TYPE12 - which explains the replace the in the first line.
textheaders = str(dissolve_items.replace(";",",")) print textheaders codes_fc = dissolve_lu fields = textheaders.split(',') print fields print fields print fields print fields print fields #Search fields for using Search Cursor with arcpy.da.SearchCursor(codes_fc, fields, fields, fields) as cursor: #log("LU12" + "," + "Label_12") for rows in cursor: print rows codes = str(fields) desc = str(fields) type1 = str(fields) print codes, desc, type1 code_entry = str(codes, desc, type1) if code_entry not in lu_code_list: lu_code_list.append(code_entry) print lu_code_list