te::ws::ogc::WCSClient Class Reference

A class to retrieve information and data from a Web Coverage Service. More...

#include <WCSClient.h>

Public Member Functions

te::ws::ogc::wcs::CoverageDescription describeCoverage (const std::string coverage)
 Method to get the information about a coverage in the WCS server. More...
 
const te::ws::ogc::wcs::CapabilitiesgetCapabilities () const
 Return the m_capabilities member. More...
 
std::string getCoverage (const te::ws::ogc::wcs::CoverageRequest coverageRequest, te::common::TaskProgress *taskProgress=0) const
 Method to get the coverage from the WCS server. More...
 
std::string makeFileRequest (const std::string url, const std::string fileName, te::common::TaskProgress *taskProgress=0) const
 Executes a request on a WCS server. More...
 
void setCurlWrapper (te::ws::core::CurlWrapper *curlWrapper)
 Sets the TerraLib CurlWrapper to be used internally. More...
 
void updateCapabilities ()
 Method to get the capabilities from a WCS server and store in m_capabilities member. More...
 
 WCSClient (const std::string usrDataDir="", const std::string uri="", const std::string version="2.0.1")
 Class constructor. It initializes the m_uri and m_version class members. More...
 
 ~WCSClient ()
 Default destructor. More...
 

Private Member Functions

std::string getFileExtension (const std::string &format) const
 

Private Attributes

te::ws::ogc::wcs::Capabilities m_capabilities
 
std::shared_ptr< te::ws::core::CurlWrapperm_curl
 
std::string m_dataDir
 
std::map< std::string, te::ws::ogc::wcs::CoverageDescriptionm_descriptionMap
 
te::ws::ogc::wcs::XMLParser m_parser
 
te::core::URI m_uri
 
std::string m_version
 

Detailed Description

A class to retrieve information and data from a Web Coverage Service.

Definition at line 58 of file WCSClient.h.

Constructor & Destructor Documentation

te::ws::ogc::WCSClient::WCSClient ( const std::string  usrDataDir = "",
const std::string  uri = "",
const std::string  version = "2.0.1" 
)

Class constructor. It initializes the m_uri and m_version class members.

Parameters
usrDataDirDirectory to store used temporary XML and images from WCS server.
uriThe adress of WCS server.
versionThe WCS version.

Definition at line 46 of file WCSClient.cpp.

References te::core::FileSystem::createDirectories(), te::core::FileSystem::exists(), te::core::URI::host(), te::ws::core::HTTP_BASIC, te::core::FileSystem::isDirectory(), m_curl, m_dataDir, m_uri, te::core::URI::password(), te::core::URI::path(), te::core::URI::port(), te::core::URI::query(), te::core::URI::scheme(), te::core::URI::user(), and ~WCSClient().

te::ws::ogc::WCSClient::~WCSClient ( )
default

Default destructor.

Referenced by WCSClient().

Member Function Documentation

te::ws::ogc::wcs::CoverageDescription te::ws::ogc::WCSClient::describeCoverage ( const std::string  coverage)

Method to get the information about a coverage in the WCS server.

Parameters
coverageThe name of the coverage to describe
Returns
Return the information of the coverage in the WCS

Definition at line 122 of file WCSClient.cpp.

References te::qt::plugins::wtss::coverage, m_curl, m_descriptionMap, m_parser, m_uri, m_version, makeFileRequest(), te::ws::ogc::wcs::XMLParser::parseDescribeCoverage(), TE_TR, and te::core::URI::uri().

Referenced by BOOST_AUTO_TEST_CASE(), and main().

const te::ws::ogc::wcs::Capabilities & te::ws::ogc::WCSClient::getCapabilities ( ) const

Return the m_capabilities member.

The m_capabilities will be empty until the updateCapabilities() method its called.

Returns
Returns a path to a file

Definition at line 263 of file WCSClient.cpp.

References m_capabilities.

Referenced by BOOST_AUTO_TEST_CASE(), and main().

std::string te::ws::ogc::WCSClient::getCoverage ( const te::ws::ogc::wcs::CoverageRequest  coverageRequest,
te::common::TaskProgress taskProgress = 0 
) const
std::string te::ws::ogc::WCSClient::getFileExtension ( const std::string &  format) const
private

Definition at line 165 of file WCSClient.cpp.

Referenced by getCoverage().

std::string te::ws::ogc::WCSClient::makeFileRequest ( const std::string  url,
const std::string  fileName,
te::common::TaskProgress taskProgress = 0 
) const

Executes a request on a WCS server.

Parameters
urlThe complete url of request
Returns
Returns a path to a file

Definition at line 254 of file WCSClient.cpp.

References m_curl, and m_dataDir.

Referenced by describeCoverage(), getCoverage(), and updateCapabilities().

void te::ws::ogc::WCSClient::setCurlWrapper ( te::ws::core::CurlWrapper curlWrapper)

Sets the TerraLib CurlWrapper to be used internally.

By default it is an instance of te::ws::core::CurlWrapper class.

Parameters
curlWrapperWrapper to be used.

Definition at line 268 of file WCSClient.cpp.

References m_curl.

void te::ws::ogc::WCSClient::updateCapabilities ( )

Method to get the capabilities from a WCS server and store in m_capabilities member.

To access the information contained in the m_capabilities, use the getCapabilities() method.

Definition at line 92 of file WCSClient.cpp.

References m_capabilities, m_curl, m_parser, m_uri, m_version, makeFileRequest(), te::ws::ogc::wcs::XMLParser::parseCapabilities(), TE_TR, and te::core::URI::uri().

Referenced by BOOST_AUTO_TEST_CASE(), te::ws::ogc::wcs::da::DataSource::exists(), and main().

Member Data Documentation

te::ws::ogc::wcs::Capabilities te::ws::ogc::WCSClient::m_capabilities
private

Definition at line 138 of file WCSClient.h.

Referenced by getCapabilities(), and updateCapabilities().

std::shared_ptr<te::ws::core::CurlWrapper> te::ws::ogc::WCSClient::m_curl
private
std::string te::ws::ogc::WCSClient::m_dataDir
private

Definition at line 136 of file WCSClient.h.

Referenced by makeFileRequest(), and WCSClient().

std::map<std::string, te::ws::ogc::wcs::CoverageDescription> te::ws::ogc::WCSClient::m_descriptionMap
private

Definition at line 140 of file WCSClient.h.

Referenced by describeCoverage().

te::ws::ogc::wcs::XMLParser te::ws::ogc::WCSClient::m_parser
private

Definition at line 141 of file WCSClient.h.

Referenced by describeCoverage(), and updateCapabilities().

te::core::URI te::ws::ogc::WCSClient::m_uri
private

Definition at line 137 of file WCSClient.h.

Referenced by describeCoverage(), getCoverage(), updateCapabilities(), and WCSClient().

std::string te::ws::ogc::WCSClient::m_version
private

Definition at line 135 of file WCSClient.h.

Referenced by describeCoverage(), getCoverage(), and updateCapabilities().


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