POST
|
we have null values that we want to update with projected coordinates. The coordinates will then be rounded to 6 decimal places.
... View more
06-05-2017
06:27 AM
|
0
|
2
|
486
|
POST
|
We are currently trying to update existing null values with X and Y coordinates. We are getting an error: >>> Traceback (most recent call last): File "C:\FLRmodel\CalculatePlotNumberByAccess3.py", line 72, in <module> row[2] = round(row[0], 6) TypeError: a float is required >>> with arcpy.da.UpdateCursor(projectedFC, ['SHAPE@X', 'SHAPE@Y', 'PLOT_LONG', 'PLOT_LAT'], "" , spatialRef) as cursor:
for row in cursor:
row[2] = round(row[0], 6)
row[3] = round(row[1], 6)
cursor.updateRow(row) Why does it ask for a float?
... View more
06-05-2017
05:16 AM
|
0
|
4
|
966
|
POST
|
I have a python script that calculates x coordinates , y coordinates for a point geometry that sits within a feature dataset of an SDE (SQL Express). The script worked fine on a file geodatabase however when it runs on the SDE feature class, it stalls at the updateCursor function. "ERROR: 999999: Error executing function....Objects in the class cannot be updated outside an edit session [FSB.DBO.Structures]" The script breaks on updCursor.updateRow(row): workspace = arcpy.env.workspace ="insertworkspace"
edit = arcpy.da.Editor(workspace)
edit.startEditing(False, True)
edit.startOperation()
updCursor = arcpy.UpdateCursor(projectedFC,"", spatialRef)
for row in updCursor:
pnt = row.Shape.getPart(0)
row.POINT_X = pnt.X
row.POINT_Y = pnt.Y
updCursor.updateRow(row)
del updCursor, row
edit.stopOperation()
edit.stopEditing(True) If anyone has any information, ideas or input on editing data in non versioned SDE with a updatecursor using python it would be greatly appreciated.
... View more
01-12-2017
09:46 AM
|
0
|
4
|
2845
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|