Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Converting Lat/Long to LWMPoint3 coordinates

Featured Replies

I have created flatten files and removed the equivalent LWM polygons from the HP file. This works ok, however, obviously the flattens do not show up in map view. I have two questions.Can someone give me a formula to convert Lat/Long as used in SCASM Area16N (FSTFlatten output) to LWMPoly3/LWMPoint3 coordinates (LWMViewer output).Secondly, do LWMPoly3 polygons need to be convex? ie, will I need to split the flatten contours. ( I know I will need to do this on cell boundaries).I am proficient in C++, so given this information I am sure I could write a conversion program.Any help would be much appreciated,George

Hi George.I use Delphi, but the math should be about the same:==================================================== LOD5x := Floor( ( Longitude ) / 3.75 ) ; LOD5y := Floor( ( Latitude ) / 2.8125 ) + 1 ; LOD5xLon := LOD5x * 3.75 ; LOD5yLat := LOD5y * 2.8125 ; LOD5xPoint := Ceil( ( Frac( ( Longitude + 180 ) / 3.75 ) * 3.75 ) / 0.0146484375 ) - 1 ; LOD5yPoint := 256 - Ceil( ( Frac( ( Latitude + 90 ) / 2.8125 ) * 2.8125 ) / 0.010986328125 ); LOD8x := Ceil( ( Longitude + 180 ) / 0.46875 ) - 1 ; LOD8y := Ceil( ( 180 - ( Latitude + 90 ) ) / 0.3515625 ) - 1 ; LOD13xSub:= Ceil( ( Longitude + 180 ) / 0.0146484375 ) - 1; LOD13ySub:= Ceil( ( 180 - ( Latitude + 90 ) ) / 0.010986328125 ) - 1; LOD13x := Ceil( ( Longitude + 180 ) / 0.0146484375 ) - 1 - ( LOD8x * 32 ); LOD13y := Ceil( ( 180 - ( Latitude + 90 ) ) / 0.010986328125 ) - 1 - ( LOD8y * 32 ); LOD13xPoint := Ceil( ( Longitude + 180 ) / 0.000057220458984375 ) - 1 - ( LOD13xSub * 256 ); LOD13yPoint := Ceil( ( 180 - ( Latitude + 90 ) ) / 0.00004291534423828125 ) - 1 - ( LOD13ySub * 256 ); LOD8xPoint := LOD13xPoint + ( LOD13x * 255 ) + 4080; LOD8yPoint := LOD13yPoint + ( LOD13y * 255 ) + 4080;Cell is LOD8x, LOD8yArea is LOD13x, LOD13yAreaPoint is LOD13xPoint, LOD13yPointCellPoint is LOD8xPoint, LOD8yPointAreaFill1x1 is LOD13x, LOD13yAreaFill2x2 is LOD13x DIV 2, LOD13y DIV 2AreaFill4x4 is LOD13x DIV 4, LOD13y DIV 4AreaFill8x8 is LOD13x DIV 8, LOD13y DIV 8AreaFill16x16 is LOD13x DIV 16, LOD13y DIV 16====================================================Polys should be convex, and they need to be split at the LOD13 bounds ( Area ). Areas then need to be grouped for the LOD8 bounds ( Cell ).Cells need to be arranged in rows from West to East and then rows arranged from North to South in the final code. That's a requirement of the data stream, as described by the SDK and worked out by Christian Stock and Chris Wright.Dick

  • Author

Hi Dick,Thanks for the information, I will get cracking now.George

  • Author

Hi Dick,I have been looking at a default HP* bgl and see that it contains non-convex polygons. This obviously makes my task much easier.George

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.