NDEVR
API Documentation
GeoTiffElevationService

An ElevationService that provides terrain elevation data from GeoTIFF tiles, downloading and caching them locally for efficient sampling. More...

Inheritance diagram for GeoTiffElevationService:
[legend]
Collaboration diagram for GeoTiffElevationService:
[legend]

Public Member Functions

 GeoTiffElevationService ()
 Constructs a GeoTiffElevationService.
 ~GeoTiffElevationService ()
 Destroys the service and releases cached tile resources.
virtual void postRequest (const ElevationRequest &request) override
 Submits an elevation request for asynchronous processing.
Buffer< TileKeyrequiredTiles (const ElevationRequest &request)
 Determines which tiles are needed to fulfill an elevation request.
File tileCachePath (const TileKey &key) const
 Returns the local cache file path for a given tile.
String tileName (const TileKey &key) const
 Returns the human-readable name for a given tile.
String tileUrl (const TileKey &key) const
 Returns the download URL for a given tile.

Static Public Member Functions

static void Initialize ()
 Registers this service as an available elevation provider.
static TileKey TileKeyForCoord (fltp08 lat, fltp08 lon)
 Computes the tile key for a given geographic coordinate.
Static Public Member Functions inherited from ElevationService
static ElevationRequest ConvertToLatLon (const ElevationRequest &request)
 Converts the coordinate locations in the given request to latitude/longitude values.
static ElevationServicePrimaryService ()
 Returns the primary ElevationService instance registered for the application.
static void SetPrimaryService (ElevationService *elevation_service)
 Sets the primary ElevationService instance for the application.
static Buffer< LineElevationRequestSplitRequestsIfNeeded (const Buffer< LineElevationRequest > &requests, uint04 max_samples)
 Splits polyline elevation requests that exceed the maximum sample count into smaller sub-requests.

Protected Member Functions

void checkAndResolve (const UUID &request_id)
 Checks if all tiles for a request are available and resolves it if so.
void downloadTile (const TileKey &key, LogPtr &log)
 Initiates downloading of a tile from the remote source.
bool loadTileFromDisk (const TileKey &key)
 Attempts to load a tile from the local disk cache.
void onTileDownloadedSlot (const TileKey &key)
 Called when a tile download completes successfully.
void onTileDownloadFailedSlot (const TileKey &key)
 Called when a tile download fails.
void processRequest (ElevationRequest request)
 Processes an elevation request by loading or downloading required tiles.
void resolveRequest (ElevationRequest &request)
 Resolves an elevation request by sampling loaded tiles.
fltp08 sampleElevation (CachedTile &tile, fltp08 lat, fltp08 lon)
 Samples the elevation value from a cached tile at a geographic coordinate.

Protected Attributes

Dictionary< TileKey, ItemDownloader * > m_active_downloads
 Active tile downloads in progress.
File m_cache_dir
 Local directory for cached tile files.
Dictionary< TileKey, CachedTilem_loaded_tiles
 Tiles that have been loaded into memory.
RWLock m_lock
 Read-write lock for thread-safe tile access.
Dictionary< UUID, ElevationRequestm_pending_requests
 Pending elevation requests by UUID.
Dictionary< TileKey, Buffer< UUID > > m_pending_tile_downloads
 Requests waiting on specific tile downloads.
Dictionary< UUID, Buffer< TileKey > > m_request_tiles
 Tiles required per request.
Dictionary< TileKey, bool > m_unavailable_tiles
 Tiles that failed to download or are missing.

Additional Inherited Members

Static Protected Attributes inherited from ElevationService
static ElevationServices_primary_service
 The singleton primary elevation service instance.

Detailed Description

An ElevationService that provides terrain elevation data from GeoTIFF tiles, downloading and caching them locally for efficient sampling.


Definition at line 101 of file GeoTiffElevationService.h.

Member Function Documentation

◆ checkAndResolve()

void GeoTiffElevationService::checkAndResolve ( const UUID & request_id)
protected

Checks if all tiles for a request are available and resolves it if so.

Parameters
[in]request_idThe UUID of the request to check.

◆ downloadTile()

void GeoTiffElevationService::downloadTile ( const TileKey & key,
LogPtr & log )
protected

Initiates downloading of a tile from the remote source.

Parameters
[in]keyThe tile to download.
[in]logThe log for status messages.

◆ loadTileFromDisk()

bool GeoTiffElevationService::loadTileFromDisk ( const TileKey & key)
protected

Attempts to load a tile from the local disk cache.

Parameters
[in]keyThe tile to load.
Returns
True if the tile was loaded successfully.

◆ onTileDownloadedSlot()

void GeoTiffElevationService::onTileDownloadedSlot ( const TileKey & key)
protected

Called when a tile download completes successfully.

Parameters
[in]keyThe downloaded tile key.

◆ onTileDownloadFailedSlot()

void GeoTiffElevationService::onTileDownloadFailedSlot ( const TileKey & key)
protected

Called when a tile download fails.

Parameters
[in]keyThe failed tile key.

◆ postRequest()

virtual void GeoTiffElevationService::postRequest ( const ElevationRequest & request)
overridevirtual

Submits an elevation request for asynchronous processing.

Parameters
[in]requestThe elevation request to process.

Implements ElevationService.

◆ processRequest()

void GeoTiffElevationService::processRequest ( ElevationRequest request)
protected

Processes an elevation request by loading or downloading required tiles.

Parameters
[in]requestThe elevation request to process.

◆ requiredTiles()

Buffer< TileKey > GeoTiffElevationService::requiredTiles ( const ElevationRequest & request)

Determines which tiles are needed to fulfill an elevation request.

Parameters
[in]requestThe elevation request.
Returns
A buffer of required TileKey values.

◆ resolveRequest()

void GeoTiffElevationService::resolveRequest ( ElevationRequest & request)
protected

Resolves an elevation request by sampling loaded tiles.

Parameters
[in]requestThe request to resolve.

◆ sampleElevation()

fltp08 GeoTiffElevationService::sampleElevation ( CachedTile & tile,
fltp08 lat,
fltp08 lon )
protected

Samples the elevation value from a cached tile at a geographic coordinate.

Parameters
[in]tileThe cached tile to sample from.
[in]latThe latitude in degrees.
[in]lonThe longitude in degrees.
Returns
The elevation value at the given coordinate.

◆ tileCachePath()

File GeoTiffElevationService::tileCachePath ( const TileKey & key) const

Returns the local cache file path for a given tile.

Parameters
[in]keyThe tile key.
Returns
The local file path.

◆ TileKeyForCoord()

TileKey GeoTiffElevationService::TileKeyForCoord ( fltp08 lat,
fltp08 lon )
static

Computes the tile key for a given geographic coordinate.

Parameters
[in]latThe latitude in degrees.
[in]lonThe longitude in degrees.
Returns
The TileKey corresponding to the coordinate.

◆ tileName()

String GeoTiffElevationService::tileName ( const TileKey & key) const

Returns the human-readable name for a given tile.

Parameters
[in]keyThe tile key.
Returns
The tile name string.

◆ tileUrl()

String GeoTiffElevationService::tileUrl ( const TileKey & key) const

Returns the download URL for a given tile.

Parameters
[in]keyThe tile key.
Returns
The URL string.

The documentation for this class was generated from the following file: