Spatial Join Tool

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.

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.

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.

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).

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...

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?

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.

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.

The Analysis tool, Spatial Join, with JOIN_ONE_TO_ONE option should give you the the JOIN_COUNT field in the output. That is the one-step tool. If it doesn't give you the correct count, please share a sample data; we can investigate. What version of ArcGIS are you using?

ABDALLA,

Sorry about my delay; I was on vacation.

Using the JOIN_ONE_TO_ONE option, could you describe why "it won't let me specify my 500 meters distance to the nearest grocery store"? What happened when you specify 500 meters for the Search Radius? Did you give you any error message? I need more detail. Or if possible please share a sample data. Let me know what version of ArcGIS you are using. This should work; you really shouldn't need the workaround.

Dan..I'm using ArcMap 10. When I tried to assign my 500 meters, the only option I have is "Intersect", the other options "Within" and "Contain" are grayed (Not enabled). I do not think "Intersect" option is correct, I need to use either "within" or "contain" to find the number of grocery stores within 500 meters. I have a total of 176 grocery stores, and around 283,000 points that I wanted to join them spatially.

I assumed your stores are also points. So, even INTERSECT option should work. Can you specify 500m for INTERSECT to run the tool? Do you get the Join_Count? When you specify a Search Radius for INTERSECT, any features found within that distance are considered intersected.

What license level do you have for ArcGIS 10? Are you using any Service Pack of ArcGIS 10?

I assumed your stores are also points. So, even INTERSECT option should work. Can you specify 500m for INTERSECT to run the tool? Do you get the Join_Count? When you specify a Search Radius for INTERSECT, any features found within that distance are considered intersected.

What license level do you have for ArcGIS 10? Are you using any Service Pack of ArcGIS 10?

Dan..I really don't know what license level I have, and don't know if we have any service Pack. This is done by the IT department, and we are just endusers. However, this is a federal government computers and I assume they have the best level of license..As for my question, I have about 176 grovery stores, and about 25,583 points.. Both of them are points. I wanted to spatially join them together to find out how many grocery stores within the limit of 500 meters from each point..When I specified 500m for INTERESECT, the joint_count has a value of 1s (one) for all the 25,583 points..I beleive that is not correct, because I have only 176 stores. My understanding is that I should have something like the following:Point Id 1 has 2 grocery storespoint id 3 has 5 grocery storesand so on until the last store.This is just an example.Thanks!

I asked about the license level and SP because I thought that might be why some Match Options were greyed out. Now that you have confirmed that both inputs are points; that explains why the CONTAINS and WITHIN options are grayed out becasue they don't apply to points inputs. So, no worries about license level and SPs.

Did you run the tool with the following parameter settings? - Use your points (25,583 points) as Target Features and the stores (176 points) as the Join Features. - For Join Operation, use JOIN_ONE_TO_ONE. - Check the checkbox "Keep All Target Features". - For Match Option, use INTERSECT. - For Search Radius, enter 500 Meters.

If so, your output should have 25,583 points and the Join_Count field. - If the value of Join_Count for a point is 0, no store is found within 500m to the point. - If the value of Join_Count for a point is greater than 0, that number of stores are found within 500m to the point.

I am not sure why you said: "I beleive that is not correct, because I have only 176 stores". I don't think that you expect 176 records in the output, did you? You have 25,583 points in the output; some of them have found the same store.

You said: "the joint_count has a value of 1s (one) for all the 25,583 points". Can you share an image of your data where a point should find 2 or more stores?

Another thing to make sure: both of your inputs should be in the same coordinate system. You can check it by right-clicking the data - Properties - Coordinate System.