Class SpatialMapDataProvider

Inheritance Relationships

Derived Type

Class Documentation

class SpatialMapDataProvider

Container that aggregates spatial map data from one or more SpatialMapDataSource and supplies a unified lookup_datum function for reading that data.

In general, consumers of spatial map data should be written in terms of this class. Classes that supply spatial map data implement SpatialMapDataSource.

Possible implementations of this class:

  • Prioritization of various sources (returning higher precision sources when available)

  • Stitching sources together

  • Interpolation between sources

  • Extrapolation

  • Averaging overlapping sources

  • Conditional selection (i.e. a coastal region with underwater and above water)

  • Spot filling (use X if available, or Y if not)

Subclassed by navtk::geospatial::SimpleProvider

Public Functions

virtual ~SpatialMapDataProvider() = default

Destructor.

SpatialMapDataProvider(not_null<std::shared_ptr<SpatialMapDataSource>> src)

Constructor for a single SpatialMapDataSource

Parameters

src – the source

SpatialMapDataProvider(std::vector<not_null<std::shared_ptr<SpatialMapDataSource>>> srcs = {})

Constructor for a vector of zero or more SpatialMapDataSources.

Parameters

srcs – The vector of sources.

void add_source(not_null<std::shared_ptr<SpatialMapDataSource>> src)

Adds a SpatialMapDataSource to the provider.

Parameters

src – the source.

virtual std::pair<bool, double> lookup_datum(double latitude, double longitude) const = 0

Returns a pair containing a validity flag and data at the given latitude and longitude.

If the flag is false, the data is invalid and should not be used.

Parameters
  • latitude – The latitude value in radians.

  • longitude – The longitude value in radians.

Returns

A pair showing whether a datum was found (.first) and if true, the datum value.

Protected Attributes

std::vector<not_null<std::shared_ptr<SpatialMapDataSource>>> sources

Store the SpatialMapDataSources used in the background by the provider.