Hi
I am trying to read and use the geometries of a polygon layer, row by row, using Search Cursor. I am getting a very strange runtime error, but I cannot figure out the source of this error! My first time getting this runtime error!
Traceback (most recent call last):
File "C:\Documents\ArcGIS\Projects\Census\Redistribute_Home.py", line 75, in <module>
with arcpy.da.SearchCursor(from_shape, ['SHAPE@', 'FIRST_city', 'FIRST_ccid', 'FIRST_NUMBER_OF_DIVISIONS']) as search:
RuntimeError: cannot open 'ON1996_DissolveOnName'
First time seeing this runtime error. It says it cannot open the layer, but there isn't anything striking me to be wrong in my code!
# this is the workspace
arcpy.env.workspace = os.path.join(directory, gdb + '/' + fds) # gdb and fds are text strings
# the layer to create divisions from
from_shape = layer # 'ON1996_DissolveOnName' is the value of the layer
Again, here is the part of the code that runs into error
with arcpy.da.SearchCursor(from_shape, ['SHAPE@', 'FIRST_city', 'FIRST_ccid', 'FIRST_NUMBER_OF_DIVISIONS']) as search:
Another question is whether using SHAPE@ token to read the geometry for each of the