AnsweredAssumed Answered

get geometry from row

Question asked by olivier57 on Jan 28, 2012
Latest reply on Jan 30, 2012 by olivier57
Hi

In  http://proceedings.esri.com/library/userconf/devsummit09/papers/pythonscriptingadvancedtechniques.pdf (slide 33), is see this example that I wanted to use :

fc = "F:/data/USCounties.shp"
sc = gp.searchcursor(fc)
row = sc.next()
while row:
  name = row.name + "_" + row.state
  feat = row.shape

but when I write

rows_arc = gp.SearchCursor(arc_layer)
desc_arc = gp.describe(arc_layer)
row_arc = rows_arc.Next()

while row_arc:
#    feat_arc=row_arc.getvalue(desc_arc.ShapeFieldName) # works, comments to try next line row_arc.shape
    feat_arc = row_arc.shape

I get the message

feat_arc = row_arc.shape
RuntimeError: Row: Field shape does not exist

Can someone explain ? I don't understand why my lines do not work when they appear to be the same as the example.

Thanks;

Olivier

Outcomes