POST
|
i'm trying to delete rows from feature class based on some condition, this could have worked but like you i can't make the infoexpress work.
... View more
09-15-2016
05:40 AM
|
0
|
0
|
263
|
POST
|
like you I'm not able to make the infoexpress work and I am able to a clean_arc call. the reselect_arc would have been a nice alternative to my delete row issue.
... View more
09-15-2016
05:39 AM
|
0
|
1
|
712
|
POST
|
also converting to gdb change the shape(geometry) values, losing precision
... View more
09-14-2016
09:11 AM
|
0
|
0
|
1082
|
POST
|
I did a quick test (converted one of my coverage into gdb) and i am able to delete a row. I hope to make my delete work on the coverage since I need to do a clean_arc after deleting stuff the clean_arc doesn't seem to work on a geodatabase file
... View more
09-14-2016
09:03 AM
|
0
|
0
|
1082
|
POST
|
right now i 'm just trying to do a delete, naming convention and everything else will follow 😉
... View more
09-14-2016
08:03 AM
|
1
|
2
|
1082
|
POST
|
I don't have a shapefile or geodatabase right now available to me, i cannot test that. i did test the old arcpy.updatecursor, see my question for the result
... View more
09-14-2016
08:02 AM
|
0
|
3
|
1082
|
POST
|
I'm trying to replicate this code (both delete) in python, my previous question is related to this arcpy 10.3.1 being used with proper license using coverage files display 0
arcedit
&if [show program] ne ARCEDIT &then &do /*IF1
&type ERROR: The Arcedit module could not be invoked
&setvar run_status := -1002
&return
&end /*IF1
/*** Remove non-topological lines
/*
graphics off
edit %path_poly_cover%
editfeature line
select line_type in {%valid_line_type_list%}
nselect
&if [show number select] gt 0 &then &do /*IF1
delete
&end /*IF1
/*** Remove non-topological points
/*
editfeature point
select pnt_type in {%valid_pnt_type_list%}
nselect
&if [show number select] gt 0 &then &do /*IF1
delete
&end /*IF1
save
removeedit %path_poly_cover% yes
/*** Return to the arc module
/*
&if [show program] eq ARCEDIT &then &do /*IF1
removeedit all yes
quit yes
&end /*IF1
... View more
09-14-2016
07:15 AM
|
0
|
4
|
2081
|
POST
|
thanks, i was looking for that but didn't know it was under highlighting. updated
... View more
09-14-2016
04:34 AM
|
0
|
0
|
1082
|
POST
|
I'm trying to delete a row from a coverage I'm using arcpy 10.3.1 the code that i am using is (to be able to reproduce the issue) import arcpy
def count_row(data):
i = 0
for row in data:
i += 1
data.reset()
return i
arcpy.env.workspace = 'C:/Data/cea01apr'
feature = 'point'
fidfilter= 'fid = 1'
featureClassList = arcpy.ListFeatureClasses()
fieldList = arcpy.ListFields(feature)
fieldString = [str(x.name) for x in fieldList]
with arcpy.da.UpdateCursor(feature, fieldString, fidfilter) as cursorupdate:
print('Number of rows:' + str(count_row(cursorupdate)))
rowupdate = cursorupdate.next()
print(rowupdate[12])
rowupdate[12] += 'h'
cursorupdate.updateRow(rowupdate)
with arcpy.da.SearchCursor(feature, fieldString, fidfilter) as cursorupdate:
print('Number of rows:' + str(count_row(cursorupdate)))
rowupdate = cursorupdate.next()
if rowupdate:
print(rowupdate[12])
with arcpy.da.UpdateCursor(feature, fieldString, fidfilter) as cursorupdate1:
print('Number of rows:' + str(count_row(cursorupdate1)))
for row in cursorupdate1:
cursorupdate1.deleteRow()
raw_input('Press the <ENTER> key to exit') the output of that script is C:\Data>test.py
Number of rows:1
hhhhhhhhhhhhhhhh
Number of rows:1
hhhhhhhhhhhhhhhhh
Number of rows:1
Traceback (most recent call last):
File "C:\Data\test.py", line 39, in <module>
cursorupdate1.deleteRow()
SystemError: error return without exception set I have tried this arcpy.MakeTableView_management(feature, 'test')
arcpy.SelectLayerByAttribute_management('test', 'NEW_SELECTION', fidfilter)
arcpy.DeleteRows_management('test') and i'm getting this error Traceback (most recent call last):
File "C:\Data\test.py", line 41, in <module>
arcpy.DeleteRows_management('test')
File "C:\***\cots\ArcGIS\Desktop10.3\ArcPy\arcpy\management.py", line 15352, in DeleteRows
raise e
arcgisscripting.ExecuteError: ERROR 999999: Error executing function.
Failed to execute (DeleteRows). trying the old arcpy.UpdateCursor cursorupdate2 = arcpy.UpdateCursor(feature)
#print('Number of rows:' + str(count_row(cursorupdate2)))
row = cursorupdate2.next()
print('delete')
cursorupdate2.deleteRow(row) will result into C:\Data>test.py
ArcInfo
Number of rows:1
hhhhhhhhhhhhhhhhhhhh
Number of rows:1
hhhhhhhhhhhhhhhhhhhhh
delete
Traceback (most recent call last):
File "C:\Data\test.py", line 56, in <module>
cursorupdate2.deleteRow(row)
File "C:\***\cots\ArcGIS\Desktop10.3\ArcPy\arcpy\arcobjects\arcobjects.py", line 110, in deleteRow
return convertArcObjectToPythonObject(self._arc_object.DeleteRow(*gp_fixargs(args)))
RuntimeError: ERROR 999999: Error executing function. uncommenting the line for the number of rows will actually crash python.exe
... View more
09-13-2016
09:32 AM
|
0
|
11
|
3069
|
Title | Kudos | Posted |
---|---|---|
1 | 09-14-2016 08:03 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|