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 ITerrainObject66 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# |
|
IWorldPointInfo66 GetGroundHeightInfo( double X, double Y, AccuracyLevel Level, [bool IncludeGroundObject = true]) |
C++ |
|
HRESULT GetGroundHeightInfo( double X, double Y, AccuracyLevel Level, VARIANT_BOOL IncludeGroundObject, IWorldPointInfo66 ** 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 ITerrainObject66 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 IWorldPointInfo66 representing information about the given coordinate.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.