AGI STK Objects 11 Send comments on this topic.
GetAltitudesBetweenPointsAtResolution Method (IAgCentralBodyTerrainCollectionElement)
See Also  Example
SWLatitude
SWLongitude
NELatitude
NELongitude
StepSize
DistanceType
AltRef





Description

Returns the terrain altitude profile at the specified resolution.

Syntax

[Visual Basic .NET]
Public Function GetAltitudesBetweenPointsAtResolution( _
   ByVal SWLatitude As System.Object, _
   ByVal SWLongitude As System.Object, _
   ByVal NELatitude As System.Object, _
   ByVal NELongitude As System.Object, _
   ByVal StepSize As System.Object, _
   ByVal DistanceType As AgEDistanceOnSphere, _
   ByVal AltRef As AgEAltRefType _
) As System.Array

[C#]
public System.Array GetAltitudesBetweenPointsAtResolution(
System.Object SWLatitude,
System.Object SWLongitude,
System.Object NELatitude,
System.Object NELongitude,
System.Object StepSize,
AgEDistanceOnSphere DistanceType,
AgEAltRefType AltRef
);

[Managed C++]
public: System::Array GetAltitudesBetweenPointsAtResolution(
VARIANT SWLatitude,
VARIANT SWLongitude,
VARIANT NELatitude,
VARIANT NELongitude,
VARIANT StepSize,
AgEDistanceOnSphere DistanceType,
AgEAltRefType AltRef
);

[Java]
public Object[] getAltitudesBetweenPointsAtResolution(
Variant SWLatitude,
Variant SWLongitude,
Variant NELatitude,
Variant NELongitude,
Variant StepSize,
AgEDistanceOnSphere DistanceType,
AgEAltRefType AltRef
);

[Unmanaged C++]
public: HRESULT GetAltitudesBetweenPointsAtResolution(
VARIANT SWLatitude,
VARIANT SWLongitude,
VARIANT NELatitude,
VARIANT NELongitude,
VARIANT StepSize,
AgEDistanceOnSphere DistanceType,
AgEAltRefType AltRef,
SAFEARRAY ** Array
);

Parameters

SWLatitude
SWLongitude
NELatitude
NELongitude
StepSize
DistanceType
Member Value Description
eDistanceOnSphereGreatCircle 0 Shortest distance between two points on the globe.
eDistanceOnSphereRhumbLine 1 Lines of constant bearing.
AltRef
Member Value Description
eMSL 0 Reference the altitude to Mean Sea Level.
eTerrain 1 Reference the altitude to terrain.
eWGS84 2 WGS84: reference the altitude to the central body's reference ellipsoid.
eEllipsoid 3 Ellipsoid: reference the altitude to the central body's reference ellipsoid(non-Earth).

Example

Gets the altitude profile of the terrain.
[C#] Copy Code
IAgScenario scneario = (IAgScenario)root.CurrentScenario; 
 
// If you haven't done so, add the terrain to your scenario (for example .PDTT) 
IAgCentralBodyTerrainCollectionElement earthTerrain = scneario.Terrain["Earth"]; 
IAgTerrain terrain = earthTerrain.TerrainCollection.Add(terrainFile, AgETerrainFileType.ePDTTTerrainFile); 
 
// Get diagonal altitude profile using the max resolution of the terrain file. 
Array terrainProfile = earthTerrain.GetAltitudesBetweenPointsAtResolution(terrain.SWLatitude, terrain.SWLongitude, terrain.NELatitude, terrain.NELongitude, terrain.Resolution, AgEDistanceOnSphere.eDistanceOnSphereGreatCircle, AgEAltRefType.eMSL); 
 
// GetAltitudeProfile returns a two dimensional array of lat lon alt values. 
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)

' If you haven't done so, add the terrain to your scenario (for example .PDTT)
Dim earthTerrain As IAgCentralBodyTerrainCollectionElement = scneario.Terrain("Earth")
Dim terrain As IAgTerrain = earthTerrain.TerrainCollection.Add(terrainFile, AgETerrainFileType.ePDTTTerrainFile)

' Get diagonal altitude profile using the max resolution of the terrain file.
Dim terrainProfile As Array = earthTerrain.GetAltitudesBetweenPointsAtResolution(terrain.SWLatitude, terrain.SWLongitude, terrain.NELatitude, terrain.NELongitude, terrain.Resolution, AgEDistanceOnSphere.eDistanceOnSphereGreatCircle, _
    AgEAltRefType.eMSL)

' GetAltitudeProfile returns a two dimensional array of lat lon alt values.
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

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1