I am curious to know if anyone can shed some light on the difference between ArcGIS' Spatial Join geoprocessing tool (found in Analysis -> Overlay toolbox) and the Spatial Join 'wizard' (found by right-clicking a layer -> Join -> then selecting "Join data from another layer based on spatial location" from the first drop-down).
There have been multiple times where the tool has worked and the other has failed and vice versa, especially when using ModelBuilder and Python.
-
Interesting. Could you give a little more information about the 'failure' happens? Paste an error code?Simbamangu– Simbamangu2013年09月12日 15:02:36 +00:00Commented Sep 12, 2013 at 15:02
-
@Simbamangu, sorry I do not have a specific error code on hand, this was meant as more general question since I've ran into this problem repeatedly. Next time it happens I'll be sure to post it. In the mean time I hope to hear from anyone else who can help elucidate...mikeLdub– mikeLdub2013年09月12日 15:08:13 +00:00Commented Sep 12, 2013 at 15:08
2 Answers 2
I've observed this behavior, too. In my particular situation, I wanted to Join a shapefile of buffered lines with another shapefile of lines, keeping all of the latter lines that fall completely inside the former buffers, and joining the information in the buffers with these discovered circumscribed lines.
The process for the wizard is
- Right-clicking the shapefile of lines
- Choosing Joins and Relates -> Join.....
- Selecting "Join data from another layer based on spatial location"
- Selecting the layer of buffer shapes
- Select "Each line will be given all of the attributes of the polygon that......" and select "it falls completely inside."
The same process in Python code would be:
arcpy.SpatialJoin_analysis (line_layer_file, buffer_layer_file, output_file, "JOIN_ONE_TO_ONE", "#", "#", "COMPLETELY_WITHIN")
Whether I run the Python version as python code or in the model builder, I get the same results . . . both of which contain seemingly random entries! There are entries included that are definitely NOT completely within the buffer. They overlap the buffer, but are not completely within it. And in fact, other lines that lie completely within the buffer can be overlooked in favor of one that only intersects/overlaps the buffer. This erroneous performance is corrected when using the wizard.
I know I remember finding a post, either in this forum or another, that this occurrence is a known issue. But I cannot find it now.
PS. There is no error message for me--both run to completion--but the results are incorrect.
-
2Here it is, in the bug list: support.esri.com/en/bugs/nimbus/TklNMDg2MjI4Bradley Mecham– Bradley Mecham2013年12月13日 19:03:24 +00:00Commented Dec 13, 2013 at 19:03
-
you'd think they'd bump it up a bit from low :(dassouki– dassouki2014年09月10日 16:40:53 +00:00Commented Sep 10, 2014 at 16:40
I thought that Spatial join in overlay toolbox is used to join spatial locations, whilst the one in layer is mainly used to join attributes from the table. Am I missing something?
Explore related questions
See similar questions with these tags.