View Full Version : How to extract airport data from FSX?
01-30-2008, 11:24 AM
I'm investigating the possibility of creating a point and click style flight planner for FSX, which would require building a database of airport data (and possibly navigational beacons and waypoints at well at some stage, though its primary focus would be VFR).
Is there a known way to extract this data from FSX, and if so how is it done?
01-31-2008, 01:55 AM
There are three 'decompiler' tools that I am aware of that will generate xml code from a bgl file. BglAnalyzeX, BglXml and Bgl2Xml/SDE Test App. They can all be found on AVSIM, Fligtsim or scenery.org. Bgl2Xml/SDE Test App is my tool. Each of these will extract from FSX bgl files and should provide the information that you want. You would need to handle the import of the xml into your application. Alternatively you would need to write the code yourself. The degree of effort depends on how far you want to go. Alternatively if you do not want to handle the Xml or write code for this then email me jon AT scruffyduck.co.uk I might be able to help
01-31-2008, 03:13 AM
the idea is to extract the information at runtime (some sort of import functionality) rather than supplying it with the application (I'm not sure about the legallity of doing the latter, and it would prevent people from being able to update the database).
Handling XML import should be no problem, there are excellent XML parser libraries out there :)
Thanks for the information so far though. Should at least get me started.
01-31-2008, 04:19 PM
Well extracting it at runtime sould require that you know which AP files are being loaded. Airport Data itself is public knowledge - as an alternative to getting it from FS you could get it form some other source so I don't think there is a problem with supplying the data with an application.
01-31-2008, 05:04 PM
Super Flight Planner does exactly what you want, though not at run time. The user runs a database builder which runs thorugh all scenery files looking for data (user has options to tailor) to build its database. Ver 3 (FS9) has a tool to extract to a csv file. It's not in Ver 4 (FS9 and/or FSX) yet (still in development promised in the future).
02-02-2008, 02:06 AM
I didn't mean at runtime of FSX, but at runtime of the planner software. Sorry if that caused confusion.
I want it to be able to rebuild its own database (or expand it) by pointing it at a directory or set of bgl files.
Scruffyduck's bgl2xml would probably do the trick (just call it for each bgl file), if it were a library I could call that would return me an XML DOM structure rather than an executable that writes the XML to file.
02-02-2008, 04:12 AM
What language are you working in?
02-02-2008, 05:06 AM
I haven't decided yet. Might give C# a try, but I'm most familiar with Delphi from all the Win32 compiled languages.
Java is another serious contender.
02-02-2008, 05:39 AM
The engine that Bgl2Xml uses is written in C# and requires dotNET 2.0. Reading all the data you might need at start or run of an application can be quite time consuming which is why I build some 'databases' that contain basic information as a special one time task. That is probably good enough for stock data as that is pretty static. What does change of course is data for user addons.
02-02-2008, 06:53 AM
That's what I was thinking of, do a full import once (or more frequently as requested by the user) and create some system to allow that data to be updated as addon scenery becomes available.
02-02-2008, 07:25 AM
That would certainly work
02-08-2008, 02:43 PM
step 1: purchase Visual Studio 2008. Done
step 2: create a library to convert polar coordinates to Mercator map coordinates. Underway
step 3: think up a user interface: under consideration
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.