Data File | Examples

AgGxTerrainImageConverter

The Terrain Image Converter, AgGxTerrainImageConverter, is a stand-alone application that converts terrain to colored image files, called terrain inlays, for 3D visualization.

Using the application

You can run AgGxTerrainImageConverter.exe from a command prompt window or from another application. The command format is:

AgGxTerrainImageConverter -i "<FileToConvert.txt>"

ArgumentDescription
-i "<input file>"

The file that you want to convert. Refer to the Data File section of this topic, below.

The MUSE Raster file format is deprecated for STK 12.8.

Data File

AgGxTerrainImageConverter requires a text file as an input argument. The text file must include the following information about the terrain files that you want to convert:

  • One or more terrain sources, demarcated by the 'Begin TerrainSourceData' and 'End TerrainSourceData' keywords.
  • A list of terrain data keywords for each terrain image that you want to create. For example, if you want to create four terrain inlays from your terrain sources, you will need to include four keyword lists in this file. Each list needs to be demarcated by the 'Begin TerrainConverterData' and 'End TerrainConverterData' keywords. The converter will select the highest resolution terrain source for the region specified in each keyword list.

Terrain Source Data

Format

Begin TerrainSourceData
  • "<terrain type>" "<terrain source full filename>" "<central body name>"
  • "<terrain type>" "<terrain source full filename>" "<central body name>"
  • .
  • .
  • .
End TerrainSourceData

Keywords

KeywordDescription
TerrainSourceData  "<terrain type>"
"<terrain source full filename>"
"<central body name>"

A terrain source that you want to convert.

<terrain type> is the file type of the source terrain data. You can use a raw terrain file or a .datt file to add terrain to the overlay that you are converting. This keyword is not required if you are creating a surface image.

<terrain source full filename> is the name and file path to the terrain source.

<central body name> is the central body associated with the converted data. If you do not specify a value, the central body will be Earth.

Terrain Converter Data

Format

