LuciadCPillar 2024.0.04
luciad::RasterModelHeightProvider Class Referencefinal

A height provider based on a raster model. More...

#include <luciad/models/rasters/RasterModelHeightProvider.h>

Classes

class  Builder
 Builder for a RasterModelHeightProvider. More...
 

Public Member Functions

 RasterModelHeightProvider (const RasterModelHeightProvider &other)
 
 RasterModelHeightProvider (RasterModelHeightProvider &&other) noexcept
 
 ~RasterModelHeightProvider ()
 
const std::shared_ptr< CoordinateReference > & getReference () const
 Returns the coordinate reference of this height provider. More...
 
bool isInterpolate () const
 Returns whether (bilinear) interpolation is used when calculating height values form the source data. More...
 
std::optional< double > retrieveHeightAt (Coordinate coordinate, const PixelDensity &pixelDensity) const
 Retrieve the height data at the provided point at a provided pixel density. More...
 
std::optional< double > retrieveHeightAt (Coordinate coordinate, double pixelDensity) const
 Retrieve the height data at the provided point at a provided pixel density. More...
 
void setInterpolate (bool interpolate)
 Sets whether (bilinear) interpolation is used when calculating height values form the source data. More...
 

Static Public Member Functions

static Builder newBuilder ()
 Returns a new RasterModelHeightProvider builder. More...
 

Detailed Description

A height provider based on a raster model.

This class is thread-safe.

Related article: Retrieving height data.

Since
2023.0

Constructor & Destructor Documentation

◆ RasterModelHeightProvider() [1/2]

luciad::RasterModelHeightProvider::RasterModelHeightProvider ( const RasterModelHeightProvider other)

◆ RasterModelHeightProvider() [2/2]

luciad::RasterModelHeightProvider::RasterModelHeightProvider ( RasterModelHeightProvider &&  other)
noexcept

◆ ~RasterModelHeightProvider()

luciad::RasterModelHeightProvider::~RasterModelHeightProvider ( )

Member Function Documentation

◆ getReference()

const std::shared_ptr< CoordinateReference > & luciad::RasterModelHeightProvider::getReference ( ) const

Returns the coordinate reference of this height provider.

The input and output of retrieveHeightAt are all expressed in this reference.

Returns
the coordinate reference of this height provider.

◆ isInterpolate()

bool luciad::RasterModelHeightProvider::isInterpolate ( ) const

Returns whether (bilinear) interpolation is used when calculating height values form the source data.

Returns
whether (bilinear) interpolation is used when calculating height values form the source data.

◆ newBuilder()

static Builder luciad::RasterModelHeightProvider::newBuilder ( )
static

Returns a new RasterModelHeightProvider builder.

Returns
a new RasterModelHeightProvider builder.

◆ retrieveHeightAt() [1/2]

std::optional< double > luciad::RasterModelHeightProvider::retrieveHeightAt ( Coordinate  coordinate,
const PixelDensity pixelDensity 
) const

Retrieve the height data at the provided point at a provided pixel density.

Looks for a tile in the underlying raster data covering the specified point and with a pixel density equal or lower to the specified density, and returns elevation data based on that tile. If several tiles match, then the most detailed tile is used; if all tiles covering the point have a density higher than requested density, then the least detailed tile is used.

Parameters
coordinateThe point for which the height is requested, expressed in the coordinate reference of the height provider. If the height provider reference is a 2D reference, Z-value is ignored.
pixelDensityThe pixel density used to determine the level of detail to use in the underlying data. Must be in the coordinate reference of the height provider.
Returns
the height expressed in the reference of the height provider, or std::nullopt if no data is available for this coordinate.

◆ retrieveHeightAt() [2/2]

std::optional< double > luciad::RasterModelHeightProvider::retrieveHeightAt ( Coordinate  coordinate,
double  pixelDensity 
) const

Retrieve the height data at the provided point at a provided pixel density.

Looks for a tile in the underlying raster data covering the specified point and with a pixel density equal or lower to the specified density, and returns elevation data based on that tile. If several tiles match, then the most detailed tile is used; if all tiles covering the point have a density higher than requested density, then the least detailed tile is used.

Parameters
coordinateThe point for which the height is requested, expressed in the coordinate reference of the height provider. If the height provider reference is a 2D reference, Z-value is ignored.
pixelDensityThe pixel density used to determine the level of detail to use in the underlying data. Assumed to be in the coordinate reference of the height provider.
Returns
the height expressed in the reference of the height provider, or std::nullopt if no data is available for this coordinate.

◆ setInterpolate()

void luciad::RasterModelHeightProvider::setInterpolate ( bool  interpolate)

Sets whether (bilinear) interpolation is used when calculating height values form the source data.

Using interpolation makes sure that neighbouring height values form a smoother curve.

Parameters
interpolatewhether interpolation is used