Jump to content
Sign in to follow this  
Guest sgreenwood

Automated flatten bgls for Airports - SCASM advice?

Recommended Posts

Guest sgreenwood

I've just learned enough about how to use Airport For Windows (AFW) to create flatten bgl files to repair problems with pavement at airports. It seems like overkill for such a small task, and a bit inconvenient to use.So, I have written a small AWK script to write the SCASM script, using a simple text file with the airport elevation and coordinates of the vertices of the area to be flattened (counter-clockwise order). No AFW needed. (And I have no knowledge of SCASM/scenery, hence this request.)It takes a text file named flatten.txt as input--------------------------------------------------441239:28.78 -119:45.8239:29.68 -119:45.8239:29.68 -119:45.28--------------------------------------------------And turns it into flatten.sca, the SCASM script--------------------------------------------------[pre][big];SCASM file generated by flatten.awkHeader ( 1 39:31.04 39:28.78 -119:46.89 -119:45.28 )LatRange ( 39:28.78 39:31.04 )set ( areamx 64 )Area16N Elevation ( 1344.78 39:28.78 -119:45.82 ; 1 39:29.68 -119:45.82 ; 2 39:29.68 -119:45.28 ; 3 )End16[/big][/pre]--------------------------------------------------I've put the commands to accomplish this in flatten.bat, a batch file,so the entire process is trivial, an requires no knowledge of AWK or SCASM.--------------------------------------------------awk -f flatten.awk flatten.txtscasm flatten.sca flatten.bgl--------------------------------------------------Before I go much further, I do have a few questions:1) Am I overlooking any SCASM issues? The script was modeled after the output from AFW.2) I could find no information for the SCASM command "set ( areamx 64 )"Is it OK to just hard-code it into the script as is?3) The SCASM docs mention "latitude bands". How do I know if I need to deal with this issue in the code?4) Would this be of interest to others?I would be happy to share the script for testing, ...It is only designed for use with data for the northern hemisphere, 0 to -180W, so far.I will include provisions for the rest of the world if there is interest.Thanks in advance for your help.Stevewww.fs-traveler.com

Share this post


Link to post
Share on other sites

>1) Am I overlooking any SCASM issues? The script was modeled >after the output from AFW.No, looks correct to me.>2) I could find no information for the SCASM command "set ( >areamx 64 )" >Is it OK to just hard-code it into the script as is? Look in the sca_pcmd.doc file, the set commands allows you to set some thing for the compiler. Set( areamx 64 ) for example set the maximum Area size to 64 kB (default is 32). But for this small file you will not really need it.>3) The SCASM docs mention "latitude bands". How do I know if >I need to deal with this issue in the code? I don't think so, I never really used them.>4) Would this be of interest to others? I don't know. Most scenery design programs allow you to draw your flatten area there. Also, if you once have a piece of SCASM code changing the coordinates there is just as fast as making the file for your script :)Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest sgreenwood

Thanks Arno,I had overlooked that doc file. It has other interesting information as well.I got involved with this to solve a problem with KBFI runway aprons when used with my Seattle mesh. A flatten bgl solved this problem, although it does not seem to repair all such problems.I was exploring the possibility of a simple tool for folks with no interest in scenery design. I don't know if Page Cline can handle all the requests being submitted for airport repairs! I don't know how broad a solution a simple elevation correction really is. I assume these multi-vertex polygons could also be used for other features, such as lakes, airports hidden deep in the sides of mountains, ... I have not tested these yet. Such a tool might enable individuals to repair many of their annoying local issues themselves. I have modified my code to include the entire globe, but notice the order of coordinates in my header() parameter list sometimes differs from the sequence produced by Airport for Windows. I assume SCASM uses the term "top" to refer to the North Pole, and "bottom" to refer to the South Pole. (In which case some of the Airport-generated sequences I observed are "incorrect".)Do you know if SCASM really cares what order they are in? I tested my bgls, but not those created by Airport - I assume those work as well. Thanks again for your response,Steve

Share this post


Link to post
Share on other sites
Guest

Hi Steve,Interesting....your an AWK user. I assume you are using your awk script program on a Linux/UNIX based system or on a windoze based system using MKS TOOL KIT or some other windoze version AWK package.First mention of AWK I have seen in any flight forum site. If you where to offer this tool to the public.....which are mostly windoze based users, it would appear that you would have to provide them with a windoze based version of the AWK compiler or older style enterpreter. I guess they wouldn't care as long as it works. No different then other tools that have been developed on UNIX/Linux platforms and ported to windoze.cheers :-) George B.

Share this post


Link to post
Share on other sites
Guest sgreenwood

Hi George,You're right. I started using AWK and other utilities in the MKS Tool Kit years ago, when I learned how much power was missing from the DOS O/S. PERL is much more in vogue today, but I still like AWK for small tasks. This is a perfect example.There is an AWK compiler, TAWK, but it is expensive. The AWK95 interpreter seems to be available for distribution, and it supports long file names. It is only about 350k, so that is not unreasonable to include in a zip package. I don't believe I can include the scasm.exe however - license limitations. I would include the "source code", of course, so non-Windows users could run it on their own O/S version of AWK.As long as it's free and does the job, I think people will adapt. I could create a little Windows VB app, but it would be even better if someone with a compiler could create a stand-alone DOS executable. There are AWK-to-C converters, but I have no experience with them.I don't plan to go much further with this until I can confirm some level of interest. Just as I am the only visible user of AWK, I may also be the only one interested in this application!Regards,Steve

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...