Jump to content
The simFlight Network Forums

Problem with G5.csv


Recommended Posts

Hi Pete,
 
my name is peter and I am the author of SIMstarter a program to start your simulator with different profiles.
 
I would like to implement a feature to select the starting position based on MakeRwys data. So far no problem.
But I found out, that the data at G5.csv is not that precise that I would need.
 
Example: EDDM (Munich, Gate 202) in runways.txt

          in file: Scenery\0601\scenery\APX51140.bgl          
          Gate 202 [#G106]:  N48:21:30.6333  E011:47:32.9532
              Type 8 (Small Gate), Size 18.0m, Hdg 263.1T

and

          in file: aerosoft\Afd\scenery\AF2_EDDM.BGL
          Gate 202 [#G106]:  N48:21:30.6333  E011:47:32.9532
              Type 8 (Small Gate), Size 18.0m, Hdg 263.1T
              Airlines: DLH CFG

So far so good, both identical, because I installed Mega Airport Munich as well (just for clairification)...

If we have a look into G5.csv searching for EDDM and Gate 202 we will find
 

EDDM,,202,48.358513,11.792487,18.0,263.1,8,DLH,CFG

But is that the right calculation? Because whenever I am using this value for latitude and longditue the plane will be slightly misplaced.

 

N48:21:30.6333 should become 48.358509 not 48.358513

E011:47:32.9532 has been recalculated well to 11.792487

 

another example: EDDN (Nurnberg)

 

N49:29:42.7500  E011:04:43.3772 should become 49.495208 11.078716 NOT 49.495167 11.078444

 

Is it a calculation problem or do I misunderstand these values?

Link to comment
Share on other sites

They are effectively the same.
 
The calculation in runways.txt is: N48:21:30.6333 = 48 (degrees) + 21 *60 (minutes)  + 30.6333 (seconds) = 48.35850925 degrees

 

The calculation In g5.csv = 48.358513 degrees

 

The difference is 48.35850925 -  48.358513 = 0.000003750 degrees which is a difference of 0.4167 m.

 

Anyway, the actual values for the AIP from EDMM are Stand 202A N41 degrees 21.54 minutes or 48.359 degrees and Stand 202B N41 degrees 21.51 minutes  or 48.3585 degrees. I don't what the differences are between A and B.

 

The values from runway.tx are suspicious  because they are given  to a false accuracy of 4 decimal places of seconds. 0.0001 seconds is about 3 millimetre. That suggests they have been re-calculated from an original source

Link to comment
Share on other sites

  • 4 weeks later...

Sorry for the late reply. ;O)
I was on a business trip and forget to answer.
 
SIMstarter is using that values to place the aircraft. Therefore it is quite important for me to get precise values.
 
Could you please explain your calculation again?
 
I am using:

Starting: N48:21:30.6333

                Seconds
               --------- + Minutes
                   60 
Dezimalgrad = --------------------- + Grad
                         60


                30,6333
               --------- + 21
                   60 
48,35850925 = --------------------- + 48
                         60

Thanks a lot!

 

Seems for me, that there is a calulation mistake in G5.csv instead of runways.txt.

Link to comment
Share on other sites

What do you want it to show?

 

I am just wondering, why the values at G5.csv (LAT and LON) of an parking or gate are different comparing to runways.txt

 

As I wrote I would like to use it to place aircrafts to the correct parking position. Using G5.csv would be much easier. ;O)

Link to comment
Share on other sites

I am just wondering, why the values at G5.csv (LAT and LON) of an parking or gate are different comparing to runways.txt

 

As I wrote I would like to use it to place aircrafts to the correct parking position. Using G5.csv would be much easier. ;O)

 

I thought mgh had already explained that they are not different. They can't be, they are obtained from the same data in the BGL!

 

You don't appear to have noticed that my question was to mgh about why he thought "runways.txt is clearly not right". 

 

Pete

Link to comment
Share on other sites

As I said previously

 

The values from runway.tx are suspicious  because they are given  to a false accuracy of 4 decimal places of seconds. 0.0001 seconds is about 3 millimetre. That suggests they have been re-calculated from an original source

Link to comment
Share on other sites

That suggests they have been re-calculated from an original source

 

There's no specific accuracy being used. I just log the value I get with a default precision. By "recalculate from an original source" I've no idea what you think is going on. There are no recalculations to do, it is just a value in a file! What on Earth do you think is the recalculation being done? Re-projecting the Earth's surface or something?

 

No, it's just the data that is available. Full stop. And the same data, albeit in a different format, goes into the G5 and any other files which demand it, all from the same database built up from reading the BGLs.

 

Pete

Link to comment
Share on other sites

I have no where the data comes from. But, if they are based on the same database  why are there differences between runways.txt (48.35850925 degrees) and from G5.csv (48.358513 degrees).  That's a difference of 0.4167 m. Somehing must have changed them.

Link to comment
Share on other sites

I have no where the data comes from. But, if they are based on the same database  why are there differences between runways.txt (48.35850925 degrees) and from G5.csv (48.358513 degrees).  That's a difference of 0.4167 m. Somehing must have changed them.

 

And that is exactly my problem. ;O)

Link to comment
Share on other sites

I have no where the data comes from. But, if they are based on the same database  why are there differences between runways.txt (48.35850925 degrees) and from G5.csv (48.358513 degrees).  That's a difference of 0.4167 m. Somehing must have changed them.

 

The GATE structure being used, from the BGLs, has two fields:

 

int nLon; // longitude in packed format
int nLat; // latitude in packed format
 
The FS "packed format" involves a calculation as follows to get a floating point position (this is for Latitude. Longitude is different of course):
 
#define MAXSOUTH 536870912
double f = (((double) nLat)*180)/MAXSOUTH;
if (f>90.0) f = -((f-180)+90);
else f = 90-f;
return (float) f;
 
There's also a need for some of the results to return a 64-bit (long long) version, which would be:
 
return (__int64) ((f * 10001750.0) / 90.0);
 
FS, in different places, uses a mixture of all these ways of storing positions. If any inaccuracies arise they will be withing the limits of the precision of the storage methods used.
 
The one used in the G5.CSV would be the floating point one.  The one listed in Runways.txt is the __int64 one. Maybe the G5.CSV, using the 32-bit floating point form, is less accurate than the one logged in RUNWAYS.TXT. But is isn't "wrong".
 
Hope this helps understand what is going on here. It these computations gives a difference of, what, just over 1 foot, I'm not sure what problems then arise. Perhaps someone can enlighten me?
 
Pete
 
Link to comment
Share on other sites

I've modified MakeRunways to use double (64 bit) floating point accuracy for the Gate positions in G5.CSV, instead of 32-bit floats. But as far as your example is concerned, it is the same. The G5 positions are likely to be more accurate than those logged in the Runways.txt file because they've gone through less transformations from FS's 32-bit integer packing format. In the next update to MakeRunways I will probably truncate/round all the Lat/Lon positions logged to the equivalent of 1 decimal place of minutes.

 

If you want the modified G5 download MakeRunways 4.677.

 

Pete

Link to comment
Share on other sites

I've modified MakeRunways to use double (64 bit) floating point accuracy for the Gate positions in G5.CSV, instead of 32-bit floats. But as far as your example is concerned, it is the same. The G5 positions are likely to be more accurate than those logged in the Runways.txt file because they've gone through less transformations from FS's 32-bit integer packing format. In the next update to MakeRunways I will probably truncate/round all the Lat/Lon positions logged to the equivalent of 1 decimal place of minutes.

 

If you want the modified G5 download MakeRunways 4.677.

 

Pete

 

Thanks a lot. 

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.