![]() |
Maria GDK 5.0.0.738
Documentation of native code in develop branch
|
#include <MElevationData.h>
Public Member Functions | |
ElevationData (std::shared_ptr< SystemTicker > systemTicker, std::shared_ptr< TileCacheManager > tileCacheMgr) | |
bool | initFromTemplate (const MapTemplate &tpl) |
Add layers from the given template. | |
ElevationResult | calcElevation (const BasicGeoTypes::GeoPos &gp, InterpolationMethod interpolationMethod, double resolution=0.0, long timeout_ms=0, ElevationDataType queryType=ElevationDataType::Undefined) |
Calculate the elevation in a geographical point. This method will calculate the elevation in a given point given certain query parameters. The method will block until a result is given or the timeout limit is reached. | |
ElevationResult | calcElevation (const BasicGeoTypes::GeoPos &gp, const ElevationQueryParams &query) |
std::vector< ElevationResult > | calcElevations (const BasicGeoTypes::GeoPos &gp, const ElevationQueryParams &query) |
bool | calcElevation (const BasicGeoTypes::GeoPos &gp, InterpolationMethod interpolationMethod, double &value, double resolution=0.0, long timeout_ms=0) |
Calculate the elevation in a geographical point. This simplified method will calculate the elevation in a given point given certain query parameters. The method will block until a result is given or the timeout limit is reached. Use the ElevationResult version of this method if you need more control of the data result. | |
int | getNumElevationLayers () const |
Get number of elevation data layers available. | |
void | clearLayers () |
Clear all data layers. | |
bool | getMaxResolution (const BasicGeoTypes::GeoPos &gp, double &maxResolution) |
Get maximum data resolution in a geographical point. This method will check the registered data sets and return the best available data resolution for a certain point. Note that this method uses bounding boxes for the data sets, so there may be cases where the query point is inside the bounding box of a high resolution data set, but no data is available in this point. | |
const std::vector< std::shared_ptr< Maria::ElevationDataLayer > > | getElevationLayers () const |
Get a list of all available elevation data layers. There is one data layer for each input data set. These layers may have different projection and resolution. | |
std::shared_ptr< STK::Image > | createElevationMap (const std::shared_ptr< RasterProjector > &pj, const BasicGeoTypes::PointDXY &topLeft, int width, int height, InterpolationMethod interpolationMethod, long timeout_ms=0, ElevationDataType queryType=ElevationDataType::Undefined) |
Create an elevation raster for a given area. This method will create a georeferenced raster with elevation data samples for a specified area and resolution. | |
std::shared_ptr< STK::Image > | createElevationMap (const std::shared_ptr< RasterProjector > &pj, const BasicGeoTypes::PointDXY &topLeft, int width, int height, const ElevationQueryParams &query) |
std::shared_ptr< Maria::ElevationDataLayer > | getElevationLayer (int layerId) const |
Get elevation data layer by layerID. | |
std::shared_ptr< STK::Image > | createNormalMap (const std::shared_ptr< RasterProjector > &pj, const BasicGeoTypes::PointDXY &topLeft, int width, int height, InterpolationMethod interpolationMethod, long timeout_ms) |
Create a normal map for a given area. This method will create a georeferenced normal map encoding the surface normals for the given area as RGB data. | |
ElevationMinMaxResult | getMinMaxElevation (const std::shared_ptr< RasterProjector > &rp, long timeout_ms) |
Calculate min/max elevation values in a given area. This method will take a geographical area defined by a RasterProjector and calculate the minimum and maximum elevation values inside the area. | |
BasicGeoTypes::GeoPos3D | calcSurfaceIntersection (const BasicGeoTypes::GeoPos &pos0, double altitude, double azimuth, double elevation, double step=50, Maria::InterpolationMethod interpolationMethod=Maria::InterpolationMethod::Bilinear, double hTolerance=2.5, double vTolerance=0.0, long timeout_ms=0) |
Calculate intersection point between a 3D ray and the terrain surface. This method will use an iterative algorithm to calculate the intersection point between a ray pointing towards the ground and the terrain surface. | |
BasicGeoTypes::GeoPos3D | calcSurfaceIntersection (const BasicGeoTypes::GeoPos3D &pos0, const BasicGeoTypes::GeoPos3D &pos1, double step=50, Maria::InterpolationMethod interpolationMethod=Maria::InterpolationMethod::Bilinear, double hTolerance=2.5, double vTolerance=0.0, long timeout_ms=0) |
Calculate intersection point between a 3D ray and the terrain surface. This method will use an iterative algorithm to calculate the intersection point between a ray pointing towards the ground and the terrain surface. | |
BasicGeoTypes::GeoPos3D | calcSurfaceIntersection (const BasicGeoTypes::PointDXYZ &gc0, const BasicGeoTypes::PointDXYZ &dir, double distance, double step, InterpolationMethod interpolationMethod, double hTolerance, double vTolerance, long timeout_ms) |
Maria::MapMetadata | getMetadata (const BasicGeoTypes::GeoRect &grc, double resolution=0.0, long timeout_ms=0) |
Get metdata for the given area. | |
Maria::MapMetadata | getMetadata (const BasicGeoTypes::GeoPos &pos, double resolution=0.0, long timeout_ms=0) |
Get metdata for the given point. | |
Maria::MapMetadata | getLayerMetadata (int layerId) |
Get metdata for the given layerId. | |
Protected Member Functions | |
BasicGeoTypes::GeoPos3D | refineSurfaceIntersection (const BasicGeoTypes::GeoPos3D &pos0, const BasicGeoTypes::GeoPos3D &pos1, double distance, Maria::InterpolationMethod interpolationMethod, double hTolerance, double vTolerance, long timeout_ms) |
Protected Attributes | |
std::shared_ptr< Maria::SystemTicker > | _systemTicker |
std::shared_ptr< Maria::TileCacheManager > | _tileCacheMgr |
std::vector< std::shared_ptr< Maria::ElevationDataLayer > > | _elevationLayer |
std::shared_mutex | _layerMutex |
ElevationData - Handle elevation data queries. This class has methods for querying elevation data, both single point values, and areas.
|
inline |
Calculate the elevation in a geographical point. This simplified method will calculate the elevation in a given point given certain query parameters. The method will block until a result is given or the timeout limit is reached. Use the ElevationResult version of this method if you need more control of the data result.
gp | The geographical point to query. |
interpolationMethod | Interpolation method, bilinear or nearest point. |
value | Output elevation data in meters. |
resolution | Minimum resolution of the result data in m/sample. If 0, use the highest resolution available. |
timeout_ms | Maximum number of ms to wait for the result. If 0, wait indefinitely. |
ElevationResult ElevationData::calcElevation | ( | const BasicGeoTypes::GeoPos & | gp, |
Maria::InterpolationMethod | interpolationMethod, | ||
double | resolution = 0.0 , |
||
long | timeout_ms = 0 , |
||
ElevationDataType | queryType = ElevationDataType::Undefined |
||
) |
Calculate the elevation in a geographical point. This method will calculate the elevation in a given point given certain query parameters. The method will block until a result is given or the timeout limit is reached.
gp | The geographical point to query. |
interpolationMethod | Interpolation method, bilinear or nearest point. |
resolution | Minimum resolution of the result data in m/sample. If 0, use the highest resolution available. |
timeout_ms | Maximum number of ms to wait for the result. If 0, wait indefinitely. |
queryType | Which type of elevation data to include in the query. If undefined, any data is used. |
BasicGeoTypes::GeoPos3D ElevationData::calcSurfaceIntersection | ( | const BasicGeoTypes::GeoPos & | pos0, |
double | altitude, | ||
double | azimuth, | ||
double | elevation, | ||
double | step = 50 , |
||
Maria::InterpolationMethod | interpolationMethod = Maria::InterpolationMethod::Bilinear , |
||
double | hTolerance = 2.5 , |
||
double | vTolerance = 0.0 , |
||
long | timeout_ms = 0 |
||
) |
Calculate intersection point between a 3D ray and the terrain surface. This method will use an iterative algorithm to calculate the intersection point between a ray pointing towards the ground and the terrain surface.
pos0 | A 2D geographical start point for the intersection ray. |
altitude | Altitude of the start point |
azimuth | Horizontal direction of the intersection ray. 0 degrees is due north, positive direction is clockwise. |
elevation | Vertical direction of the intersection ray, must be in the interval (0, -180). 0 degrees is parallell with the ground |
step | Resolution (in meters) of the search along the intersection ray. Shorter interval gives better results, but higher computation time. |
interpolationMethod | Interpolation method, either bilinear or nearest point. |
hTolerance | Horizontal error tolerance for the intersection point (meters) |
vTolerance | Minimum resolution of the terrain data to use for the calculations. 0 means use best available. |
timeout_ms | Maximum number of ms to wait for the result. If 0, wait indefinitely. |
BasicGeoTypes::GeoPos3D Maria::ElevationData::calcSurfaceIntersection | ( | const BasicGeoTypes::GeoPos3D & | pos0, |
const BasicGeoTypes::GeoPos3D & | pos1, | ||
double | step = 50 , |
||
Maria::InterpolationMethod | interpolationMethod = Maria::InterpolationMethod::Bilinear , |
||
double | hTolerance = 2.5 , |
||
double | vTolerance = 0.0 , |
||
long | timeout_ms = 0 |
||
) |
Calculate intersection point between a 3D ray and the terrain surface. This method will use an iterative algorithm to calculate the intersection point between a ray pointing towards the ground and the terrain surface.
pos0 | A 3D geographical start point for the intersection ray. |
pos0 | A 3D geographical end point for the intersection ray. |
step | Resolution (in meters) of the search along the intersection ray. Shorter interval gives better results, but higher computation time. |
interpolationMethod | Interpolation method, either bilinear or nearest point. |
hTolerance | Horizontal error tolerance for the intersection point (meters) |
vTolerance | Minimum resolution of the terrain data to use for the calculations. 0 means use best available. |
timeout_ms | Maximum number of ms to wait for the result. If 0, wait indefinitely. |
std::shared_ptr< STK::Image > ElevationData::createElevationMap | ( | const std::shared_ptr< RasterProjector > & | pj, |
const BasicGeoTypes::PointDXY & | topLeft, | ||
int | width, | ||
int | height, | ||
Maria::InterpolationMethod | interpolationMethod, | ||
long | timeout_ms = 0 , |
||
ElevationDataType | queryType = ElevationDataType::Undefined |
||
) |
Create an elevation raster for a given area. This method will create a georeferenced raster with elevation data samples for a specified area and resolution.
pj | Projection for the output data set. This will typically be a RasterProjector object. |
topLeft | Upper left corner in projection coordinates. |
width | Number of samples in X-direction. |
height | Number of samples in Y-direction. |
interpolationMethod | Interpolation method, either bilinear or nearest point. |
timeout_ms | Maximum number of ms to wait for the result. If 0, wait indefinitely. |
queryType | Which type of elevation data to include in the query. If undefined, any data is used. |
std::shared_ptr< STK::Image > ElevationData::createNormalMap | ( | const std::shared_ptr< RasterProjector > & | pj, |
const BasicGeoTypes::PointDXY & | topLeft, | ||
int | width, | ||
int | height, | ||
Maria::InterpolationMethod | interpolationMethod, | ||
long | timeout_ms | ||
) |
Create a normal map for a given area. This method will create a georeferenced normal map encoding the surface normals for the given area as RGB data.
pj | Projection for the output data set. This will typically be a RasterProjector object. |
topLeft | Upper left corner in projection coordinates. |
width | Number of samples in X-direction. |
height | Number of samples in Y-direction. |
interpolationMethod | Interpolation method, either bilinear or nearest point. |
timeout_ms | Maximum number of ms to wait for the result. If 0, wait indefinitely. |
|
inline |
Get elevation data layer by layerID.
layerId | ID of the layer to retrieve. |
|
inline |
Get a list of all available elevation data layers. There is one data layer for each input data set. These layers may have different projection and resolution.
Maria::MapMetadata Maria::ElevationData::getLayerMetadata | ( | int | layerId | ) |
Get metdata for the given layerId.
layerId |
bool ElevationData::getMaxResolution | ( | const BasicGeoTypes::GeoPos & | gp, |
double & | maxResolution | ||
) |
Get maximum data resolution in a geographical point. This method will check the registered data sets and return the best available data resolution for a certain point. Note that this method uses bounding boxes for the data sets, so there may be cases where the query point is inside the bounding box of a high resolution data set, but no data is available in this point.
gp | Geographical location for the query. |
maxResolution | Output maximum resolution in meters/sample. |
Maria::MapMetadata Maria::ElevationData::getMetadata | ( | const BasicGeoTypes::GeoPos & | pos, |
double | resolution = 0.0 , |
||
long | timeout_ms = 0 |
||
) |
Get metdata for the given point.
pos | Position to query. |
resolution | Get tiles with resolution closest to the given number (in m/pixel). The returned tile will typically be the first quadtree level with resolution better than the required number. If 0, return the highest available resolution. |
timeout_ms | Maximum ms to wait for loading of tiles. If 0, wait indefinitely. If < 0, do not wait, only tiles that are already loaded will be considered. |
Maria::MapMetadata Maria::ElevationData::getMetadata | ( | const BasicGeoTypes::GeoRect & | grc, |
double | resolution = 0.0 , |
||
long | timeout_ms = 0 |
||
) |
Get metdata for the given area.
grc | Geographical area to query |
resolution | Get tiles with resolution closest to the given number (in m/pixel). The returned tile will typically be the first quadtree level with resolution better than the required number. If 0, return the highest available resolution. |
timeout_ms | Maximum ms to wait for loading of tiles. If 0, wait indefinitely. If < 0, do not wait, only tiles that are already loaded will be considered. |
ElevationMinMaxResult ElevationData::getMinMaxElevation | ( | const std::shared_ptr< RasterProjector > & | rp, |
long | timeout_ms | ||
) |
Calculate min/max elevation values in a given area. This method will take a geographical area defined by a RasterProjector and calculate the minimum and maximum elevation values inside the area.
rp | RasterProjector defining a geographical area in some projection. |
timeout_ms | Maximum number of ms to wait for the result. If 0, wait indefinitely. |