Terrain (ITerrain80)

The ITerrain80 interface exposes information about the terrain, such as the MPT file name that is being used, and information about the MPT coordinate system.

 

 

Properties

 

BestLevelWidth

Reserved. Currently not used.

BestMPP

Gets the best terrain imagery resolution.

Bottom

Gets the y-coordinate of the lower right corner of the terrain database.

CoordinateSystem

Gets an ICoordinateSystem80 representing the MPT coordinate system.

Description

Gets a user-defined description of the MPT.

Left

Gets the x-coordinate of the terrain database upper left corner.

Levels

Gets the number of levels in the terrain database.

Name

Gets a user-defined description of the local or remote MPT database.

Opacity

Gets and sets the degree of opacity of the terrain.

Right

Gets the x-coordinate of the bottom-right corner of the terrain database.

StreamQuality

Gets the stream quality level.

Top

Gets the y-coordinate of the terrain database upper left corner.

 

Methods

 

GetGroundHeightInfo

Returns the height of a given coordinate on the terrain using the given accuracy level.

BestMPP

Gets the best resolution of the terrain imagery. The lower the MPP (meters per pixel), the higher the resolution. 

JavaScript

 

BestMPP

 

C#

 

double BestMPP { get; }

 

C++

 

HRESULT BestMPP([out, retval] double* pVal)

Bottom

Gets the y-coordinate of the terrain database lower right corner.

 

JavaScript

 

Bottom

 

C#

 

double Bottom { get; }

 

C++

 

HRESULT Bottom([out, retval] double* pVal)

Description

Gets a user-defined description of the MPT.

 

JavaScript

 

Description

 

C#

 

string Description { get; }

 

C++

 

HRESULT Description([out, retval] BSTR* pVal)

Left

Gets the x-coordinate of the terrain database upper left corner.

 

JavaScript

 

Left

 

C#

 

double Left { get; }

 

C++

 

HRESULT Left([out, retval] double* pVal)

Levels

Gets the number of levels in the terrain database.

 

JavaScript

 

Levels

 

C#

 

int Levels { get; }

 

C++

 

HRESULT Levels([out, retval] long* pVal)

 

Name

Gets the name of the local or remote MPT file.

 

JavaScript

 

Name

 

C#

 

string Name { get; }

 

C++

 

HRESULT Name([out, retval] BSTR* pVal)

Opacity

Gets and sets the degree of opacity of the terrain. This value can be any value between 0.1 for almost-transparent and 1 for opaque.

 

JavaScript

 

Opacity

 

C#

 

double Opacity { get; set; }

 

C++

 

HRESULT Opacity([out, retval] double* Opacity)

HRESULT Opacity([in] double Opacity)

Right

Gets the x-coordinate of the bottom-right corner of the terrain database.

 

JavaScript

 

Right

 

C#

 

double Right { get; }

 

C++

 

HRESULT Right([out, retval] double* pVal)

StreamQuality

Gets the stream quality level.

 

JavaScript

 

StreamQuality

 

C#

 

int StreamQuality { get; }

 

C++

 

HRESULT StreamQuality([out, retval] long* pVal)

Top

Gets the y-coordinate of the terrain database upper left corner.

 

JavaScript

 

Top

 

C#

 

double Top { get; }

 

C++

 

HRESULT Top([out, retval] double* pVal)

GetGroundHeightInfo

The GetGroundHeight method returns the height of a given coordinate on the terrain using the given accuracy level. If there is an object, derived from ITerrainObject80 with the GroundObject property set to TRUE, at the selected coordinate and the IncludeGroundObject parameter is set to TRUE in this method, the method returns the ObjectID of the object, and its height at the coordinate.

 

JavaScript

 

GetGroundHeightInfo(

       X,

       Y,

       Level,

       IncludeGroundObject)

 

C#

 

IWorldPointInfo80 GetGroundHeightInfo(

       double X,

       double Y,

       AccuracyLevel Level,

       bool IncludeGroundObject = true)

 

C++

 

HRESULT GetGroundHeightInfo(

       double X,

       double Y,

       AccuracyLevel Level,

       VARIANT_BOOL IncludeGroundObject,

       IWorldPointInfo80 ** pWorldPointInfo) 

 

Parameters

X

The West-East coordinate of the point of interest represented in coordinate system units.

Y

The North-South coordinate of the point of interest represented in coordinate system units.

Level

Defines the level of accuracy that you need for the retrieved elevation at the given coordinate. There are three levels possible from the least accurate (but fastest performance-wise) to the most accurate (but slowest performance-wise). The following are the three possible values:

·          ACCURACY_FORCE_BEST_RENDERED = 2
This is the slowest method, but it returns the most accurate information. Using this flag can create a large performance hit especially if the terrain information is streamed via an Internet connection.

·          ACCURACY_BEST_FROM_MEMORY = 1
This flag tries to get the best information it has about the given coordinate elevation without reading it directly from the MPT (based on what TerraExplorer already has in memory). It is faster than the previous flag but does not guarantee the most accurate value.

·          ACCURACY_NORMAL = 0
With this flag, the client gets the best performance. However, its returned information about the elevation at that point is the least accurate.

IncludeGroundObject

If this parameter is set to TRUE and there is an object, derived from ITerrainObject80 with the GroundObject property set to TRUE, at the selected coordinate, the method returns the ObjectID of the object, and its height at the coordinate.

Return Value

pWorldPointInfo

An IWorldPointInfo80 representing information about the given coordinate.

Exceptions

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