View Full Version : Getting TaxiWayPoint Index from BGL file
19 May 2007, 11:53
I have been using Winfried Orthmann's document FSX File Structure to try to determine the route that I need to take when given a taxi clearance (for a small virtual co-pilot app that will do the taxi on my behalf! I know it's lazy, but I thought it'd be fun to have someone else taxi for me)
I understand that each Taxiway path has a start and end index, which refers to the index of a taxiway point (or parking). However when reading a taxiway point from the BGL file there is no index, (each taxiway point includes: the type; forward/reverse flag; "unknown"; longitude and latitude). So how does one determine the index of the taxiway point?
I hope I'm not being very stupid. I have obviously missed something!:o
19 May 2007, 12:43
David The record for a taxiway path does include a start and end index. It also includes a name index so that it is possible to relate the taxipath to a named taxiway.
Taxipaths are in one record as described by Winfried. the first 8 bytes are the header and then the first two bytes of each path record are the start index and bits 0 thru 11 of the next two bytes give the end index,
19 May 2007, 13:22
Thanks for your reply Jon. However I am still confused about the index numbers referred to in the taxiway path records!
I understand how to read them in the taxiway path records, but what do those index numbers refer to? As the taxiway points apparently have no index.
For instance if I read that the start index of a path is 12, and the end index of the path is 22 - how then do I find those points? I'd be looking for points 12 and 22, but without having read their indices from the bgl file I'm not sure how to look them up - unless the index is simply the number from the start of all the airport's taxiway point records, the order in which the records are read from the bgl file, starting from 0 perhaps (so first is 0, second is 1 etc). But then what index numbers do the taxiway parking records have?
Thanks for your help!
19 May 2007, 13:38
Each parking spot and each taxiway point has an index number. There are two series of numbers one for parking places and one for taxiway points.
All types of path except for those designated as PARKING will have a start and end index from the taxiway point list. If the type is PARKING then the path will have a start index from the taxiway point list and an end index from the parking list.
The SDK is confusing in that it seems to say that there is one list of index numbers when in fact there are two.
You are correct that there is nothing in the record itself so you need to generate your own index when decompiling. Your assumption above is correct. SDE, for example, extracts point or parking records one at a time from the Bgl data inside the Airport record and assigns a sequential index to each set. Fortunately this does relate to the index number provided in the path records :)
19 May 2007, 13:49
Thank you so much Jon.
I found the documentation around this really confusing because it is mostly about going from xml - bgl, not the other way round.
19 May 2007, 14:08
Yes it is and the deeper you get the more confusing it can become :)
It took me several months to complete SDE and we are still finding bugs but it is pretty much a complete decompiler for Fs9 and FSX BglComp based files now. However I am sure there are still bugs lurking in there somewhere
21 May 2007, 07:15
By all accounts SDE does an excellent job, so the months of work have paid off. Have you considered making the functionality available as dll's that programmers could buy from you and then reference in their code, thus avoiding having to do all the work again themselves? Perhaps you already do this, although I have found no reference to it on the forums. I suppose that the process of documenting all the methods would be a lot of work in itself!
I have progressed a little in my quest, but have stumbled on two other problems:
1. I have an ID of 27 (0x001B) for Taxiway Parkings, but my code never finds any parkings. Do I have the ID wrong?
2. When parsing Taxiway Paths, I get values of 4, 67, 97 & 98 for the taxiway path type. I expect this is because I am reading the byte incorrectly, but I can't work out how, because all my other single byte conversions to integers seem to be correct. I was expecting values of 1-6, as per Winfried Orthmann's pdf file.
21 May 2007, 10:22
SDE is available as a dll and has been mnetioned here and there. You are correct that the API is not fully documented but it is not that hard to use at a basic level.
I think there are several applications using the command line interface to generate XML first.
The parking type is defined by bits 8 thru 11 or a packed DWORD starting at byte 0 of each parking record
I use the following to get out the taxi path type:
pathType = (TaxiPathType)(rawdata & 0x0f);
where TaxiPathType is an enumeration and rawdata is the 4th byte
vBulletin® v3.8.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.