Combat Flight Simulator 3

Terrain SDK
ERS Header file data
.

The CFS3 Terrain SDK tool "ers2tiff" can be used with any normal binary DEM formats. All that is required is a correctly formed .ERS header file to let the tool know how to interpret the data.

Just copy and paste the text between the ===== lines below into notepad, edit the necessary sections and save it with the extension .ERS
Then rename your DEM file so it is the same name as the ERS file but without any extension.
For example if you save the file as "myterrain.ers" then you need to rename the dem file to "myterrain"

The header and dem file should both be in the same folder. Because of the huge numbers of files created by ers2tiff and tiff2msh it is a good idea to create a seperate folder for each project. The default theatre uses nearly 3000 MSH files. If you create a similar sized area at maximum resolution you will see a similar number of files created by tiff2msh.

===========================================================
DatasetHeader Begin
Version = "5.5"
LastUpdated = Mon Oct 05 18:20:54 GMT 1998
DataSetType = ERStorage
DataType = Raster
ByteOrder = MSBFirst
CoordinateSpace Begin
Datum = "WGS84"
Projection = "GEODETIC"
CoordinateType = EN
Rotation = 0:0:0.0
CoordinateSpace End
RasterInfo Begin
CellType = Unsigned16BitInteger
NullCellValue = -9999
CellInfo Begin
Xdimension = 0.001111
Ydimension = 0.001111
CellInfo End
NrOfLines = 15300
NrOfCellsPerLine = 23400
RegistrationCoord Begin
Eastings = -85.000000
Northings = 27.000000
RegistrationCoord End
NrOfBands = 1
BandId Begin
Value = "Pseudo Layer"
BandId End
RasterInfo End
DatasetHeader End
===========================================================
Many of the entries are ignored by ers2tiff. They are just there because they are part of the particular ERS data used by the developers. The only ones that really matter are the ones you need to change. All the others can be left as they are.

The entries you need to change to suit the particular DEM data you are using are :-

ByteOrder =

This can be either MSBFirst or LSBFirst. The info that came with your dem should tell you which it is but the rough rule is USGS data is usually MSBFirst (GTOP030, SRTM, BIL etc) while dems exported from FSTerrain will be LSBFirst. If in doubt use MSBFirst and if you get an error like "Elevation found higher than maximum" when running ers2tiff then try the other.

CellType =

This depends on the dem. Most dems use 16 bit values. Some use 8 bit.
The allowed values are Unsigned16BitInteger, Signed16BitInteger, Unsigned8BitInteger, Signed8BitInteger.
Assume Unsigned16BitInteger unless the data with your dem indicates otherwise. If you know that your dem contains areas below sea level (depressions) then you should use Signed16BitInteger as there will be negative elevations in these areas. Note that BIL data will usually be 16bit but if all elevations are below 256m then you may get supplied 8bit dem data. There may be other dem formats that use similar space-saving when all the elevations would fit into single bytes.


XDimension =
YDimension =

These are the distances (in degrees) between adjacent elevation points in the source dem.
Anyone who has worked with the FS2000/2002 terrain tools will know how to calculate these but for 30 second dem both will be 0.008333333333. Most dem data will have the same distance between elevations in both vertical (Y) and horizontal (X) directions. There are some (like some DTED0 data I have seen) that can have different spacing in each direction but this is much less common.

Eastings =
Northings =

These specify the top-left corner of your dem data. Eastings is the Longitude and Northings is the Latitude. Value is in decimal degrees. As usual West and South are negative numbers while East and North are positive.

NrOfLines =

This is the number of rows of elevation data in your dem.

NrOfCellsPerLine =

This is the number of columns of elevation data in your dem.

Many of these entries are similar to the entries required in the INF files for creating FS2002 or CFS2 terrain with the FS Terrain SDK. If you haven`t already then it is helpful to look at the INF example in the docs for the FS2002 Terrain sdk. In some ways it is easier to think of the ERS header as the CFS3 equivalent of the INF file.

Most dem downloads include HDR or other text files that give useful descriptive info about the dem parameters. Check any accompanying files and you will probably find many values that can be directly used with the ERS header entries. Most will provide information about the Byte Order, Cell Size, Cell Dimensions and number of rows & columns. These values can in most cases be used directly in the ERS header.

***Disclaimer***


The Developers only supplied the sample ERS header. Everything else here is my interpretation of how the information can be used. I have tested it and it works to the extent of creating the expected MSH files with the expected range of elevations. Any mistakes or incorrect guesses are all down to me.

Because there is much more to creating a new theatre than just the Mesh it is not possible to actually check the results in CFS3. It is not clear at this stage just how much of a theatre has to be created before it can be tested in action. At the very least I would expect it needs the Landclasses defined and probably some of the other theatre aspects. This document is just to help people get over the initial hurdle of creating valid Mesh data.