Jump to content
The simFlight Network Forums

How to know that I'm in the runway?


Recommended Posts

Is there a way that the airplane is in a runway? I want to run a process when that condition is true.

FsPassangers is able to do it because they launch an audio file, so it should be possible, but how?

The only way I know is by using a database of runways, like those produced by my freeware "MakeRunways" program, and use the Latitude and Longitude of the aircraft to work it out from the latitudes and longitudes of the runway centres, with their lengths and widths to define the rectangle.

Alternatively I suppose it could be done by finding the correct AFD (Airport Facilities Data) BGL at the time, and analysing the runway data in that. But I would have thought that would take too long unless they've found where it might be in FS memory -- the latter would be neat. ;-)

If FSPassengers does it without a database or reading the AFD data "on the fly", then the author(s) must have found a different way. If they have I doubt they'd release the information. There are several interesting programs which do clever things like that -- FollowMe, for instance, is able to get the taxi routing which FSX ATC would direct traffic along and use it to route the FollowMe car.

Regards

Pete

Link to comment
Share on other sites

Ok, I understand it.

What do you think about this.

Searching that big db too frequently will bring a performance issue :?: , so maybe an approach will be, knowing the Icao of your current position. With this, the search in the DB will be very fast.

Now, how to get the icao? :? mmmm. Lets think about a default cessna 172. It has a GPS, and there is an option "Nearest" that gives the nearest airports, ndb, dme, etc. Looking at nearest airport, the one with 0nm will be the one I'm in (it is true if I'm in ground an obviously in an airport).

With that icao, look for the Latitude and Longitude of Rwys and calculate if the plane is in rwy.

The question is: where is that "nearest" information? :?

Link to comment
Share on other sites

Searching that big db too frequently will bring a performance issue :?: , so maybe an approach will be, knowing the Icao of your current position. With this, the search in the DB will be very fast.

Now, how to get the icao?The question is: where is that "nearest" information?

Yes, and it is a good question. If you find the answer please do let me know and I'll add it as an FSUIPC offset.

The only way I know at present is to use the latitude and longitude and a database, again.

If you do have to resort to a database, it would be best to do a little pre-processing when your program starts. Read in the list of runways and create your internal index of rectangles (i.e. compute the four corners) sort the rectangles into Latitude and Longitude order using, say, the most south (first criteria) and westward (second criteria) corner as the index. Then your search can be made quite efficient.

Regards

Pete

Link to comment
Share on other sites

Yes, and it is a good question. If you find the answer please do let me know and I'll add it as an FSUIPC offset.

I found this

http://www.fsdeveloper.com/wiki/index.php?title=GPS_Variables:_How_to_Access&diff=5800&oldid=5799

There is a section Nearest Airport Data that shows

NearestAirportCurrentLatitude

NearestAirportCurrentLongitude

maybe that shows something interesting.

Write now I'm not able to "look" at those variables because don't know nothing about simconnect. I will investigate what that page is talking about and let you know if find interesting.

Regards

Javier

Link to comment
Share on other sites

Searching that big db too frequently will bring a performance issue :?: , so maybe an approach will be, knowing the Icao of your current position. With this, the search in the DB will be very fast.

Now, how to get the icao?The question is: where is that "nearest" information?

Yes, and it is a good question. If you find the answer please do let me know and I'll add it as an FSUIPC offset.

I've found a way to do it through SimConnect for FSX and ESP. I can't do it for FS9 or before, but if you are using FSX, let me know. I plan on adding offsets giving ICAO, Latitude, Longitude and Altitude for the 6 airports nearest the user aircraft, in order 1st to 6th. Probably in an update tomorrow (Tuesday).

Regards

Pete

Link to comment
Share on other sites

Hi.

I may be missing the point here so apologies if this is not helpfull. Offset 0366 lets you know if the plane is on the ground or not. Maybe no good for runway landing confirmation but can be used in conjunction with this airport/runway xml file. It gives you airport co-ords, runway co-ords plus other usefull data such as helipad, parking spot co-ords that could make more usefull features in your application.

http://www.leons-world.com/files/AirportData.zip

Credit to James Kier for helping me create that xml file. Another file is available that provides VOR, NDB and ILS data available on request.

Chris

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy 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.