Sign in to follow this  
LuisFelizTirado

SCASM and Airport Elevations

Recommended Posts

Hi,I would like to refer that SCASM 2.96 is available at www.scasm.de. It contains a small change in the coding of LWM altitudes. Now I can, for example, create a BGL file with a LWM flatten polygon with an altitude of 627.8828125 meters in SBuilder and, when reading the BGL back to text format, get the same altitude of 627.8828125 meters.627.8828125 meters is the altitude of the flatten that I read at LPVZ (Viseu airfield) in the file FL945170.BGL. This value is coded in 3 bytes. 2 bytes are used for the main part of the altitude which in this case is 627 meters. A 3rd byte is used to code the fractional part of the altitude which in the present case is 0.8828125 meters. I will concentrate on this byte. Let us say this 3rd byte has a value of F. When F is between 0 to 127 the fractional altitude is positive. F=1 means a fraction of 1/128 meter. F=2 means 2/128 and so on. In other words:F Fractional altitude0 01 0.00781252 0.015625...112 0.875113 0.8828125114 0.890625...127 0.9921875Therefore in LPVZ F=113! I am going through this detail because I think it can be useful to know this as the following problem illustrates.As Holger pointed out in the other post many small airfields are wrongly placed. LPVZ is one example. I had to shift the runway some 200 meters to the north. The altitude was fine and I decided not to change it. So I opened LPVZ with AFCAD and created a new BGL. Basically I changed the Latitude and Longitude values of the default AFCAD. Then I had the need to flatten the terrain in the new location of the airport. Here I got a problem.While in AFCAD I noticed the altitude value of the airport: 627.9 (!). Then, in SBuilder, I draw a polygon, set its properties to "lwm flatten" and set an altitude of 627.9 (at that time I had not yet look into FL945170.BGL). The probem was runway flicker which means an elevation problem. The cure was to set the altitude of the new flatten as the default one (=627.8828125).I have just tried JABBGL to look to the altitude of LPVZ in the file AP945170.BGL. With surprise I found 627.888. I had not the time to check if the coding of altitudes in AP files is the same as in LWM files. I also tried LWMViewer to read FL945170.BGL but it only shows the main altitude of 627 m in the status bar. On the other hand, making an export file, LWMViewer writes this: LWMDataAreaDrawPolygons 1,_Flatten_,1,5,4 LWMPoly3 4, 0, _Water_, 627, 113, 627, 113 ; N40* 44.24', W7* 54.61'and, not being familiar with the language I can see the 627 (the main altitude) and 113 (the fractional part).Kind Regards, Luis

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi (again)Further to my post I found an airport which is correctly placed but shows a confict between runway altitude and the ground flatten altitude. As you move forwards the runway disapears (peels off ? spelling?) in front of you and you see grass. This is is typical when the runway is below the ground. It is a default airport and you can check - Goto Portugal, then Monte Real AB.The default LWM flaten is 57 meters. I confirmed this both with SBuilder and LWMViewer. The byte which I called F in my previous post is zero. So the LWM altitude is 57 m.For the runway altitude I opened Map View and saw that the runway altitude is 187 FT. Using a converter to meters I found 187 FT = 56.9976 m. This agrees with JABBGL which shows that Monte Real (AP945170.BGL) has an altitude of 56.997. Between these 2 posts I read Winfried Orthmann description of the BGL file structure where I found that altitude (in APXXXXX files) is coded in 4 bytes as the number of milimeters.This 3 milimeter discrepancy is enough to show an unpleasant flicker. To cure this I made a LWM flat with the "right" altitude. In fact I can not make an LWM altitude equal to 56.997 m. If 57 m is not good the next lower possible value is 56.9921875 (F=127). So the runway is now higher that the ground by about 5 milimeters! You can not see this difference of 5 milimeters, but it is much better than the previous 3 milimeter difference! It is better because the runway is higher (not lower) than the ground!Regards, LuisPS: Because of all this, I changed the variable type that SBuilder uses to store LWM altitudes from single to double!

Share this post


Link to post
Share on other sites

Hello Luis,I think that you are absolutely correct and I suspect that most of the ground flickering in the previous version of FS is due to this problem. We could assume that the cause is rounding of the altitude values in the different files which will give these discrepancies. An interesting problem; there was an enthusiast who made many flattens for the previous version of FS for this very reason.Probably most of the time it will be impossible to have the precisely same altitude in both the airport file and the flatten, but, as you say, it matters little if the aircraft gear sinks into the ground by only a centimeter or so.Best regards.LuisBy the way, many thanks to Dick for his macros that make code in the bgls so legible. The altitude values shown are the minimum and the maximum values for that polygon. Then, each point shows the offset from this.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this