Spatial join- the tool you need
Ruby gives us some more insight into the Spatial Join tool.
Spatial join: the tool you didn’t know you need (but it’s exactly what you’re are looking for).
When I was completing my final project, I found that I had multiple layers with a heap of data on each, but I couldn’t really do much with them separate. On one layer I had my GPS points of where my birds had travelled and the date and time. What I needed for it to be useful, was a vegetation class for each of my GPS points so I could see what vegetation my birds were in at any given time.
The two images below show what fields I have in each and what the layer looks like.
So here we are: ArcGIS Pro Spatial Join tool.
Spatial join is a tool that attaches data from one layer’s attribute table onto another from a spatial perspective. In the process, another layer is created, in which you get a whole bunch more columns, leaving all the information you need for future analyses in single table. For me this was really useful. The data I desperately needed on my vegetation layer was now able to be fixed to my GPS points. Alongside my GPS points, was now the corresponding vegetation codes for where each of my GPS points were.
There are two places to find this handy tool. The first is from within the Analysis ribbon; open your tool box and search “spatial join” from within the geoprocessing window that pops up.
Alternatively, if you right click on the layer name from the contents pane and either click or hover over “joins and relates” and select “spatial join”.
The tool window that opens from both is identical with 3 parameter fields that you need to enter either a file name. Target features is the feature class you want things joined too.
Join Features is a feature class that you are attaching to the previous layer-the Target Feature layer. Pick a handy name for you output and the location you would like it save too.
Next up we have the Join Operation drop down menu. Two options are given and what you use is really up to your data. Join one to one and join one to many are your options. What it’s asking you is how many joins do you want per target feature. I have chosen join one to one as I want each vegetation line joined to one GPS point. If you have more data and have multiple data points in your Join Feature layer then maybe join one to many could be useful. This will create multiple Target Feature data points for each of your different Join Feature.
If you Target Feature layer has all the data columns you want and you don’t want to lose them, I suggest you check that box! Match option helps to organise and arrange how your data will be displayed in its rows. You have lots of options here, click for more information that can help you decide. Search radius is another helpful option you have. If you select intersect or within a distance option for match option then you can stipulate a cut off distance. When you have chosen all your fields, and in some cases it may be useful to have a play around, then hit run and check out your new attribute table for the layer.
Spatial join can be super useful to take the best bits from an attribute table across two different layers and weave them together into a new table.