Skip to main content
edited body; edited title; deleted 15 characters in body; edited tags
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How to delete Deleting row in arcpyusing ArcPy cursor?

I am new to python arcpyArcPy. I am trying to delete identical points in feature class. the code is below:

>>> import arcpy
>>> fp=r"D:\NOCAS\TEMP\Belgum transistion.gdb\transistion\CenterlinePoints"
>>> sc=arcpy.da.SearchCursor(fp,["oid@","shape@"])
>>> dictionary={}
>>> for data in sc:
...     dictionary[data[0]]=data[1]
...     
>>> uc=arcpy.da.UpdateCursor(fp,["oid@","shape@"])
>>> for row in uc:
...     for r in dictionary:

...         if row[0]!=r:

...             if sd[r].equals(row[1]):

...                 uc.deleteRow()

when trying to run the code it delete one point out five identical points and arcmap shutdowned. thanks.

How to delete row in arcpy?

I am new to python arcpy. I am trying to delete identical points in feature class. the code is below:

>>> import arcpy
>>> fp=r"D:\NOCAS\TEMP\Belgum transistion.gdb\transistion\CenterlinePoints"
>>> sc=arcpy.da.SearchCursor(fp,["oid@","shape@"])
>>> dictionary={}
>>> for data in sc:
...     dictionary[data[0]]=data[1]
...     
>>> uc=arcpy.da.UpdateCursor(fp,["oid@","shape@"])
>>> for row in uc:
...     for r in dictionary:

...         if row[0]!=r:

...             if sd[r].equals(row[1]):

...                 uc.deleteRow()

when trying to run the code it delete one point out five identical points and arcmap shutdowned. thanks.

Deleting row using ArcPy cursor?

I am new to python ArcPy. I am trying to delete identical points in feature class. the code is below:

>>> import arcpy
>>> fp=r"D:\NOCAS\TEMP\Belgum transistion.gdb\transistion\CenterlinePoints"
>>> sc=arcpy.da.SearchCursor(fp,["oid@","shape@"])
>>> dictionary={}
>>> for data in sc:
...     dictionary[data[0]]=data[1]
...     
>>> uc=arcpy.da.UpdateCursor(fp,["oid@","shape@"])
>>> for row in uc:
...     for r in dictionary:

...         if row[0]!=r:

...             if sd[r].equals(row[1]):

...                 uc.deleteRow()

when trying to run the code it delete one point out five identical points and arcmap shutdowned.

Source Link

How to delete row in arcpy?

I am new to python arcpy. I am trying to delete identical points in feature class. the code is below:

>>> import arcpy
>>> fp=r"D:\NOCAS\TEMP\Belgum transistion.gdb\transistion\CenterlinePoints"
>>> sc=arcpy.da.SearchCursor(fp,["oid@","shape@"])
>>> dictionary={}
>>> for data in sc:
...     dictionary[data[0]]=data[1]
...     
>>> uc=arcpy.da.UpdateCursor(fp,["oid@","shape@"])
>>> for row in uc:
...     for r in dictionary:

...         if row[0]!=r:

...             if sd[r].equals(row[1]):

...                 uc.deleteRow()

when trying to run the code it delete one point out five identical points and arcmap shutdowned. thanks.