Home > Working with SGWorld > Terrain (ITerrain6) > 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 ITerrainObject6 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# |
|
IWorldPointInfo6 GetGroundHeightInfo( double X, double Y, AccuracyLevel Level, bool IncludeGroundObject = true) |
C++ |
|
HRESULT GetGroundHeightInfo( double X, double Y, AccuracyLevel Level, VARIANT_BOOL IncludeGroundObject, IWorldPointInfo6 ** pWorldPointInfo) |
Parameters
X
The West-East coordinate of the point of interest represented in coordinate system units. You can use the other ITerrain properties to retrieve information about the coordinate system units.
Y
The North-South coordinate of the point of interest represented in coordinate system units. You can use the other ITerrain properties to retrieve information about the 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_BEST_FROM_MPT = 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 ITerrainObject6 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 IWorldPointInfo6 representing information about the given coordinate.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.