{"id":3618,"date":"2022-08-11T10:38:04","date_gmt":"2022-08-10T22:38:04","guid":{"rendered":"http:\/\/blogs.lincoln.ac.nz\/gis\/?p=3618"},"modified":"2022-08-11T10:38:04","modified_gmt":"2022-08-10T22:38:04","slug":"spatial-join-the-tool-you-need","status":"publish","type":"post","link":"https:\/\/blogs.lincoln.ac.nz\/gis\/spatial-join-the-tool-you-need\/","title":{"rendered":"Spatial join- the tool you need"},"content":{"rendered":"<p><em>Ruby gives us some more insight into the Spatial Join tool.<\/em><\/p>\n<p>Spatial join: the tool you didn\u2019t know you need (but it\u2019s exactly what you\u2019re are looking for).<\/p>\n<p>When I was completing my final project, I found that I had multiple layers with a heap of data on each, but I couldn\u2019t 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.<\/p>\n<p>The two images below show what fields I have in each and what the layer looks like.<\/p>\n<p id=\"yui_3_17_2_1_1636579177970_50\"><img decoding=\"async\" src=\"https:\/\/learn.lincoln.ac.nz\/pluginfile.php\/1\/blog\/post\/67\/image.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/learn.lincoln.ac.nz\/pluginfile.php\/1\/blog\/post\/67\/image%20%281%29.png\" alt=\"\" \/><\/p>\n<p>So here we are: ArcGIS Pro <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/analysis\/spatial-join.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Spatial Join<\/a> tool.<\/p>\n<p>Spatial join is a tool that attaches data from one layer&#8217;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\u00a0\u00a0table.\u00a0\u00a0For 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.<\/p>\n<p>There are two places to find this handy tool. The first is from within the Analysis ribbon; open your tool box and search \u201cspatial join\u201d from within the geoprocessing window that pops up.<\/p>\n<p>Alternatively, if you right click on the layer name from the contents pane and either click or hover over \u201cjoins and relates\u201d and select \u201cspatial join\u201d.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/learn.lincoln.ac.nz\/pluginfile.php\/1\/blog\/post\/67\/image%20%282%29.png\" alt=\"\" \/><\/p>\n<p>The tool window that opens from both is identical with 3 parameter fields that you need to enter either a file name.\u00a0<strong>Target features<\/strong>\u00a0is the feature class you want things joined too.<\/p>\n<p><strong><img decoding=\"async\" src=\"https:\/\/learn.lincoln.ac.nz\/pluginfile.php\/1\/blog\/post\/67\/image%20%283%29.png\" alt=\"\" \/>Join Features<\/strong>\u00a0is a feature class that you are attaching to the previous layer-the T<strong>arget Feature<\/strong>\u00a0layer. Pick a handy name for you output and the location you would like it save too.<\/p>\n<p>Next up we have the <strong>J<\/strong><b>oin Operation<\/b>\u00a0drop down menu. Two options are given and what you use is really up to your data.\u00a0<u>Join one to one<\/u>\u00a0and\u00a0<u>join one to many<\/u>\u00a0are your options. What it\u2019s asking you is how many joins do you want per target feature. I have chosen\u00a0<u>join one to one<\/u>\u00a0as I want each vegetation line joined to one GPS point. If you have more data and have multiple data points in your J<b>oin Feature<\/b>\u00a0layer then maybe\u00a0<u>join one to many<\/u>\u00a0could be useful. This will create multiple T<b>arget Feature\u00a0<\/b>data points for each of your different J<b>oin Feature<\/b>.<\/p>\n<p>If you <strong>T<\/strong><b>arget Feature<\/b>\u00a0layer has all the data columns you want and you don\u2019t 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,\u00a0<a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/analysis\/spatial-join.htm\" target=\"_blank\" rel=\"noopener noreferrer\">click for more information that can help you decide.\u00a0<\/a><b>Search radius<\/b>\u00a0is another helpful option you have. If you select\u00a0<u>intersect<\/u>\u00a0\u00a0or\u00a0<u>within a distance<\/u>\u00a0option for\u00a0<b>match option<\/b>\u00a0then 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.\u00a0<img decoding=\"async\" src=\"https:\/\/learn.lincoln.ac.nz\/pluginfile.php\/1\/blog\/post\/67\/image%20%284%29.png\" alt=\"\" \/><\/p>\n<p>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.<\/p>\n<div class=\"mediaplugin mediaplugin_videojs d-block\">\n<div>\n<div id=\"id_videojs_618c3769ea4cc_1\" class=\"video-js vjs-paused vjs-fluid id_videojs_618c3769ea4cc_1-dimensions vjs-controls-enabled vjs-workinghover vjs-v7 vjs-user-active vjs-youtube\" lang=\"en\" title=\"I found a helpful video for you!\">\n<div>\u00a0If it\u2019s what you are after, then it\u2019s a job well done. Now you&#8217;re ready for you next step. Good luck!<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Ruby gives us some more insight into the Spatial Join tool. Spatial join: the tool you didn\u2019t know you need (but it\u2019s exactly what you\u2019re 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\u2019t really do much [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3618","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/3618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/comments?post=3618"}],"version-history":[{"count":0,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/3618\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media?parent=3618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/categories?post=3618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/tags?post=3618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}