Jump to content

Calculating Flight Paths


PyraX

Recommended Posts

Hey everyone,

 

Im writing some code that has to work out a route based on linking airports and output all the flights it takes to get there, tried searching just dont really know what to search for

 

The data table looks like this

 

ID, Origin, Destination, DatetimeDeparting, DatetimeArriving, Price

1, BKK, CNX, 2010-10-14 12:00:00, 2010-10-14 14:00:00, 125

2, STN, BKK, 2010-10-13 18:00:00, 2010-10-13 22:00:00, 300

etc.

 

What is the easiest way of working out the path from STN to CNX via BKK?

 

UPDATE: Just to make it more interesting there will be instances where there is more than 1 path eg. STN -> KUL -> BKK -> CNX

Link to comment
https://forums.phpfreaks.com/topic/215608-calculating-flight-paths/
Share on other sites

First you need to define where these places are, most likely by assigning each a longitude and latitude value. Then based on those values you'll need to use some advanced mathematics to work out the distance, position, etc. from one another. Then perhaps the GD library to create a visual display of the route, based on the figures you calculated. The Google Maps API may make things easier for you here though..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.