Spatial join with "IF" operator and "Closest" Match Option

1281
4
Jump to solution
07-13-2021 05:18 AM
Piet
by
New Contributor

Hey Everyone,

To add AdressIDs from a point feature layer to noise immission point features (Target, green points)), I need to spatially join immission points (IPs) to addresses (Join Features, red points). The adresses need to share an ID with the (IPs) and be the closest at the same time, because:

  • Joining based only the shared ID (building ID) will result in faulty joins, since several addressess can have the same ID if a building (blue) has more than one address.
  • Joining based only on the spatial relationship will result in faulty joins, since IPs might be closer to addressess of neighbouring buildings and vice versa.

So I need to combine both the spatial and attribute-based join. In this thread  I found the tool "Join Features (GeoAnalytics)" that seems perfect. But for some reason it does not allow for "closest" as match option. However the other options would, again, result in faulty joins. E.g. "Near" would assign multiple addresses (including different AdressIDs) to IPs with the same building ID but only the closest address (and its ID) is wanted.

I hope any of you can help me with that challenge. Thanks in advance!

0 Kudos
1 Solution

Accepted Solutions
curtvprice
MVP Esteemed Contributor

This is in the wrong forum but I'll give it a shot. I think you want to run these using selected sets, that is, select all the IPs and Red points with the same ID, run the spatial join, then choose the next ID, select, repeat. Tools ignore rows in the input layer that are not selected, so this should work fine.

This is pretty straightforward in ModelBuilder using an iterator and the Select Layer By Attribute tool.

View solution in original post

4 Replies
curtvprice
MVP Esteemed Contributor

This is in the wrong forum but I'll give it a shot. I think you want to run these using selected sets, that is, select all the IPs and Red points with the same ID, run the spatial join, then choose the next ID, select, repeat. Tools ignore rows in the input layer that are not selected, so this should work fine.

This is pretty straightforward in ModelBuilder using an iterator and the Select Layer By Attribute tool.

Piet
by
New Contributor

Thanks curtvpice! I build a model like you suggested and it runs smothely up until now. I hope ArcGIS doesnt crash. I collect the values at the end of the model to feed them into a merge as part of a major model. What was also really helpful was a similar answer I got on stackexchange: https://gis.stackexchange.com/questions/403834/spatial-join-with-if-operator-and-closest-match-optio...Unbenannt.JPG

 

curtvprice
MVP Esteemed Contributor

Thanks for including that link, Hornbydd is quite brilliant and appears to have time on his hands - what a great post!

0 Kudos
Angelia_Bisbee_pmg
New Contributor

How did you "collect the values".  I have a very similar workflow, but my model only exports the very last value in the loop, I need it to export and merge them all (1 at a time).

0 Kudos