Updating point geometry based on geometry of another feature class using arcgisscript

المشرف العام

Administrator
طاقم الإدارة
I'm looking to update the point geometry of lets say "oldFC" by obtaining the shape geometry of "newFC" and applying that to the "oldFC". I also want it to grab the value in the ID field in "newFC"and use that to search for the same ID in "oldFC" and then set the shape value.

I believe I have the loop set up and it appears to be grabbing the ID just fine but it doesn't update the shape geometry.

I'm very much a beginner with using Python so my code is rough.

Here's the code snippet... running 9.3 (no access to 10):

rows = gp.SearchCursor(newFC):row = rows.next()gp.MakeFeatureLayer_management(oldFC, oldLayer, "")gp.MakeFeatureLayer_management(newFC, newLayer, "")while row:newgeo = row.getValue("Shape")newID = row.getValue("ID")print newgeoprint newIDwhere = "ID" + '= ' + str(newID) #my sql expressionprint wherenew_rows = gp.UpdateCursor(oldFC, where)new_row = rows.next()while new_row: new_row.setValue("Shape", newgeo) new_rows.UpdateRow(new_row) new_row = new_rows.next()row = rows.next()

أكثر...
 
أعلى