Hi all -
I keep getting:
Traceback (most recent call last):
File "<string>", line 26, in <module>
RuntimeError: workspace already in transaction mode
when I run my script. I can't sort out why.
Here's my code. (Not loving how the formatting works here.)
# Move points based up current lat/lon
#grab stuff you need
print "Imported Libraries."
# Set variablesfilepath = r'S:\AGR\AGR-Shared\AGR-GIS\AGR_Data\Connection to cloud.agriculture.vermont.gov.sde'
fc = "AGRGISDATA.DBO.ApiariesWGS"
fc_path = os.path.join(filepath, fc)
fields = ['Longtitude','Latitude','SHAPE@XY']
#arcpy.env.workspace = fc_path #I don't think this is needed.
workspace = os.path.dirname(fc_path)
editor = arcpy.da.Editor(workspace) #this one throws "RuntimeError: workspace already in transaction mode"
print "Set vars."
print "Editor Commands."
#create curser on fc
with arcpy.da.UpdateCursor(fc_path,fields) as cursor:
for row in cursor:
print "for row in cursor"
x = row
y = row
xy = (x,y)
pnt = xy
row = pnt
print "Updated Rows."
print "It worked!"
My code is indented properly, I just couldn't make it do so with the syntax highlighter here. I'm sure there's a way, but I haven't figured it out.
Anyway, I've been trying different things to get this code running again, and I'm out of ideas. Would love some help.