Point in Polygon Selection and Attribute Assignment

15406
4
05-02-2011 07:23 AM
TimHayes
Occasional Contributor III
I have 600 points overlain on a polygon layer of square grids (200 polygons). Each square grid polygon has a unique number (value) assigned to it. I need to select all the points and then assign them the value of the polygon they are located in. Is there a way to do this without having to manually do a point-in-polygon selection one by one for each of the 200 polygons?
Tags (2)
0 Kudos
4 Replies
TimothyHales
Esri Notable Contributor
A spatial join can assign the attributes of the polygon directly to the attribute table of the output point file.  Right click the point file and choose Joins and Relates > Join.  Select the option to join data from another layer based upon spatial location.  Choose the grid polygon layer and select the option to give the attributes of the polygon to the each point that falls inside.

Finding what is inside a polygon
deleted-user-dp61qRbKUaMp
New Contributor II
Any idea why this doesn't seem to work with the Spatial Join tool in the toolbox?  I'd like to script this, but can't seem to figure it out.

Basically, I have a bunch of points and a few polygons.  I just want to assign a value to a field in the point feature class based on the polygon the point happens to be within.  Spatial join appears to only join each target feature once?  Oddly, the JOIN_FID field is correct for all of the points, but I get no metadata from the polygon?!? (I just get a bunch of nulls)
0 Kudos
JoeBorgione
MVP Emeritus
Any idea why this doesn't seem to work with the Spatial Join tool in the toolbox?  I'd like to script this, but can't seem to figure it out.

Basically, I have a bunch of points and a few polygons.  I just want to assign a value to a field in the point feature class based on the polygon the point happens to be within.  Spatial join appears to only join each target feature once?  Oddly, the JOIN_FID field is correct for all of the points, but I get no metadata from the polygon?!? (I just get a bunch of nulls)


Not sure what you're after here.  I just joined a county wide feature class of mile markers (target) to a county wide feature class of city polygons (join features) and got my desired/expected results; a point feature class of all 231 mile marker locations,each with the appropriate city information attached to them. (Along with the attributes from the original point feature class.)  Also, what do you mean about 'metadata from the polygon'?
That should just about do it....
0 Kudos
DanMcCoy
Occasional Contributor III
Any idea why this doesn't seem to work with the Spatial Join tool in the toolbox?  I'd like to script this, but can't seem to figure it out.

Basically, I have a bunch of points and a few polygons.  I just want to assign a value to a field in the point feature class based on the polygon the point happens to be within.  Spatial join appears to only join each target feature once?  Oddly, the JOIN_FID field is correct for all of the points, but I get no metadata from the polygon?!? (I just get a bunch of nulls)


If you're on ArcGIS 10 SP4, you may be running into this issue...
Bug:  The Spatial Join tool produces NULL results for some fields/features on ArcGIS 10 SP4
http://support.esri.com/en/knowledgebase/techarticles/detail/40174
0 Kudos