Sign in to follow this  
Guest DocMoriarty

How to get airport data

Recommended Posts

I got FSX a couple weeks ago and installed the SDK. Now i'm playing with the idea of creating an add on that adds some gameplay to FSX like random generated missions. For that purpose though i'd need a way to access airport data.I was wondering whether FSX builds up an airport list from all airports in the bgl files (i know FSX generates some information from the scenery files when it is launched first time or scenery files are added) which might be useful for that purpose. I wonder what FSX is using for the airport selection window, they must have kinda database for that but so far i didn't find the source. Does anyone know the file(s) which contain that information?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

The data is contained in APX#####.bgl files in the scenery folders.Google search for "BglAnalyzeX".Distribution or use of this data for an add-on program may be subject to licensing restrictions. Be sure to consider this when choosing a data source.

Share this post


Link to post
Share on other sites

Thanks for the info. My main concern at the moment is that my client should use the same airport data that the player gets to work with in FSX including his installed add on sceneries. Not going to ship any of that with my application so there shouldn't be legal issues (consider a new gps or autopilot NOT working with FSX' and current installed add on data wouldn't make too much sense).My application needs to know for example the airport close to the players location if on ground for tracking missions or needs to be able to find airports at a certain distance to another airport for mission generation, needs to know something about an airports "size" to classify airports for mission generation (it wouldn't make sense to generate passenger missions for 500 passengers on a remote farmers landing strip, at least wouldn't be too "believable").So guess i have to write a parser for these bgl files that can retrieve the data that i need very quick.

Share this post


Link to post
Share on other sites

>So guess i have to write a parser for these bgl files that can>retrieve the data that i need very quick.If any of the formatted files produced by my "MakeRwys" program, you are welcome to use that. It's free and you can ship it with your program if you like. Many of the files are for Radar Contact, but there are airport files used by FSMeteo and a binary format file I use for FStarRC (the original purpose of the program).You place it into the main FS folder and run it from there, and it places all the resulting files in the same folder.The CSV files are all "comma separated values" files, which will use Excel to load if you don't explicitly select a text editor, which you should. There's a big 'log' file ("runways.txt") which simply documents all the BGLs examined and the data it extracts -- you might find that interesting, but it gets VERY big so you need a capable text editor like UltraEdit32.Download it through the details at http://forums.simflight.com/viewtopic.php?t=55488 . Although that's an FSX download announcement the program works with FS2002, FS2004 and FSX.RegardsPete

Share this post


Link to post
Share on other sites

>>> So guess i have to write a parser for these bgl files that can retrieve the data that i need very quick.If you want to guarantee compatibility with both FSX and all add-ons, working with BGL files is the common denominator. You can start with BglAnalyzeX to understand what is in these files. Parsing BGL files is very time consuming (hence the long FSX load times). The common strategy is to include a utility or mechanism in your software to parse the BGL files and build a database. This process is run once when your software is installed, and subsequently when the user adds or changes scenery.

Share this post


Link to post
Share on other sites

Thanks again for the infos. It's not really the first time that i'm modding for MSFS (perhaps someone remembers mdlcommander which is no longer needed with XToMDL as far as i can see).Yes i had something in mind like creating a database after installation or when the user explicitely uses some menu item in my add on to rebuild my airport database (or maybe after i check timestamps of scenery directories in scenery.cfg against a timestamp in the database).I looked into the Scenery SDK and read up on the new xml format for airports and can imagine that parsing that stuff out of the bgl's isn't the most trivial task so i will most likely try out your tools to get a little bit more familiar with that stuff.At first i thought that FSX perhaps creates something like a database for airports to speed up performance in the airport selection window but it doesn't seem like that now.

Share this post


Link to post
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
Sign in to follow this