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.

Any Ideas how this might work faster? Spatial Join with Interate Row Selection

  • 1
    Do you have advanced license? If so, you can use Generate Near Table, say, for 50 nearest features. Join the output table with the tables of the input layers based on "IN_FID" and "NEAR_FID". Now in the table you have the elevation info of gullies and manholes. Make a query for the heights and delete the rows that don't fulfill the condition. For the rest of the table, you want to delete the rows which are not the minimum distance. Use summary statistics (type=min and case field =IN_FID). Join the near table with the statistics table matching near_dist with min and keep only matching records – kowalski Feb 27 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.