In the British Airways incident last week I traveled with a stop at Heathrow, and (unsurprisingly) the second flight was delayed with more than 3 hours. The second flight itself was under 1500km, the whole travel was above. Which category of compensation can I apply for?
The Landshut Regional Court [...] ruling that the decisive factor determining compensation is the immediate distance between the point of departure of the delayed flight [...] and the passenger's final destination [...].
I believe that's quite clear. Note this is the second level (of four) in German courts and it agreed with the decision of the first level. It is possible both courts interpreted the EU legislation wrong but in such a basic case this is extremely unlikely. This site offers a comment as well:
The court also pointed out that the airport from which the delayed flight departs is the point of reference. This means that in cases where a passenger has made a booking consisting of three flight segments and the delay occurs on the second stopover, the relevant departure point would be the first stopover rather than the airport of departure of the first flight segment.
Obviously the comment is not legal advice and I must emphasize my post is not that either. Nonetheless it's a valuable comment.
Original court decision in German.
One important point from it -- I ran it through Google Translate:
Whereas, therefore, the level of compensatory payments is less proportional to the inconvenience of the passengers; On the contrary, the booking behavior of the airlines is to be influenced - in the interest of consumers.
So the argument presented by @m7e (which on the surface does make a lot of sense, I would make it too):
I started from A arriving to B, I was late, I want compensation from A to B
is apparently not valid legally.