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
Parameters
See Also
Example
Gets the altitude profile of the terrain.
| [C#] |
|---|
IAgScenario scenario = (IAgScenario)root.CurrentScenario;
// If you haven't done so, add the terrain to your scenario (for example .PDTT)
IAgCentralBodyTerrainCollectionElement earthTerrain = scenario.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.