Why did the flight Osaka -> Frankfurt circle above the airport after taking off from Osaka International? When departing form Osaka International (KIX) the Osaka city passed below twice, the second time much lower. Looks like our 747-400 was circling up in spiral before heading a long way over Russia to Europe.

I understand the reason of flying in circles before landing (holding pattern, waiting in a queue for landing). But why circle over the airport of departure? I think it could be more economical and faster to pick the altitude while heading in a needed direction. Is there also a queue to leave the airport? Why not to wait on the ground then?

If was the flight LH741 (Osaka - Frankfurt), departing 24.10.2017, 10:00 from Terminal 1.
Looking at FlightAware, we see this takeoff for your flight:



Examining some airport charts for KIX, this looks like the standard departure NANKO REVERSAL THREE DEPARTURE from runway 06R.



I guess that the loop is to give the aircraft enough time to climb to 8000 before it reaches NANKO. And, I guess the 8000 feet is for either terrain or noise abatement (notice the climbing loop is entirely over water.)