Skip to main content

Timeline for update cursor based on location

Current License: CC BY-SA 3.0

13 events
when toggle format what by license comment
Dec 7, 2015 at 17:32 answer added david_p timeline score: 1
Dec 7, 2015 at 17:00 answer added oddpodm timeline score: 1
Dec 7, 2015 at 16:25 comment added Vince Heh. Nevermind. I'm always using the database for this sort of operation (simple UPDATE SQL), so I don't bother much with Desktop. Given the joined table (specifically, the row-ids of the joined tables), calculating from one related column to another shouldn't be difficult.
Dec 7, 2015 at 16:24 comment added Richard Fairhurst You need to configure the options of the Spatial Join so that you preserve the FID of the points in the output feature class, since the points have the field you want to fill in. Generally that means the points are the target and the polygons are the join features. Then do a standard attribute Join of the original points ObjectID to the FID value field in the Spatial Join and use the field calculator to transfer the values in the region field to the original points.
Dec 7, 2015 at 16:18 comment added oddpodm I think you are referring to the spatial join by right-clicking on the layer in ArcMap Desktop. But I need a script that's why it's not a solution.
Dec 7, 2015 at 16:01 comment added oddpodm From ESRI help: SpatialJoin_analysis (target_features, join_features, out_feature_class,...) out_feature class: A new feature class containing the attributes of the target and join features. (desktop.arcgis.com/en/desktop/latest/tools/analysis-toolbox/…) Is there something I'm missing?
Dec 7, 2015 at 15:36 comment added Vince Spatial join does not create a new feature class, just a dynamically joined layer. The Identity tool creates a new feature class.
Dec 7, 2015 at 15:06 comment added oddpodm To be precise I don't mind to create an additional feature class as intermediate result but then would need to know how to use that layer to update my initial cities layer
Dec 7, 2015 at 14:34 comment added oddpodm Well if I use the spatial join in a script I create a new feature class as output which is precisely what I don't want.
Dec 7, 2015 at 14:31 history edited Vince CC BY-SA 3.0
no such thing as "an SDE"
Dec 7, 2015 at 14:31 comment added Vince There are several possible approaches to solving this, but your question (the title, at least) focuses on the hardest potential route (cursors) while stating that you know about the easiest (spatial join). Have you tried using the field calculator through a spatial join? What specific problem have you encountered?
Dec 7, 2015 at 14:25 history edited Vince CC BY-SA 3.0
Removed closing
Dec 7, 2015 at 14:22 history asked oddpodm CC BY-SA 3.0