I have two Point Feature Classes: the first contains manholes incl. the invert elevation the second file contains road gullies and their invert elevation. Both files have roughly 10,000 to 20,000 features.
Now I want to run a Spatial Join (ArcMap 10.5) to connect each road gully to the closest manhole that has an lower invert elevation than the gully. I'm familiar with Spatial Join, so getting the closest connection (2. Condition) is not a problem, but I'm not sure how to achieve that the connection is made to the manhole that is lower then the road gully (1. Condition).
Update: I think I might have found a solution, its super slow though. So what it does is Iterate through the rows of the Gullies, determine the Gully-Invert-Level (InvLvl) and use the InvLvl as condition to create a Feature Layer of the Manholes for Manholes that have an Invert Level < InvLvl (Expression: InvertLeve < %InvLvl%). Afterwards it simply does a Spatial Join (Closest) and saves each row as a feature. Based on the Collect Values Tool I merge those afterwards. I think the fact that each row gets saved separately makes this model pretty slow.