1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

bgl file structure - help needed

Discussion in 'Tools programming' started by glenn, 26/4/07.

  1. glenn

    glenn

    Joined:
    26/4/07
    Messages:
    14
    Country:
    switzerland
    Hi,

    I'm new to this forum and hope that this is the right place to get in depth information about the bgl file structure.

    My question concerns the 'Airport-subsection' - page 5 in Winfrieds great documentation 'FS X BGL File structure' which I downloaded from this website.

    a) Can anyone explain me how the ICAO codes are stored. Although I read the explanation within the document on page 2, I can't figure out how to proceed.
    i.e. (DWORD) '02 DC 62 81' means PAPO (how is this coded?)

    b) datatype 'float': where is this datatype described?
    i.e. (DWORD) '43 AC 00 00' means MagVar -16 (how is this coded?)

    thank you all in advance for helping me
    glenn
  2. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    24,158
    Country:
    wales
    Actually Winfried explains it pretty well. It is not that easy as the format is packed. Here is my documentation on the subject and it is really much the same.

    Can I ask are you planning to write a de-compiler? If so there are a couple already available but if you want to write you own then I have the coded algorithms for this in SDE - these are in C# but easy enough to change to another language.

    A Float is a four byte floating point number in most programming languages. In some cases this is called a single - but what it means is that the four bytes is to be treated as a floating point number. Otherwise it is going to be an integer (DWORD). Depending on the programming language you plan to use you will need to translate these into the appropriate types. Winfried is basically giving C/C++ types.
  3. glenn

    glenn

    Joined:
    26/4/07
    Messages:
    14
    Country:
    switzerland
    Thanks Jon for your quick response.

    you're right, I'm planning to program a de-compiler. As I figured out all of these compilers that I found for free are generating XML-Files. I would like to have the data in a database, that's the reason why I want to program it by myself.

    Of course there are some strange things in this bgl-files and if you are willing to give me some code snippets this would be helpful anyway. I'm also programming with C# (VS2005) so it shouldn't be a problem to read your code :)

    Glenn
  4. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    24,158
    Country:
    wales
    Glenn

    SDE can provide the Bgl contents in format other than XML. If you want the information in a database then you might want to consider using the SDE Engine library. I will make that available to developers. SDE generates a tree like structure of objects that contains all the information extracted from the Bgl file. Also have you considered generating your database from the XML - there are certainly a lot of XML based databases about now so it should not be too difficult.

    PM me if you would be interested in using the SDE Engine - give me some idea of what application you are planning would also be a help. On the other hand if you enjoy the propect of writing a de-compiler (it is not too easy :) ) then let me know

Share This Page