Begin TerrainConverterData
  • NorthLatDeg <north lat in degrees>
  • SouthLatDeg <south lat in degrees>
  • EastLonDeg <east lon in degrees>
  • WestLonDeg <west lon in degrees>
  • NorthLat <north lat in radians>
  • SouthLat <south lat in radians>
  • EastLon <east lon in radians>
  • WestLon <west lon in radians>
  • OutputDir "<output file directory>"
  • OutputFilename "<output file name>"
  • OutputFormat {bmp | ppm | jp2 | pdttx}
  • OutputWidth <width in pixels>
  • OutputHeight <height in pixels>
  • ColorByRGB {True | False}
  • AltsFromMSL {True | False}
  • UseColorRamp {True | False}
  • SizeSameAsSrc {True | False}
  • UseRegionMinMax {True |{False}
  • MinAltHSV <alt hue saturation value>
  • MaxAltHSV <alt hue saturation value>
  • MinAltRGB <alt Red Green Blue value>
  • MaxAltRGB <alt Red Green Blue value>
  • SmoothColors {True | False}
  • CreateChunkTrn {True | False}
  • ChunkTrnVersion1 {True | False}
  • CentralBody <central body name>
  • #The following can be specified when UseColorRamp is set to false
  • Begin ExplicitAltHsvColors
  • AltHsv <alt hue saturation value>
  • AltHsv <alt hue saturation value>
  • ...
  • End ExplicitAltHsvColors
  • Begin ExplicitAltRgbColors
  • AltRgb <alt Red Green Blue>
  • AltRgb <alt Red Green Blue>
  • ...
  • End ExplicitAltRgbColors
End TerrainConverterData

Keywords

KeywordDescription
NorthLatDeg <north lat in degrees>The overall bounding geographic extent of the region that you want to convert, in degrees or radians. You must include a complete set of these keywords in the same units.
SouthLatDeg <south lat in degrees>
EastLonDeg <east lon in degrees>
WestLonDeg <west lon in degrees>
NorthLat <north lat in radians>
SouthLat <south lat in radians>
EastLon <east lon in radians>
WestLon <west lon in radians>
OutputDir "<output file directory>"The output directory.
OutputFilename "<output file name>"The name of the output file.
OutputFormat {bmp | ppm | jp2 | pdttx} The type of output file that you want to create. If you do not specify this keyword, the format will be .pdttx.
OutputWidth <width in pixels>The size of the output image. You can specify the width, the height, or both dimensions. If you do not specify one of these keywords, the output size in that dimension will be the same as the input size.
OutputHeight <height in pixels>
ColorByRGB {True | False}The color model that you want to use in the output image. To use the RGB color model, enter True. If you enter Falseor do not include this keyword, the HSV color model will be used.
AltsFromMSL {True | False}The altitude reference that you want to use for coloring elevation. To use Mean Sea Level (MSL), enter True. If you enter False or do not include this keyword, altitude will be referenced from the WGS84 ellipsoid.
UseColorRamp {True | False}

The color specification preference. To use explicit colors, enter False. If you enter True or do not include this keyword, a color ramp will be used.

The following keywords can be specified if UseColorRamp is false.
    Begin ExplicitAltHsvColors
     AltHsv <alt hue saturation value>
     AltHsv <alt hue saturation value>
     ...
    End ExplicitAltHsvColors

    Begin ExplicitAltRgbColors
     AltRgb <alt Red Green Blue>
     AltRgb <alt Red Green Blue>
     ...
    End ExplicitAltRgbColors

 
SizeSameAsSrc {True | False}The output file size preference. To allow the converter to produce a file that is a different size from the input terrain region, enter False. If you enter True or do not specify this keyword, the output file size will be the same size as the input terrain region.
UseRegionMinMax {True | False}

The color ramp boundary preference. These bounds will be used to linearly interpolate colors across the color ramp, depending on the altitude of a position.

If you want to specify the minimum and maximum altitudes of the color ramp, enter False. You can then use the MinAltHSV and MaxAltHSV or MinAltRGB and MaxAltRGB keywords to define the bounds.

If you have several terrain regions and want a consistent color scheme for them, enter the same minimum and maximum altitudes for all the regions. To ensure that the colors are the same, the range must be wide enough to handle the highest and lowest points from all the terrain regions.

If you enter True or do not specify this keyword, the minimum and maximum altitudes within the terrain region will be used as the bounds.

MinAltHSV <alt hue saturation value>

The minimum altitude for the minimum and maximum colors of the color ramp. Specify the altitude in meters. Valid values for HSV are 0 through 1.0.

This keyword is not required. The default value is 0.0 0.7 0.8 0.4.

MaxAltHSV <alt hue saturation value>

The maximum altitude for the minimum and maximum colors of the color ramp. Specify the altitude in meters. Valid values for HSV are 0 through 1.0.

This keyword is not required. The default value is 1000000.0 0.0 0.2 1.0.

MinAltRGB <alt Red Green Blue>

The minimum altitude for the minimum and maximum colors of the color ramp. Specify the altitude in meters. Valid values for RGB are 0 through 1.0.

This keyword is not required. The default value is 0.0 0.145 0.078 0.4.

MaxAltRGB <alt Red Green Blue>

The maximum altitude for the minimum and maximum colors of the color ramp. Specify the altitude in meters. Valid values for RGB are 0 through 1.0.

This keywords is not required. The default value is 1000000.0 1.0 0.8 0.8.

SmoothColors {True | False}The color smoothing preference. If you do not want colors to be interpolated from one to another, enter False. If you enter True or do not specify this keyword, colors will be smoothed.
CreateChunkTrn {True | False} The terrain file preference. If you want to generate a .pdttx terrain file, enter True. If you enter False or do not specify this keyword, a terrain file will not be generated.
ChunkTrnVersion1 {True | False}

The terrain file version preference. If you are generating a terrain file and want it to be a version 1 .pdttx file, enter True. If you enter False or do not specify this keyword, a version 2 .pdttx file will be created.

The version 2 .pdtt format supports terrain data that includes measurements less than one meter. Version 2 files cannot be loaded into versions of STK earlier than 10.

CentralBody <central body name> The central body associated with the converted data. If you do not specify this keyword, the central body will be Earth.

Example

Begin TerrainSourceData
  • "MOLA" "S:\Dev\Test_and_Release\Terrain\PlanetaryData\Mars\4PixelsPerDegree\Radius\megr90n000cb.lbl" "Mars"
  • "USGS" "C:\STKInstall\STKData\CentralBodies\Earth\Dted\nyugo.dem" "Earth"
End TerrainSourceData
Begin TerrainConverterData
  • NorthLatDeg 10.0
  • SouthLatDeg 5.0
  • EastLonDeg 10.00
  • WestLonDeg 5.00
  • OutputDir "C:\STK6xUser\BugScen\Bug26503"
  • OutputFilename "mars_mola"
  • OutputFormat pdttx
  • SizeSameAsSrc true
  • ColorByRGB false
  • UseColorRamp True
  • UseRegionMinMax True
  • AltsFromMSL False
  • CreateChunkTrn True
  • CentralBody Mars
End TerrainConverterData
Begin TerrainConverterData
  • NorthLatDeg 44.0
  • SouthLatDeg 43.0
  • EastLonDeg 20.00
  • WestLonDeg 19.00
  • OutputDir "C:\STK6xUser\BugScen\Bug26503"
  • OutputFilename "earth_dted"
  • OutputFormat pdttx
  • SizeSameAsSrc true
  • ColorByRGB false
  • UseColorRamp True
  • UseRegionMinMax True
  • AltsFromMSL False
  • CreateChunkTrn True
  • CentralBody Earth
End TerrainConverterData

Refer to the sample file for a more detailed example.