Spatial Join Tool

396
15
04-11-2012 09:46 AM
ABDALLAMOHAMED
Occasional Contributor
hello.. I have  regular points in a shapefile, with 30 feet apart from each other. I wanted to spatially join these points with my geocoded grocery stores shapefile to find out how many grocery stores in 500 meters threshold from these points. That is, I wanted to count the number of grocery stores within 500 meters from each point..I used the spatial join tool between these points and grocery stores, but I couldn't get it to tell the exact number of stores wihin the limit of 500 meters.Any help? Appreciated.
0 Kudos
15 Replies
DanLee
by Esri Regular Contributor
Esri Regular Contributor
If you use the default Join Operation, the output should contain a field, Join_Count, which tells you how many are found/matched.

If you use the JOIN_ONE_TO_MANY option, the output will contain multiple records for the same point, one for each match found. You can then use the Frequency tool (Analysis toolbox - Statistics toolset) with the target point features FID field as the Frequency Field. The resulting table contains the count for each unique FID.
0 Kudos
ABDALLAMOHAMED
Occasional Contributor
Dan..It works fine and I got the count of my stores..Now the question is how  to map this table. I wanted to map it so that I can see the number of stores on the map..
Any Hint..Appreciated..
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
You can read about Labels in Layer Properties:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s500000031000000.htm

Right-click a layer and choose "Properties...";
Click Labels tab, check the box "Label features in this layer"; select your Join_Count field from the field list.
Set the color, font, etc.; then press OK.

You should see the count numbers by your points.
0 Kudos
ABDALLAMOHAMED
Occasional Contributor
There is no Label tab when I right click on the layer and choose property..I think because the table is An Info table. I was trying to convert it to a shapefile or something but I couldn't..Thanks.
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
I thought you used my first suggestion and got the Join_Count field. Did you try this?

If you used my second suggestion - using Frequency tool, you can try Join Field to join your points with the frequency table by the common field, the point FID. Now you should have a point feature class with the count (from Frequency output).
0 Kudos
ABDALLAMOHAMED
Occasional Contributor
Yes, i tried your first suggestion but didn't work like the second suggestion, that is, use One-to-many option. This one works find and then I used the frequency too and I got the count of store with each ID. The problem the frequency tool output is Info table, not shapefile, that is why it is hard to map it...
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Could you describe why or how using JOIN_ONE_TO_ONE didn't work for you? Did you get an output? Did the output have a field named Join_Count?

About the frequency output table, I understand it is a table, no features. I suggested that you try Join Field tool (Data Management toolbox - Joins toolset). You should specify the following:

Input Table - specify your points (the shapefile)
Input Join Field - Select FID
Join Table - specify the output table of Frequency
Output Join Field - select the FID field
Join Fields (optional) - check the box labeled FREQUENCY

Click OK to run the Join Field tool. This process transfers the FREQUENCY field from the output table of Frequency to the point shapefile. You can now right-click the point layer, go to the Layer Properties - Labels to label the FREQUENCY field; this is the count you wanted. Does it work?
0 Kudos
JoannaMerson
New Contributor
If you use the default Join Operation, the output should contain a field, Join_Count, which tells you how many are found/matched.

If you use the JOIN_ONE_TO_MANY option, the output will contain multiple records for the same point, one for each match found. You can then use the Frequency tool (Analysis toolbox - Statistics toolset) with the target point features FID field as the Frequency Field. The resulting table contains the count for each unique FID.


Dan,

For a one-to-many spatial join, we can right-click on the target layer in the TOC, set up the spatial join, and receive an output Join_Count for the closest points. One tool: goal accomplished.

Yet, from the spatial analysis toolbox we have to run a Spatial Join, then Frequency, then join the frequency table to the target layer.  This is a complicated process for something that can already be accomplished by arcMap in one tool.

Am I missing something? I'd really like to incorporate this process into a model, and thus am curious how I can make the spatial join toolbox tool work like the TOC spatial join.

Thanks,
Joanna
0 Kudos
ABDALLAMOHAMED
Occasional Contributor
Could you describe why or how using JOIN_ONE_TO_ONE didn't work for you? Did you get an output? Did the output have a field named Join_Count?

About the frequency output table, I understand it is a table, no features. I suggested that you try Join Field tool (Data Management toolbox - Joins toolset). You should specify the following:

Input Table - specify your points (the shapefile)
Input Join Field - Select FID
Join Table - specify the output table of Frequency
Output Join Field - select the FID field
Join Fields (optional) - check the box labeled FREQUENCY

Click OK to run the Join Field tool. This process transfers the FREQUENCY field from the output table of Frequency to the point shapefile. You can now right-click the point layer, go to the Layer Properties - Labels to label the FREQUENCY field; this is the count you wanted. Does it work?


Dan..Sorry It took me long time to reply to your post. It has been crazy week already. As to your question why using join_one_to_One didn't work, it is beacuse it won't let me specify my 500 meters distance to the nearest grocery store. That is why I used your second suggestion ( One_to_Many option). I followed your steps strictly, but unfortunately I didn't get what I wanted, that is, the number of grocery stores within this 500 meters. The join_count field has 1's only for the entire area records (25583 records). I don't think this is true because I have only 276 grocery stores. The frequency field has just one field with the value of 2 and the rest is zeros. I thought  the spatial join tool would give me the total number of grocery stores for each 500 meters distance. But so far I didn't. Any tips, appreciated.
0 Kudos