Modifying airport elevation

From FSDeveloper Wiki
Revision as of 01:14, 5 July 2008 by Arno (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There are at least some cases in FS X where the elevation of an airport in the default scenery does not match the elevation given in more or less official documents like aviation databases or government sources. If this difference is more than a few feet and you want to improve the situation, you will face three different jobs: - adjustment of the mesh; - adjustment of the airport background; - adjustment of the airport.


Adjustment of the mesh

With some possible exceptions the airport elevation in the FS X scenery files matches the elevation of the surrounding terrain. Thus there would be no point in correcting the airport without having the mesh corrected too. It is beyond the scope of this article to explain how you can produce a more correct mesh; I asssume that you are able to download a better suited mesh from one of the usual fs sites (if you have not already done one yourself). After you have installed that corrected mesh your airport will either sit on a mesa-like mountain or in a deep hole - depending on whether it was situated too low or too high.

Making a new airport background

In FS X you will have to make a new cvx*.bgl file to adjust the airport background. In order to obtain that file you have to make a group of shapefiles as input for the program shp2vec.exe which you find in the FS X SDK. At present there are essentially two utilities which will help you to produce these shapefiles: you can either use FSX KML for which you can find a manual in this Wiki or you can use xml2shp.exe which you can find as an attachement in a thread in the SceneryDesign section of this site. Since the latter program is new and less well known, I will explain here how to proceed. First of all you will have to obtain the coordinates of the vertices of the airport background. You can do this either by drawing a polygon in GoogleEarth and saving it as a kml file or by using the slew mode of FS X, going with your plane to the corners of the airport background and noting down the longitude and latitude of each point, or by opening TmfViewer, going to the location of the airport, finding th yellow rectangle that is the airport background and identifying the corner points with your mouse pointer. The last method has the advantage that at the same time by rightclicking with the mouse on the yellow rectangle you will get the GUID which MS used for the airport background. As an exemple I will take Jundiai airport in Brazil (SDJD): the guid is {46BFB3BD-CE68-418E-8112-FEBA17428ACE}, the corners are at -46.9507,-231728 -46.9480,-23.1715 -46.9366,-23.1904 -46.9393,-23.1917 Since you need 5 points for a rectangle (the last one must be identical with the first one), your sourcecode file should look like this:

  <shapes>
  <exclusion>
  <guid>{359C73E8-06BE-4FB2-ABCB-EC942F7761D0}</guid>
  <coordinates>
  -46.9507,-231728,0 -46.9480,-23.1715,0 -46.9366,-23.1904,0 
  -46.9393,-23.1917,0 -46.9507,-231728,0
  </coordinates>
  </exclusion>
  <airportBounds>
  <guid>{46BFB3BD-CE68-418E-8112-FEBA17428ACE}</guid>
  <coordinates>
  -46.9507,-231728,757.1 -46.9480,-23.1715,757.1 -46.9366,-23.1904,757.1 
  -46.9393,-23.1917,757.1 -46.9507,-231728,757.1
  </coordinates>
  </airportBounds>
  </shapes>

Save it as SDJD.xml and call the xml2shp program: xml2shp SDJD.xml. You should obtain 8 files, 4 with EXXSDJD.* and 4 with FLXSDJD.*

Now you can call shp2vec in the usual way to obtain a cvxsdjd.bgl file which you can put in your addon scenery folder.

Adjusting the airport

Since there is still no AFCAD for FS X, you have to edit the airport file manually. In order to do that, you have to disassemble the relevant MS scenery file (in this case APX35400.bgl) with the BglAnalyzeX program to be found at AVSIM or in a seperate thread on this site. Open the resulting xml file with a text editor and search for the string with the ICAO identifier and copy everything from the line with the identifier to the closing </Airport> (before the next airport starts). Copy the first few lines of the file too (until and including the line beginning with xsi:), put them in the beginning of the new file and do not forget to add a </FSData> tag at the end of the file. Just after the initial part of the <Airport, i.e. after the line with the "magvar" property as the first word) add the following lines:

 <DeleteAirport
   deleteAllApronLights="TRUE"
   deleteAllAprons="TRUE"
   deleteAllFrequencies="TRUE"
   deleteAllHelipads="TRUE"
   deleteAllRunways="TRUE"
   deleteAllStarts="TRUE"
   deleteAllTaxiways="TRUE"
   />

Then you have to change the values alt= in the initial section, in every Runway section and in every Start section to reflect the correct value. After saving the file (I would suggest to use a similar convention as with AFCAD, i.e. to call the file AFX***.xml) you can compile it with bglcomp and put the resulting AFX***.bgl file into your addon folder. That is all. There should be no problems with AI traffic or approaches if you proceed like this.

There are now two new tools to enable disassembly and editing of stock airport files. These are Jon Masterson's excellent SDE application which disassembles FSX .bgl files. This can also save an airport as an XML file, using a graphic interface (GUI). The app is available from www.scruffyduckscenery.co.uk

There are two applications available currently to edit airports (graphically) - again Jon Masterson has produced ADE, which is still in development but avilable from www.scruffyduckscenery.co.uk and FSXPlanner (zblue software). The latter (at present) opens xml files created with SDE - and hence requires decompiling.

You will still need to flatten/exclude_autogen +/- mask classmap using a tool like FSX_KML if there is any significant disparity between surrounding scenery and your airport height, or if a larger flattened area than the immediate airport is required.