January 22, 200521 yr Hi,I just started looking into writing an addon for FS2004 and have a question: How can I find out the geographical location of NDBs, VORs, ILSs and intersections?Does anybody have any starting pointers to some sample code or docs?Thanks a lot,MARK
January 25, 200521 yr The easy way is this:- Download the bgl2xml program that floats around somewhere around here.- Find out in which bgl files the vor's/ils's, etc are stored by decompiling a bunch of bgl's and checking if they are present in the output.- Run the bgl2xml decompiler on all bgl files that have the data you need, resulting in a few hundred XML files.- Glue all xml files together to form 1 massive XML output file with the data you need (my file was 250 MB)- Write an XSLT to extract only the data you want (lat/lon/name).- Run the massive output file through the XSLT filter.You will now have a nice XML file with all data you need. You can further process this data or put it in a relational database.This is the way I extracted all airport data for my addon fseconomy.Good luck!
January 25, 200521 yr Commercial Member That should indeed be the easiest way. The navaids (VOR, NDB) are contained in the files starting with NV. The ILS data is contained in the files starting with AP. Intersections I can't remember at the moment. Arno If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done. FSDeveloper.com | Former Microsoft FS MVP | Blog
January 26, 200521 yr Alright guys, thanks a lot for the help...I'll try it - just need to get some more free time. MARK
January 26, 200521 yr Be sure to bring in a few gigabytes of ram too if you're going to process those XML's!! :-badteeth Some helpful software :Altova xmlspy for viewing your xml (needs lots of ram)Altova mapforce to generate an xslt stub for the processing of data (needs lots of ram)AWK to glue all XML's together into one main XMLSaxon to run the xslt and reduce the main data setGood luck!
January 27, 200521 yr Correct me if I'm wrong but in order to accomplish the above task, it's going to require several hundred dollars in software and a degree in computer science?
January 27, 200521 yr Hm - I guess you can survive without spending too much money - just use freeware and opensource programs/editors.Eclipse is a really great IDE - for Java anyway - and there are a bunch of XML plugins that are free.As far as the degree is concerned, you are probably right, but I have that, luckily, so that shouldnt be the issue...However, depending on how complex the XML is and how much exactly you want to extract, you can just get it with simple string extractions or regular expressions. We worked with XSLT in some projects at work, and it seemed really slow if the file gets big. And XSLT is a huge pain to write as soon as it gets just a little bit tricky.So I guess if those files are this big, you are better off using some self-written SAX-based extractor or just a small line-based perl-script witha bunch of regexes... Convert it into a CSV format since I dont really need XML at the other end anyway.Well, I'll let you know how it goes, but it'll be a while until I will really get to it...MARK
January 27, 200521 yr Does anybody have a link to the bgl2xml tool for FS2004?All the links I found were dead...
January 27, 200521 yr I don't really like XSLT, but it's the only thing that was usable to bring down the 250 MB of XML. No parser could read an XML file that big. The freeware saxon parser has no problems running it through an XSLT. I'm not sure if normal text parsing will work, since you may need to aggregate some data (I only store the combined length of all runways of an airport as a size indicator)You don't need to write the XSLT. I recommended altova mapforce, because it generates the XSLT for you. You simply load the XML schema of the FS data (provided by the bgl sdk) and the target schema of the data you want. You then drag lines between the input and output and it spits out the XSLT for you. You can tweak it a bit further and then run it with saxon. Mapforce is available as a 30 day fully function trial. My company is an altova partner, so we have a corporate license, but the trial should work long enough for you to generate an XSLT.
Create an account or sign in to comment