update attribute data based on spatial location

16881
17
03-02-2012 12:01 AM
DavidMcDermott
New Contributor
I have a large number of polygons. Each polygon has 1 or more points within. I would like to populate a field in the point data with data from a polygon field based on spatial location. I know I could use spatial join but I don't want a new feature, I just want to update the information in the point feature.

P.S. I this would work the other way would it would be great.
Tags (2)
0 Kudos
17 Replies
DavidMcDermott
New Contributor
jborgion - I certainly will when I get to work Monday Morning and I will inform you.

rfairhur24 - Thanks for the input, you solution has given me some great ideas to streamline the process and improve accuracy. I will try it Monday morning.
0 Kudos
JohnSandberg
New Contributor
I'm trying to do essentially the same thing - update multiple fields in an existing Feature Class with attributes from other Feature Classes, based on spatial relationships (overlay).  All without creating new output datasets.  Seems like this should be possible...any suggestions?
0 Kudos
RichardFairhurst
MVP Honored Contributor
I'm trying to do essentially the same thing - update multiple fields in an existing Feature Class with attributes from other Feature Classes, based on spatial relationships (overlay).  All without creating new output datasets.  Seems like this should be possible...any suggestions?


There are ways, but you either have to do it one record at a time (Attribute Transfer tool in an edit session) or you have to write a custom cursor pair in Python or ArcObjects, which normally performs much slower than the method I have outlined involving creating new output datasets.   Overall Geoprocessing tools are definitely oriented to creating new outputs and not to modifying existing outputs.  In ModelBuilder you do not have to retain the intermediate datasets if you don't want to (they will be cleaned up when the process finishes), but they still must be created at least temporarily.  If you manage to retain a link back to your original dataset through the process I outlined, you can join the output to your original input and calculate the results back to it, but that only works if the final output has a one-to-one relationship to your original input.

Creating and using relationships (spatial and attributes) is practically 90% of my work.  If anyone has a more direct route to acheiving the correct ends I am interested, but these processes have worked for me over the years and been the easiest for me to debug.
0 Kudos
DarrenWiens2
MVP Honored Contributor
Depending on the size of your datasets and amount of RAM available on your system, you could potentially save some time writing/deleting by taking advantage of the in-memory workspace.
0 Kudos
SamCoggins1
New Contributor III
If you want to join the polygon information to the points I have a Python script that will do that for you. Let me know.
0 Kudos
KathrynLeBlanc
New Contributor

Do you still have that script Sam? I have to do something similar and I don't know much about scripts

0 Kudos
DavidMcDermott
New Contributor
Hi,

Sorry for my absence. I went with rfairhur24 solution and it worked perfectly. With our new 64-bit PC's the process is very swift within modelbuilder. The in-memory option sounds very appealing not only for this model but other that I have built. I am currently looking to convert some of my tools into python scripts/tools to make them easier to share.

David
0 Kudos
LiseTremblay
New Contributor II

My strategy is to make sure there are unique ID's in the feature you want to update, even if you have to make a temp attribute. run an intersect. join the new feature to the old one using the unique ID and calculate the attribute based on the joined attribute that has the correct info cause it was intersected. For poly to poly intersects, I convert the one I need to update to a point first again... unique ID is the key.

0 Kudos