Elevation data: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 27: Line 27:
</source>
</source>


The format of this elevation data template is described [[Elevation_layers_in_templates#Elevation_data_layers|here]]
The format of this elevation data template is described here: [[Elevation_layers_in_templates#Elevation_data_layers|Elevation layers in templates]]
 
<source lang="c#">
        /// <summary>
        /// Generalized API for elevation queries.
        /// </summary>
        /// <param name="lat">Latitude of the query point</param>
        /// <param name="lon">Longitude of the query point</param>
        /// <param name="queryParams">Parameters for the elevation query.</param>
        /// <returns>An ElevationResult containing the elevation and resolution of the source data</returns>
        ElevationResult CalcElevation(double lat, double lon, ElevationQueryParams queryParams);
 
        /// <summary>
        /// Calculate multiple elevations for a given point.
        /// </summary>
        /// <param name="lat">Latitude of the query point</param>
        /// <param name="lon">Longitude of the query point</param>
        /// <param name="queryParams">Parameters for the elevation query.</param>
        /// <returns>
        /// A list of ElevationResults containing the elevation and resolution of each layer in the source data.
        /// To get further info on each of the layers, you can look up the matching ElevationDataSource entry in
        /// IElevationDataManager.
        /// </returns>
        List<ElevationResult> CalcElevations(double lat, double lon, ElevationQueryParams queryParams);
</source>





Revision as of 10:23, 22 December 2021

Elevation data and other single channel data can be used for various analysis and visualization purposes throughout the Maria system. This page shows an overview of the elevation data programming API's

The two main interfaces for elevation data are IElevationData (implemented by the NativeElevationData class) and IElevationDataManager (implemented by ElevationDataManager).

IElevationData

This interface contains methods for querying elevation data from a set of data layers.

Data layers

An elevation data set consists of one or more elevation data map entries stored on a Maria raster data service. The set of available map entries can be queried from the catalog service and any MapEntry with MapContentType = ElevationData can be used.

The elevation data layers are usually managed by the ElevationDataManager, but you can also specify them explicitly through a MapTemplate with the SetTemplate method

        /// <summary>
        /// Setup elevation data layers from the given template.
        /// This method will clear the current elevation data set.
        /// </summary>
        void SetTemplate(MapTemplate template);

        /// <summary>
        /// Get the currently active elevation data template.
        /// </summary>
        /// <returns></returns>
        MapTemplate GetTemplate();

The format of this elevation data template is described here: Elevation layers in templates

        /// <summary>
        /// Generalized API for elevation queries.
        /// </summary>
        /// <param name="lat">Latitude of the query point</param>
        /// <param name="lon">Longitude of the query point</param>
        /// <param name="queryParams">Parameters for the elevation query.</param>
        /// <returns>An ElevationResult containing the elevation and resolution of the source data</returns>
        ElevationResult CalcElevation(double lat, double lon, ElevationQueryParams queryParams);

        /// <summary>
        /// Calculate multiple elevations for a given point.
        /// </summary>
        /// <param name="lat">Latitude of the query point</param>
        /// <param name="lon">Longitude of the query point</param>
        /// <param name="queryParams">Parameters for the elevation query.</param>
        /// <returns>
        /// A list of ElevationResults containing the elevation and resolution of each layer in the source data. 
        /// To get further info on each of the layers, you can look up the matching ElevationDataSource entry in 
        /// IElevationDataManager.
        /// </returns>
        List<ElevationResult> CalcElevations(double lat, double lon, ElevationQueryParams queryParams);


Elevation queries

The main purpose of the IElevationData interface is to calculate elevation values in a certain geographical point or area. The following methods are supported for this:



Note on async methods

The IElevationData interface currently contains a set of methods with Async in their names which return Task objects. We don't really recommend using these, and they may be obsoleted in a future version. Instead, wrap any time consuming elevation methods in your own async caller method to have better control over these operations.