I have a file geodatabase on my local computer. I want to update the value in one field of a feature class in that FGDB with the value found in an enterprise SDE.
I know I can use a da.SearchCursor to grab the field and a key column to tie it back to the correct feature. And I'm probably going to use da.UpdateCursor to update the FGDB. My question, once I have a list or dictionary of tuples from ESDE, how do I tell the update cursor to actually perform the update? How do I tell the update cursor to look through this list, check the key, and insert the updated value into the updateCursor?
I might be overthinking this but here's one possible solution: 1. Use the SearchCursor to grab the two values: the ID of the row, and the value that will update the FGDB. 2. Use an UpdateCursor with the same two field. Loop over the results of the UC, compare the ID of the row for match, insert the updated value into the other field. 3. Commit the update.
Is there a better way?
أكثر...
I know I can use a da.SearchCursor to grab the field and a key column to tie it back to the correct feature. And I'm probably going to use da.UpdateCursor to update the FGDB. My question, once I have a list or dictionary of tuples from ESDE, how do I tell the update cursor to actually perform the update? How do I tell the update cursor to look through this list, check the key, and insert the updated value into the updateCursor?
I might be overthinking this but here's one possible solution: 1. Use the SearchCursor to grab the two values: the ID of the row, and the value that will update the FGDB. 2. Use an UpdateCursor with the same two field. Loop over the results of the UC, compare the ID of the row for match, insert the updated value into the other field. 3. Commit the update.
Is there a better way?
أكثر...