I have a .NET based mapping application used by pilots, and we need to add terrain awareness to this application. For example, I need to highlight terrain at or above certain altitudes, and create an altitude profile for a flight plan.
I need someone who has experience implementing GIS and terrain solutions to create a class that can compile a terrain data file from raw data, and query the file for altitude information.
The best technology to use for this solution would (I think) be a Triangulated Irregular Network, more info here: <[login to view URL]~good/176b/[login to view URL]>. However I'm open to suggestions for an alternative solution.
Below, I've provided the stub class that needs to be completed.
The solution must be optimized for performance and memory usage. Total runtime usage cannot exceed 100k, therefore the entire terrain database will never be fully loaded into RAM. The solution will need to efficiently walk through the data file to find the appropriate information.
## Deliverables
Here is the proposed class stub that should be filled in with actual code. The raw data files can be downloaded (links in the code below).
namespace TerrainTestbed
{
public class TerrainEngine
{
public [login to view URL] TerrainDataFile;
/// <summary>
/// Compiles the Terrain Data File from the raw text files. Raw data will be coming from this source:
/// [login to view URL]
/// [login to view URL]
/// [login to view URL]
/// [login to view URL]
/// [login to view URL]
/// [login to view URL]
/// (just click the link following "Download data for tile" on each of these pages)
/// </summary>
/// <param name="dataFilePath"></param>
/// /// <param name="verticalToleranceMeters">Defines the acceptable margin of error relative to the lowest altitude being stored
/// for any given point in the compiled data. Encoded points must be biased to the highest altitude within the defined area. In other words,
/// if requesting an altitude at a given point, the result may be up to [verticalToleranceMeters] higher than the actual point.
/// However it can NEVER be lower than the actual point</param>
public void Compile(string dataFilePath, int verticalToleranceMeters)
{
}
/// <summary>
/// Returns a list of geoPoint3d objects that represents an altitude profile
/// for a great circle line drawn from pointA to pointB. The number of points
/// is determined by the resolutionMeters, each point represents the maximum
/// altitude for that section of the line
/// </summary>
/// <param name="pointA">starting line point</param>
/// <param name="pointB">ending line point</param>
/// <param name="resolutionMeters">defines the distance in meters between each returned geopoint</param>
/// <returns></returns>
public List<GeoPoint3d> GetAltitudeProfile(GeoPoint pointA, GeoPoint pointB, int resolutionMeters)
{
return null;
}
/// <summary>
/// Returns the altitude for the provided point
/// </summary>
/// <param name="latRadians"></param>
/// <param name="lonRadians"></param>
/// <returns></returns>
public int GetAltitude(GeoPoint geoPoint)
{
return 0;
}
/// <summary>
/// Returns a list of GeoPoly3d objects that define the areas at or above [altitudeMeters], in the
/// area defined by a rectangle with corners of [topLeft] / [bottomRight]
/// </summary>
/// <param name="topLeft"></param>
/// <param name="bottomRight"></param>
/// <param name="altitudeMeters"></param>
/// <returns></returns>
public List<GeoPoly3d> GetAreaAlerts(GeoPoint topLeft, GeoPoint bottomRight, int altitudeMeters)
{
return null;
}
}
public class GeoPoint
{
public double LatRadians;
public double LonRadians;
}
public class GeoPoint3d: GeoPoint
{
public int AltitudeMeters;
}
public class GeoPoly3d
{
public List<GeoPoint3d> Points;
}
}