Description
Returns the terrain altitude profile at the specified resolution.
Syntax
Parameters
Example
Gets the altitude profile of the terrain.
[C#] | Copy Code |
---|
IAgScenario scneario = (IAgScenario)root.CurrentScenario;
IAgCentralBodyTerrainCollectionElement earthTerrain = scneario.Terrain["Earth"];
IAgTerrain terrain = earthTerrain.TerrainCollection.Add(terrainFile, AgETerrainFileType.ePDTTTerrainFile);
Array terrainProfile = earthTerrain.GetAltitudesBetweenPointsAtResolution(terrain.SWLatitude, terrain.SWLongitude, terrain.NELatitude, terrain.NELongitude, terrain.Resolution, AgEDistanceOnSphere.eDistanceOnSphereGreatCircle, AgEAltRefType.eMSL);
int numPoints = terrainProfile.GetLength(0);
for (int i = 0; i < numPoints; ++i)
{
Console.WriteLine("Latitude={0}, Longitude={1}, Altitude={2}", terrainProfile.GetValue(i, 0), terrainProfile.GetValue(i, 1), terrainProfile.GetValue(i, 2));
}
|
|
Gets the altitude profile of the terrain.
[Visual Basic .NET] | Copy Code |
---|
Dim scneario As IAgScenario = DirectCast(root.CurrentScenario, IAgScenario)
Dim earthTerrain As IAgCentralBodyTerrainCollectionElement = scneario.Terrain("Earth") Dim terrain As IAgTerrain = earthTerrain.TerrainCollection.Add(terrainFile, AgETerrainFileType.ePDTTTerrainFile)
Dim terrainProfile As Array = earthTerrain.GetAltitudesBetweenPointsAtResolution(terrain.SWLatitude, terrain.SWLongitude, terrain.NELatitude, terrain.NELongitude, terrain.Resolution, AgEDistanceOnSphere.eDistanceOnSphereGreatCircle, _ AgEAltRefType.eMSL)
Dim numPoints As Integer = terrainProfile.GetLength(0) Dim i As Integer = 0 While i < numPoints Console.WriteLine("Latitude={0}, Longitude={1}, Altitude={2}", terrainProfile.GetValue(i, 0), terrainProfile.GetValue(i, 1), terrainProfile.GetValue(i, 2)) System.Threading.Interlocked.Increment(i) End While
|
|
See Also