tmm_elev_profile_get()
Note: Requires Terrain Modeling Module functionality
Abstract
Returns the terrain height at specified intervals along a path.
Syntax
tmm_elev_profile_get (point1_ptr, point2_ptr, meters_between_samples)
| Argument | Type | Description |
|---|---|---|
point1_ptr |
const TmmT_Position * |
pointer to the first position This argument uses the latitude and longitude fields of the TmmT_Position data structure to specify a point. The elevation field is not used. |
point2_ptr |
const TmmT_Position * |
pointer to the second position This argument uses the latitude and longitude fields of the TmmT_Position data structure to specify a point. The elevation field is not used. |
meters_between_samples |
float |
desired spacing of elevation values along the specified path, or TMMC_RESOLUTION_BEST. |
Return Value
TmmT_Elev_Profile *
Pointer to a terrain profile data structure.
Header
tmm.h
Example
elevation_profile_ptr = tmm_elev_profile_get (tx_pos_ptr, rx_pos_ptr, TMMC_RESOLUTION_BEST);
if ((elevation_profile_ptr == OPC_NIL) ||
(elevation_profile_ptr->data_status != TmmC_Elev_Data_All_Good))
{
/* No terrain */
/* Use freespace */
power_freespace (pkptr);
}
Details
A call to this function is identical to calling Tmm_Elev_Profile_Get_With_Dist() with the lat_dist and lon_dist arguments specified as VOSC_NIL.
Purpose
This function returns the data necessary to specify a terrain profile along the line connecting two points. Elevations are given at equally spaced intervals along the path.
Errors
- The terrain data directory (
<name>) is invalid. Unable to open terrain file.
Reference
- Use the function tmm_elev_point_get() to obtain the height of the terrain at a specified point.
- Use the function tmm_elev_profile_destroy() to destroy the profile data array.