Jump to content
The simFlight Network Forums

Writing Long/Lat


Recommended Posts

Hi There,

Im writing some software to write a LAT/LONG to FS to send the aircraft to it. Its basically meaning we can use MSFS outside view and X-Plane for the flight model. Problem is i cant get my head round converting a Long/Lat to the FS format FSUIPC requires. I did a quick search on the forum and found nothing. Has anyone got any code in any language? I can convert it, Delphi would be especially good.

Thanks

Gary Oliver

Link to comment
Share on other sites

Problem is i cant get my head round converting a Long/Lat to the FS format FSUIPC requires. I did a quick search on the forum and found nothing. Has anyone got any code in any language? I can convert it, Delphi would be especially good.

The formulae together with hints on converting them are provided in the FSUIPC SDK.

Regards,

Pete

Link to comment
Share on other sites

Solved it, before i was using doubles for reading. But had a quick browse to see delphi had a COMP datatype which allows the 64 integers so a nice simple conversion to write. Sorry bout that.

No need to apologise. It is possible to manipulate the values with two parts, derived from the two 32-bit values -- but you have to read them as regular integers not floating point, then convert them. The complication then comes in dealing correctly with the sign -- the high part is signed, the lower part is not, of course, but effectively has the same sign as the upper part.

If Delphi supports 64-bit integers then it is definitely MUCH easier, so well done for finding that. I think some C/C++ compilers support a "long long" which I think is the same.

Regards,

Pete

Link to comment
Share on other sites

  • 3 months later...

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.