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






Windows & Linux

Description

Returns the terrain profile at the specified resolution relative to the input reference surface. If a position along the profile is outside terrain sources, the altitude of 0.0 relative to the default reference ellipsoid (WGS84 for Earth) is used.

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
MemberValueDescription
eDistanceOnSphereGreatCircle0Shortest distance between two points on the globe.
eDistanceOnSphereRhumbLine1Lines of constant bearing.
AltRef
MemberValueDescription
eMSL0Reference the altitude to Mean Sea Level.
eTerrain1Reference the altitude to terrain.
eWGS842WGS84: reference the altitude to the central body's reference ellipsoid.
eEllipsoid3Ellipsoid: 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); 
 
// GetAltitudesBetweenPointsAtResolution 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)

' GetAltitudesBetweenPointsAtResolution 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

© 2018 Analytical Graphics, Inc. All Rights Reserved.