I'm trying to build a tool in ModelBuilder to analyze where trips take place in relation to buffer zones. It takes as inputs an old buffer zone, a new buffer zone, and a set of trip data. The trip data is a geodatabase table that has a set of lat/lon for the pickup, another for a dropoff, and a trip ID to link the two. I'm trying to identify trips where the pickup and drop off both fall inside a buffer (then I'm comparing the old to the new).
To do this I'm generating XY events for the pickups, XY events for the dropoffs, filtering each to select the ones that fall inside the buffer, then using an Add Join to find the trips where both of them fall in the buffer.
The problem I'm facing is that when I just use layers, the results are wrong. I get a whole bunch of trips that have dropoffs outside of the buffer. When I add an additional step of converting the dropoffs in the buffer to a feature class and then performing the Add join, it works exactly as I expect. The only downside is that these feature classes are getting saved to the geodatabase and I have to clean that up. I thought the problem with the feature layers might be some kind of unintended run time reuse of layers, so I tried creating extra XY events to compensate but that didn't fix the problem.
What am I not understanding about the difference between feature layers and feature classes that is causing my models not to work?
Here is the version of the model that only uses feature layers. The add join is not filtering properly. Somehow dropoffs that are outside of the buffer zones are being included in the join, despite the Select Layer by Location tool.
Here is the version of the model that exports the filtered dropoffs to feature classes and works exactly as expected.