Jump to content
Sign in to follow this  
Guest Woof

BGL Latitude / Longitude Conversion

Recommended Posts

Guest Woof

I'm having difficulties converting the lat / lon of airports & runways from the BGL format to decimal. I'm using the formulae:double airLon = br.ReadInt32() * (360.0 / ((3.0 * 0x10000000) - 180.0));double airLat = br.ReadInt32() * (180.0 / (2.0 * 0x10000000));Using Scenery0302sceneryAPX25170.bgl as an example, Dowagiac Municipal (C91) is the first airport and should have roughly 41.9929342 / -86.1280125 as its coordinates, but I am getting 48.007066436111927 / 93.872006953956259the bgl coded longitude retrieved from the example file is 209988078the bgl coded latitude retrieved from the example file is 143186653I'm not sure whether this is a C# casting (don't think so) issue, or a problem with the formulae I'm using. Any pointers would be appreciated.Cheers

Share this post


Link to post
Share on other sites
Guest Woof

Jacky,Your english is just fine!looks like 90 - my lat == correct lat and my lon - 180 == correct lonThanks for the pointers. The formulae I was using came from Winfried Orthmann's FS X BGL File Structure doc, which has been fantastically useful.Cheers

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...