Description
Returns the altitudes at the specified
position array.
Syntax
[Visual Basic .NET] |
Public Function GetAltitudeBatch( _
ByRef LatLons As System.Array, _
ByVal AltRef As AgEAltRefType _
) As System.Array
|
Parameters
Example
Gets the altitude of
the terrain at a single location and in batches.
[C#] |
Copy Code
|
IAgScenario scneario = (IAgScenario)root.CurrentScenario;
IAgCentralBodyTerrainCollectionElement earthTerrain = scneario.Terrain["Earth"];
earthTerrain.TerrainCollection.Add(terrainFile, AgETerrainFileType.ePDTTTerrainFile);
double altitude = earthTerrain.GetAltitude(latitude, longitude, AgEAltRefType.eMSL);
Array specifiedPositions = new object[,]
{
{ 40.0386, -75.5966 },
{ 28.5383, -81.3792 },
{ 37.7749, -122.4194 }
};
Array altitudes = earthTerrain.GetAltitudeBatch(ref specifiedPositions, AgEAltRefType.eWGS84);
int numPoints = altitudes.GetLength(0);
for (int i = 0; i < numPoints; ++i)
{
Console.WriteLine("Latitude={0}, Longitude={1}, Altitude={2}", specifiedPositions.GetValue(i, 0), specifiedPositions.GetValue(i, 1), altitudes.GetValue(i));
}
|
|
Gets the altitude of
the terrain at a single location and in batches.
[Visual Basic .NET] |
Copy Code
|
Dim scneario As
IAgScenario = DirectCast(root.CurrentScenario, IAgScenario)
Dim earthTerrain As IAgCentralBodyTerrainCollectionElement =
scneario.Terrain("Earth")
earthTerrain.TerrainCollection.Add(terrainFile,
AgETerrainFileType.ePDTTTerrainFile)
Dim altitude As Double =
earthTerrain.GetAltitude(latitude, longitude,
AgEAltRefType.eMSL)
#If Not CSToJava Then
#Else
#End If
Dim specifiedPositions As Array =
New Object(,) {{40.0386, -75.5966}, {28.5383,
-81.3792}, {37.7749, -122.4194}}
#If Not CSToJava Then
Dim altitudes As Array =
earthTerrain.GetAltitudeBatch(specifiedPositions,
AgEAltRefType.eWGS84)
#Else
#End If
Dim numPoints As Integer =
altitudes.GetLength(0)
Dim i As
Integer = 0
While i < numPoints
Console.WriteLine("Latitude={0}, Longitude={1}, Altitude={2}",
specifiedPositions.GetValue(i, 0), specifiedPositions.GetValue(i,
1), altitudes.GetValue(i))
System.Threading.Interlocked.Increment(i)
End While
|
|
See Also