27 #include "../dataaccess/datasource/DataSourceTransactor.h" 28 #include "../common/StringUtils.h" 29 #include "../core/translator/Translator.h" 36 #include <gdal_priv.h> 76 GDALDataset* gds = (GDALDataset*)GDALOpenEx(
m_uri.
uri().c_str(), GDAL_OF_READONLY, NULL, NULL, NULL);;
78 throw Exception(
TE_TR(
"Error establishing connection with the informed server!"));
81 char** subdatasets = gds->GetMetadata(
"SUBDATASETS");
109 GDALDataset* gds =
static_cast<GDALDataset*
>(GDALOpen(
m_uri.
uri().c_str(), GA_ReadOnly));
140 throw Exception(
TE_TR(
"The create() method is not supported by the WMS driver!"));
145 throw Exception(
TE_TR(
"The drop() method is not supported by the WMS driver!"));
150 if (connInfo.empty())
157 std::string path = aux.
path();
161 GDALDataset* gds =
static_cast<GDALDataset*
>(GDALOpen(path.c_str(), GA_ReadOnly));
172 return std::vector<std::string>();
181 throw Exception(
TE_TR(
"The connection information is invalid. Missing the path parameter!"));
Implementation of the transactor for the WMS driver.
const te::da::DataSourceCapabilities & getCapabilities() const
It returns the known capabilities of the data source.
std::string path() const
Retrieving the path.
std::auto_ptr< te::da::DataSourceTransactor > getTransactor()
It returns the set of parameters used to set up the access channel to the underlying repository...
Implementation of the data source for the WMS driver.
const std::map< std::string, WMSLayerInfo > & getLayersInfo() const
Base exception class for plugin module.
bool exists(const std::string &connInfo)
Check the existence of a data source in a driver.
It represents the SQL query dialect accepted by a given data source.
bool isOpened() const
It returns true if the data source is opened, otherwise it returns false.
A class that represents the known capabilities of a specific data source, i.e. this class informs all...
bool isValid() const
Return if the given URI is valid or not.
void close()
It closes the data source and clears all the resources used by its internal communication channel...
#define TE_TR(message)
It marks a string in order to get translated.
#define TE_WMS_DRIVER_IDENTIFIER
const te::da::SQLDialect * getDialect() const
It returns the data source SQL dialect, if there is one.
std::map< std::string, WMSLayerInfo > m_layersInfo
void BuildLayersInfo(char **subdatasets, std::map< std::string, WMSLayerInfo > &info)
te::da::DataSourceCapabilities capabilities
static void setCapabilities(const te::da::DataSourceCapabilities &capabilities)
const std::string & uri() const
Retrieving the full URI.
void drop(const std::string &connInfo)
It removes the data source with the connection information from a driver.
std::string getType() const
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL.
A class for representing an Uniform Resource Identifier (URI).
DataSource(const std::string &connInfo)
static te::da::DataSourceCapabilities sm_capabilities
te::core::URI m_uri
The URI used to describe the datasource connection;.
bool isValid() const
It checks if the data source is valid (available for using).
void open()
It opens the data source and makes it ready for using.
void verifyConnectionInfo() const
~DataSource()
Virtual destructor.
std::vector< std::string > getDataSourceNames(const std::string &connInfo)
It gets the data source names available in a driver.
void create(const std::string &connInfo)
It creates a new data source.