LuciadCPillar 2023.1.04
luciad::WmsModelDecoder Class Referencefinal

Creates an luciad::IRasterModel that connects to a WMS service. More...

#include <luciad/formats/wms/WmsModelDecoder.h>

Public Member Functions

 WmsModelDecoder ()=delete
 
 ~WmsModelDecoder ()=delete
 

Static Public Member Functions

static luciad::expected< std::shared_ptr< IRasterModel >, ErrorInfodecode (const std::shared_ptr< WmsDataSource > &dataSource, const WmsModelDecoderOptions &options, std::shared_ptr< WmsCapabilities > wmsCapabilities=nullptr)
 Creates a WMS raster model, or returns information about why this model cannot be created. More...
 
static luciad::expected< std::shared_ptr< IRasterModel >, ErrorInfodecode (const std::shared_ptr< WmsDataSource > &dataSource, std::shared_ptr< WmsCapabilities > wmsCapabilities=nullptr)
 Creates a WMS raster model, or returns information about why this model cannot be created. More...
 

Detailed Description

Creates an luciad::IRasterModel that connects to a WMS service.

See WmsModelDecoder::decode for more details.

Since
2020.2

Constructor & Destructor Documentation

◆ WmsModelDecoder()

luciad::WmsModelDecoder::WmsModelDecoder ( )
delete

◆ ~WmsModelDecoder()

luciad::WmsModelDecoder::~WmsModelDecoder ( )
delete

Member Function Documentation

◆ decode() [1/2]

static luciad::expected< std::shared_ptr< IRasterModel >, ErrorInfo > luciad::WmsModelDecoder::decode ( const std::shared_ptr< WmsDataSource > &  dataSource,
const WmsModelDecoderOptions options,
std::shared_ptr< WmsCapabilities wmsCapabilities = nullptr 
)
static

Creates a WMS raster model, or returns information about why this model cannot be created.

The WMS capabilities are used to check the WmsDataSource validity. The WMS requests are following the 1.3.0 or the 1.1.1 specification depending on the version referred in the WMS capabilities.

This model does not support the entire WMS specification. The following restrictions are used:

  • The returned raster model uses KVP (Key Value Pair). XML is not supported.
  • The model uses a tiled approach to retrieve the data. The image tiles are requested in a coordinate reference advertised in the WMS capabilities.
  • The raster layer for a WMS model uses the map reference to request the tiles when possible. Otherwise another reference is chosen, for example CRS:84.
  • The chosen reference is used to construct a tile matrix set that defines which tiles are requested from the WMS server. This tile matrix set covers the entire coordinate reference system.
  • The data extent of the WMS data source is used to limit which tiles are requested from the WMS server. When no data extent is available no limits are applied. A margin is used to avoid possible artifacts at the tile boundaries. The model bounds is computed from the datasource's layers data extent if they are available, if not the bounds covers the entire coordinate reference system.
  • The supported image formats are image/png and image/jpeg. When no image format is specified in the data source image/png is used when available and image/jpeg otherwise.
Parameters
dataSourceThe structure describing the source to use for data retrieval.
optionsOptions for decoding WMS data, e.g. an optional http client implementation to send HTTP requests when fetching WMS resources.
wmsCapabilitiesThe source's capabilities. Can be retrieved before using WmsCapabilities::getCapabilities and reused. If set to nullptr, it will be queried internally.
Returns
either the new model or error information.
Since
2023.0

◆ decode() [2/2]

static luciad::expected< std::shared_ptr< IRasterModel >, ErrorInfo > luciad::WmsModelDecoder::decode ( const std::shared_ptr< WmsDataSource > &  dataSource,
std::shared_ptr< WmsCapabilities wmsCapabilities = nullptr 
)
static

Creates a WMS raster model, or returns information about why this model cannot be created.

Parameters
dataSourceThe structure describing the source to use for data retrieval.
wmsCapabilitiesThe source's capabilities. Can be retrieved before using WmsCapabilities::getCapabilities and reused. If set to nullptr, it will be queried internally.
Returns
either the new model or error information.