I'm doing a spatial join with attribute matching between 2 point feature classes (schools and 911 address points) to verify that schools have the correct address. I set up a 1-1 join with closest match option, and set school address field and 911 address field as my match fields.
I have a case where a school point and an address point are coincident, but the school address for that point does not match the 911 address. My hope was to flag cases like this so I can correct the school address to match 911 points. However, the spatial join tool matched the school point to another 911 point feature 2 miles away in a different town, because it shared the same (incorrect) address that I had for the school. If I do a straight-up spatial join without attribute matching, it joins the school to the coincident 911 address point.
Maybe I'm misunderstanding how the tool works. I'm assuming that in a Spatial Join, the spatial relationship should be the important bit (i.e. closest point), and then if the specified attributes match candidates for that spatial relationship, the feature is joined to the target. If the spatially closest feature doesn't have matching attributes based on the join and target fields, it seems like it just shouldn't join. Then you can search for null values and see why it doesn't match. According to ArcGIS Pro documentation,
The Matching Attributes parameter filters the features that will be matched by the spatial relationship specified in the Match Option parameter. Specify fields from the join and target features that must have matching attributes in addition to their spatial relationship.
Also, that's how it's described in the InProductPlan post of https://community.esri.com/t5/arcgis-pro-ideas/spatial-join-by-attribute-match-fields/idi-p/1185961
and the Blog that's referenced there. Does anyone know how exactly the tool works when you use Attribute Matching?
My school dataset is relatively small, so for this situation I can get around it by doing just a spatial join to closest, then in the resulting attribute table finding cases where the addresses don't match. But I have another larger project where this functionality would be very helpful if it works correctly and I can trust the results. Any insights would be appreciated.
Yes I think the doc could be worded more explicitly.
You want the join to take place only if it is the single Closest Point of all other points (matching attributes or not), AND the attributes match?
not:
The Closest Point from a selection of attribute-matched points (even if not the Closest point of all inputs).
It makes sense to me for the latter, which is what the tool is undoubtedly doing. The set of use-cases for the first seems much much smaller (imho at-least).
You could set the Search Radius parameter to limit the search distance or from what you describe as your objective you can simply:
Do a normal Spatial Join (closest) with no attribute matching. Then you have a layer which has the spatially closest record (attributes matching or not).
You will then have the attribute appended from that Closest point. I think it's only then an exercise to find rows where the 2 attribute columns do not match. Perhaps simply done with a Select by Attribute where 'Field1 <> 'Field2'
Hey there, maybe this helps you...
In Spatial Join, Attribute Matching makes ArcGIS Pro skip the nearest feature if the fields don’t match, and it will join to a farther feature instead. If you want to find mismatches, just do a normal Spatial Join (Closest) and then compare the fields after the join.