Longitude Crossing Detector

Hello everyone,
I am sorry if this question seems silly, but I was trying to use the Longitude Crossing Detector and I could not figure out one thing.
In the description of the detector is said " If eastwards and westwards crossing have to be distinguished, the velocity direction has to be checked instead of looking at the increasing flag." In this case which velocity should I consider to determine if the crossing happens eastwards or westwards? In which reference Frame?
And moreover, why is not enough to check the inclination of the orbit to determine the kind of crossing it is happening?
Thank you very much for the help.

You should look at the velocity in Earth frame, as it will give a relative motion with respect to Earth.

Inclination is not enough because spacecraft angular velocity may be smaller than Earth velocity. Consider for example a Geostationary Transfer Orbit, which is highly elliptical with a perigee at a few hundred kilometer altitude an apogee at geostationary altitude and an inclination of a few degrees. When the satellite is near perigee, it goes Eastwards very fast but as it gains altitude, at one point the projection of its angular velocity along the East/West line will drop to zero: the satellite will be at a longitude local extremum and after that it will drift Westwards because it will continue to gain altitude (it is not yet at apogee) and hence will slow down, whereas Earth rotation is still the same. Then the satellite reaches apogee, crosses it, and its altitude reduces. It gains velocity, until it reaches again the same velocity as Earth, and will reach another longitude local extremum. Then it will continue to gain velocity, will therefore becomes faster than Earth and will start to drift Eastwards again. This creates the classical ā€˜Sā€™ shaped ground track around apogee of GTO. So despite inclination is always the same (a few degrees), the drift direction Eastwards or Westwards changes because the orbit has high eccentricity.