update attribute data based on spatial location

16734
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
JoeBorgione
MVP Emeritus
How many is "a large number" ?  You could iterively select each polygon, perform a spatial selection of the points based on the selected polygon and update the point attributes accordingly.  I'm sure there is a way for Python to cursor through the same sort of process.
That should just about do it....
0 Kudos
DavidMcDermott
New Contributor
By large, I mean 3000 to 6000 hence why selecting each one is not an option. I am working with postcode centroids (points) inside postcode polygons. I create territories by entering delivery numbers into the polygons, then dissolving them based on that number. I then need to transfer the numbers to points inside the polygons. These points contain more detained address information which are then expored to a database. Thanks for the input though.
0 Kudos
TimothyHales
Esri Notable Contributor
This is a little out there, but you could convert you polygon to raster, and then use the Add Surface Information tool to add the raster values to the points.
0 Kudos
JoeBorgione
MVP Emeritus
By large, I mean 3000 to 6000 hence why selecting each one is not an option. I am working with postcode centroids (points) inside postcode polygons. I create territories by entering delivery numbers into the polygons, then dissolving them based on that number. I then need to transfer the numbers to points inside the polygons. These points contain more detained address information which are then expored to a database. Thanks for the input though.


Yep!  3K-6k qualifies as a large number!  Even if there was a common field to relate to, calculating the values you are after would be an arduous chore...  Maybe the spatial join option is looking better?

Best of luck with this.
That should just about do it....
0 Kudos
DavidMcDermott
New Contributor
Thales007 - Thank you for your input, unfortunately your solution would not work in this case. The information in each polygon (and therefore point) is amended on a weekly, sometimes daily basis. Converting it to raster would just mean more work.

jborgion - I have used a spatial join in the past but it creates a new feature which is not ideal (see above). However, I have given it some thought, and while I am no expert, I feel using modelbuilder to create a workflow would help speed things up. Tell me what you think:

Manually enter delivery information then - Dissolve feature based on delivery number > spatial join (SJ) polygons to points > Select points by location within dissolve feature (to speed things up) > join SJ feature to points based on postcode > field calculator data into relevant fields > Remove join > delete SJ feature.

I'm not even sure model builder can do that but I would like to think it can.
0 Kudos
JoeBorgione
MVP Emeritus
There is only one way to find out; try it...
That should just about do it....
0 Kudos
RichardFairhurst
MVP Honored Contributor
Thales007 - Thank you for your input, unfortunately your solution would not work in this case. The information in each polygon (and therefore point) is amended on a weekly, sometimes daily basis. Converting it to raster would just mean more work.

jborgion - I have used a spatial join in the past but it creates a new feature which is not ideal (see above). However, I have given it some thought, and while I am no expert, I feel using modelbuilder to create a workflow would help speed things up. Tell me what you think:

Manually enter delivery information then - Dissolve feature based on delivery number > spatial join (SJ) polygons to points > Select points by location within dissolve feature (to speed things up) > join SJ feature to points based on postcode > field calculator data into relevant fields > Remove join > delete SJ feature.

I'm not even sure model builder can do that but I would like to think it can.


Creating a temporary output in a model is a standard process, so the fact that you are using tools that create a new feature class that you ultimately want preserved in a permanent feature class is no reason to avoid using a tool.  My question is will every point you have only be located within a single Dissolved Polygon?  If so ModelBuilder definitely can definitely do the job.

If that is the case, you just need to use the JOIN ONE TO ONE option with the Spatial Join and make the Point the Target features and the Dissolved Polygons the Join Features.  That output will have a single record for each point with the attributes from the one matchin Dissolved Polyton.  You can perform a standard attribute join of the Spatial Join output to your points on the Point ObjectID to the Sparial Join Target_FID and do the data transfer.  The main trick in ModelBuilder is that you have to use the Create Feature Layer tool on the Point Feature Class first before you can do an attribute join of your points to the Spatial Join output.

Anyway, based on myu experience with doing most of my models based on this kind of workflow, here are the tools I would normally use:

Dissove - Dissolve the Polygons and make sure any attributes you need to transfer to the points are in the summary.

Spatial Join - Points are the Target feature and Dissolved polygons are the Join feature using the JOIN ONE TO ONE option.

Add Attribute Index - Index the TARGET_FID field in the Spatial Join Output to improve attribute join performance.

Create Featuer Layer - Create a feature Layer of the Points.

Join - perform an attribute Join of the Point Feature Layer (ObjectID) to the Spatial Join output (Target_FID).

(Optionally) Select By Attribute - Select where JOIN_FID > -1 if you only want to modify points that actually fell within a polygon or skip this step if you don;t care.

Field Calculator - Use this tool to transfer the information.  Use it as many times as you need to fill in all of the data derived from the Dissolved Polygons to the points.

Remove Join - Remove the Attribute Join

Delete - Delete the Spatial Join output.
CynthiaRoush2
New Contributor II

I'm not using models, but this answer pointed me to the procedure I needed to fill a field based on a spatial relationship with another feature class:  Spatial Join, Join that output to the original, Calculate Field, remove Join, delete Spatial Join output.  Thanks!

AndyMaracini
New Contributor

worked perfectly, I swear I had a mental block for this most basic GIS operation. 

0 Kudos