Jump to content


* * * - - 2 votes

Creating A Flatten Zone


  • Please log in to reply
1 reply to this topic

#1 IBtheSarge

IBtheSarge

    First Class Member

  • Moderator
  • PipPipPipPipPipPipPipPip
  • 10,718 posts
  • Location:Central Florida

Posted 30 March 2006 - 06:39 PM

Those who would like to create flatten zones without the use of 3rd party programs (and the associated learning curve) and without modifying the scenery.cfg file, may find this useful. WordPad, AFCAD, and SCASM are required.

=====================================================

Step 1: Create a work directory (or, you can simply use the same directory in which you installed SCASM). If you decide to use a work directory, move or copy SCASM.exe into this directory.

Step 2: Open Wordpad and create the following lines of code:
; SCASM file created by Check Six! Designs
; based on the FSTflatten process
; Copyright(www.fs-traveler.com)

Header ( 1 41.6805089021836 41.6392767134892 -116.698565245183 -116.755682843556 )
LatRange ( 41.6392767134892 41.6805089021836 )
Set ( areamx 64 )
Area16N
  Elevation ( 5400
    41.6392767134892        -116.746869394651          ;1
    41.6649747297488        -116.707606153632          ;2
    41.6736016717552        -116.70260730431          ;3
    41.6736016717552        -116.70260730431          ;4
    41.6793110406424        -116.698565245183          ;5
    41.6805089021836        -116.755682843556          ;6
    41.6399596547808        -116.754696480309          ;7
  )
END16
Be sure you type everything exactly as it appears -- every space, every character must be EXACT or SCASM will not compile the file to a BGL.  (Well, you DON'T have to keep the "Check Six! Designs" part if you don't want to; but it is STRONGLY recommended that you keep the next two lines.  Steve Greenwood put a lot of work into the FSTUtilities package, especially the FSTflatten program; and without his labour and programming, none of this would be possible.  The only reason I developed this tutorial is because it's quicker than switching back and forth between FS9 and FSTflatten to create the same data for SCASM to compile.  Steve, however, gets ALL the credit for me -- and you -- being able to do it this way.)

Step 3:  Time to collect your data.  Open your airport in AFCAD.  The first thing that needs to be done is define the airport area INSIDE OF WHICH will be your flatten zone.  This area can be the same size as the actual airport area (the entire airport is within it), larger than the actual airport dimensions, or it can even be smaller than the airport dimensions.  The key here is that your flatten zone will be COMPLETELY inside these sets of coordinates.  You will also need to set the elevation (in feet) that you want the flatten zone to have, and then define the different points that will outline your flatten zone.

With your airport on-screen in AFCAD, figure out where your flatten zone will be, and then find two points on the screen that will surround the flatten zone.  Define a point to the north and west, and another to the south and east -- the upper-left corner and bottom-right corner.  Write down the lat/lon for these two points.  Now, right-click anywhere on a blank portion of the AFCAD screen, select Properties, and write down the airport elevation.

We're going to deal with this line
Header ( 1 41.6805089021836 41.6392767134892 -116.698565245183 -116.755682843556 )
first.  Immediately you will see a difference between the AFCAD coordinates and the format used here.  It's really just simple math; you need to convert dd:mm.mmmm to dd.ddddddd format.

Let's use N41 26.37 as an example.  We can readily plug in 41 as the dd.dddddddd part of the new format.  To get the numbers to the right of the decimal place we need to convert 26.37 to .xxxxxxx and then add it in.  First step:  divide .37 by 60, and .0061666 should be the result.  Now add the whole minutes (26) and divide 26.0061666.  What you should get this time is .4334361; and if we add the whole degrees (41) to that, we will have the new format -- 41.4334361.  (Just remember that southern latitudes are negative numbers; S41 26.37 would come out as -41.4334361)  Do the same calculations for the two points of longitude; the same positive/negative rule holds true for longitude as well -- West longitudes are negative numbers (as in the example above), East longitudes are positive numbers.

Step 4:  Okay, now that you have done the calculations and have two converted latitudes and two converted longitudes, it's time to plug them in.

On the Header ( 1 line, the first coordinate is latitude from the upper-left corner; the second is the latitude from the lower-right corner; the third is the longitude from the lower-right corner; and, the fourth is the longitude from the upper-left corner.  Just remember that it's LATITUDE first, then LONGITUDE, in the order TOP BOTTOM BOTTOM TOP.  On the next line down, you have to enter the two latitudes again, but this time in reverse order -- bottom-right latitude first, and then the upper-left latitude.  On the Elevation ( line, enter the elevation (in feet) that you want the terrain to be in the flatten zone.  Don't foget to keep a space between the parenthesis and the first digit of the elevation.  With that done, we've defined the area and can now set about getting the coordinates for the individual points of the flatten zone itself.

Step 5:  Time to define the flatten zone itself, using two steps -- finding the individual points of the flatten, and converting the lats/lons to the SCASM format.  The flatten zone does NOT have to be rectangular; it can be any shape it needs to be; I haven't found any limit to the number of points you can enter, although the highest I've ever gone is 13 points.

I use the "apron route" tool to draw the flatten zone right on the AFCAD screen (then delete it, point by point, after I have the coordinates on paper).  However you want to do it is fine, except for one hard, inviolate rule -- YOU MUST MOVE IN A COUNTER-CLOCKWISE ROTATION.  If you enter the points clockwise, SCASM may or may not produce a BGL from your code; but it's guaranteed that the area will NOT take on the new elevation you've given it.  Once you've defined the zone, write down the lats/lons of each of the points.  Change these values
    41.6392767134892        -116.746869394651          ;1
    41.6649747297488        -116.707606153632          ;2
    41.6736016717552        -116.70260730431          ;3
    41.6736016717552        -116.70260730431          ;4
    41.6793110406424        -116.698565245183          ;5
    41.6805089021836        -116.755682843556          ;6
    41.6399596547808        -116.754696480309          ;7
with your converted coordinates, remembering that you enter them in counter-clockwise rotation.  If you have less than seven points, just delete the extra lines.  If you have more than seven points, hit the Enter key after ;7 and keep adding them until you have them all entered.  Just make sure that
  )
END16
are the last two lines in your file.

Step 6:  On Wordpad's toolbar, "File" then "Save As" and point Wordpad to the directory in which SCASM is located. Give the file a unique name (I usually use the ICAO of the airport and another identifier, like KPSN_Flat) and click "Save." You will need to rename the file so you can change the extension to SCA.

Once you have changed the extension, drag-and-drop the SCA file onto the SCASM icon, wait a few seconds, and -- if you've done it right -- a BGL file will appear with the same name as the SCA file (i.e., KPSM_Flat.BGL). All you need to do is place the BGL file in your airport's Scenery folder.

=====================================================

If you need to make more than one flatten zone, just repeat the process for the second zone but give the file a different name so the first one doesn't get overwritten.  There is a limit to the number of flatten switches you can put in the scenery.cfg file; however, with this method, you can have as many flatten zones as you need since the scenery.cfg file isn't used or impacted by these BGL files.

Edited by sarge, 07 April 2006 - 05:30 PM.


#2 Jon

Jon

    Administrator

  • Admin
  • PipPipPipPipPipPip
  • 3,140 posts
  • Location:South Carolina, USA

Posted 14 April 2006 - 02:27 PM

Added to KB - thanks!