BGLXML - a freeware multi-platform decompiler for FSX BGL files
(C) 2004-2007, Alessandro G. Antonini - (Central Park Informatica)
BGLXML is an utility which analyzes and decompiles BGL
files
into FSX format and
produces human readable XML files to be
recompiled with
Microsoft BGLCOMP. It fully supports almost if not all options included
into
new BGL file format (Microsoft has introduced significant changements
since
previous FS releases). If a BGL file contains objects created with
Microsoft MakeMDL (which is the utility to convert three-dimensional
objects created with GMax), BGLXML is able to extract them and write
back to hard disk in .MDL format (for each XML file produced by BGLXML
there will be nnn MDL files in the same directory than XML). BGLXML is
also able to decode all objects into a BGL or only those interesting
you (see Partial decode switches below).
BGLXML is freeware, open-source, and is licensed under
GNU GPL - if
you are in
doubt about what this means, please read the COPYING file which is
contained
inside the distribution archive.
Simply create a directory on your hard drive and UNZIP the distribution archive inside it. You have four executable files, which are:
The rest of the distribution archive contains:
-t - this means terse mode. If this parameter is omitted then the XML output will contain several information about each decoded object (just experiment to understand what I mean)
-d - print lat/lon info as DD/MM/SS instead of decimal degrees. Most objects have latitude and longitude parameters, for example:
<SceneryObject lat="66 30 00" lon="-23 20 00" ... > - this is a scenery object with latitude and longitude in DD/MM/SS and is a result of a decompilation made with the d switch. If the switch weren't applied then it would be <SceneryObject lat="66.50" lon="-23.33" ... >
-m - print range in nautical miles (default is in meters). Many objects have a range parameter, such as VOR or NDB. a <range="35000" ...> (35000 meters) would be the result of a decompilation made without the m switch. Otherwise it would be <range="18.88M" ...>
-f - print altitude in feet (default is in meters). Many objects have an altitude parameter, such as VOR, AIRPORTS and RUNWAYS. a <alt="800" ...> (800 meters) would be the result of a decompilation made without the f switch. Otherwise it would be <alt="2624.64F" ...>
-h - type BGLXML.EXE -h to obtain additional help on command line switches.
Switches may be specified separately (e.g -t -m -f) or
they may
be included all together in a single string ( e.g. -dmf)
The other parameters have not a switch and mean, in order, the input BGL file to decode and the XML output to write. The output file parameter may be omitted, in this case the output file will be created in the same path of input file, with XML extension.
Partial decode switches:
if you don't want to extract all object files from a
BGL but instead you want to extract only those interesting you, then
you may apply Partial decode function. How it works: first you define a
circle having a central latitude, a central longitude and a radius;
then, BGLXML measures the distance between each object's latitude and
longitude and the central latitude/central longitude of our
circle. If the distance is more than our circle radius, then the object
won't be decompiled.
-n - this switch specifies the central latitude of our circle.
Argument may be in decimal degrees format or it may also be specified
using SCASM notation (dd:mm:ss). If latitude is south, prepend a S
before argument (Examples: -n45.6 -nS41.8 -n22:33:58 -nS51:40:56.5)
-e - this switch specifies the central
longitude
of our circle. Argument may be in decimal degrees format or it may also
be specified using SCASM notation (dd:mm:ss). If longitude is west,
prepend a W before argument (Examples: -e45.6 -eW41.8 -e22:33:58
-eW51:40:56.5)
-r - this switch specifies the radius (in kilometers) of our
circle (example: -r15 - circle has a 15 kms radius).
BGLXML.EXE "c:\my bgls\myfile.bgl" - this will produce an output file such as "c:\my bgls\myfile.xml"
BGLXML.EXE "c:\my bgls\myfile.bgl" "c:\my xmls\myfile.xml" - this will produce a file named myfile.xml into c:\my xmls
BGLXML.EXE -t -f -m -d "c:\my bgls\myfile.bgl" "c:\my xmls\myfile.xml" - this will produce a file named myfile.xml into c:\my xmls - a terse output will be written, with lat/lon as DD/MM/SS, altitudes in feet, ranges in NM
BGLXML.EXE "c:\my
bgls\myfile.bgl" "c:\my
xmls\myfile.xml" -tmfd - same as above (switches may be stuffed before
or
after file names)
BGLXML.EXE "c:\my
bgls\myfile.bgl" "c:\my
xmls\myfile.xml" -tmfd -n41.564 -e5.6562 -r10 - only decode those
objects which are closer than 10 kilometers to N41.564, E5.6562
Support (as well as bug reports) may be obtained into My Home Page Forum. - this is the place to get program updates, besides www.avsim.com
File Prefix |
Contain |
AP*.BGL |
Airport and terminal NAVAID |
AT*.BGL |
Routes, way-points, GeoPol's and
Boundaries |
NV*.BGL |
VOR and NDB |
OB*.BGL |
Buildings and other scenery
objects |
HAVE FUN,
Alex - alex_a66@cpinf.com