CreateElevationLayer

Loads an elevation layer into the project. Adding the elevation source uses a set of plugins that support multiple file formats. The coordinates of the source can be passed via the UpperLeftX/Y and LowerRightX/Y parameters. If all four coordinate field values are zero, the coordinate information, if available, is read from the file. If the source file coordinate system is not the same as the MPT file Terrain Coordinate system, you can reproject it using ITerrainRasterLayer66. CoordinateSystem.

 

JavaScript

 

CreateElevationLayer(

       ElevationFileName,

       UpperLeftX,

       UpperLeftY,

       LowerRightX,

       LowerRightY,

       InitParam,

       PlugName,

       GroupID,

       Description,

       HScale,

       HOffset )

 

C#

 

ITerrainRasterLayer66 CreateElevationLayer(

       string        ElevationFileName,

       double        UpperLeftX,

       double        UpperLeftY,

       double        LowerRightX,

       double        LowerRightY,

       [object       InitParam = 0],

       [object       PlugName = ""],

       [string       GroupID = ""],

       [string       Description = ""],

       [double       HScale = 1],

       [double       HOffset = 0])

 

C++

 

HRESULT CreateElevationLayer(

        BSTR         ElevationFileName,

        double       UpperLeftX,

        double       UpperLeftY,

        double       LowerRightX,

        double       LowerRightY,

        VARIANT      InitParam,

        VARIANT      PlugName,

        BSTR         GroupID,

        BSTR         Description,

        double       HScale,

        double       HOffset,

        ITerrainRasterLayer66 **  pITerrainRasterLayer66) 

 

Parameters

ElevationFileName

A full path name to the elevation to import to the terrain.

UpperLeftX

The West-East coordinate of the elevation layer’s upper left corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

UpperLeftY

The North-South coordinate of the elevation layer’s upper left corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

LowerRightX

The West-East coordinate of the elevation lower right corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

LowerRightY

The North-South coordinate of the elevation lower right corner in the project’s coordinate system units. If all four coordinate field values are zero, the coordinate information, if available, is read from the file.

InitParam

Reserved. Always pass null for this parameter.

PlugName

The name of the plugin used to read the file, e.g., “tifplg.rct“. The available plugins are files with RCT extension that exist in the “TBPlugs directory. If an empty string is passed into this parameter, the default plugin for the file type is used.

GroupID

The Project Tree group in which the elevation layer is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree66.CreateGroup.

·          Find the group, if you know the name, using IProjectTree66.FindItem.

·          Traverse the Tree using IProjectTree66 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the elevation layer as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

HScale

The scale factor for the elevation value.

HOffset

The offset for the elevation value.

Return Value

pITerrainRasterLayer66

An ITerrainRasterLayer66, representing the newly created elevation layer.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.