WMSClient.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/ws/ogc/wms/client/WCSClient.h
22 
23  \brief WS Client for OGC WMS
24 
25  \author Emerson Moraes
26 */
27 
28 #ifndef __TERRALIB_WS_OGC_WCS_CLIENT_WMS_H
29 #define __TERRALIB_WS_OGC_WCS_CLIENT_WMS_H
30 
31 // STL
32 #include <memory>
33 #include <vector>
34 #include <map>
35 #include <string>
36 
37 // TerraLib
38 #include "../../../../core/uri/URI.h"
39 #include "../../../core/CurlWrapper.h"
40 #include "Config.h"
41 #include "DataTypes.h"
42 #include "XMLParser.h"
43 
44 
45 namespace te
46 {
47  namespace ws
48  {
49  namespace ogc
50  {
51 
52  /*!
53  \class WMSClient
54 
55  \brief A class to retrieve information and data from a Web Map Service.
56  */
58  {
59  public:
60 
61  /*!
62  \brief Class constructor. It initializes the m_uri and m_version class members
63 
64  \param usrDataDir Directory to store used temporary XML and images from WMS server.
65  \param uri The adress of WMS server.
66  \param version The WMS version.
67  */
68  WMSClient(const std::string usrDataDir = "",const std::string uri = "", const std::string version = "1.3.0");
69 
70  /*!
71  \brief Default destructor.
72  */
73  ~WMSClient();
74 
75  /*!
76  \brief Method to get the capabilities from a WMS server and store in m_capabilities member
77 
78  To access the information contained in the m_capabilities, use the getCapabilities() method.
79 
80  */
81  void updateCapabilities();
82 
83  /*!
84  \brief Return the WMSCapabilities member.
85 
86  The WMSCapabilities will be empty until the updateCapabilities() method its called.
87 
88  \return Returns the WMSCapabilities member.
89  */
90  const te::ws::ogc::wms::WMSCapabilities& getCapabilities() const;
91 
92  /*!
93  \brief Return the WMSGetMapResponse member.
94 
95  Make the GetMapRequest and return the server answer as a WMSGetMapResponse.
96 
97  \return Returns a path to a file
98  */
100 
101  /*!
102  \brief Executes a request on a WMS server
103 
104  \param url The complete url of request
105 
106  \return Returns a path to a file
107  */
108  std::string makeFileRequest(const std::string url, const std::string fileName) const;
109 
110  /*!
111  * \brief Sets the TerraLib CurlWrapper to be used internally.
112  *
113  * By default it is an instance of te::ws::core::CurlWrapper class.
114  *
115  * \param curlWrapper Wrapper to be used.
116  */
117  void setCurlWrapper(te::ws::core::CurlWrapper* curlWrapper);
118 
119 
120  private:
121  std::string m_version;
122  std::string m_dataDir;
125  std::shared_ptr<te::ws::core::CurlWrapper> m_curl;
127 
128  };
129  }
130  }
131 }
132 
133 #endif //__TERRALIB_WS_OGC_WCS_CLIENT_WMS_H
te::ws::ogc::wms::XMLParser m_parser
Definition: WMSClient.h:126
#define TEOGCWMSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:90
te::ws::ogc::wms::WMSCapabilities m_capabilities
Definition: WMSClient.h:124
te::core::URI m_uri
Definition: WMSClient.h:123
An abstraction to Lib Curl functions.
Definition: CurlWrapper.h:59
std::string m_version
Definition: WMSClient.h:121
The Capability WMS 1.3.0 struct.
Definition: DataTypes.h:275
A class responsible to parse WMS XML files to WMS TerraLib data types.
Definition: XMLParser.h:42
Configuration flags for the Terrralib WS OGC WMS module.
URI C++ Library.
std::string m_dataDir
Definition: WMSClient.h:122
The WMSGetMapResponse WMS 1.3.0 struct.
Definition: DataTypes.h:316
A class for representing an Uniform Resource Identifier (URI).
Definition: URI.h:49
Specifies containers for WMS data types.
std::shared_ptr< te::ws::core::CurlWrapper > m_curl
Definition: WMSClient.h:125
A class to retrieve information and data from a Web Map Service.
Definition: WMSClient.h:57
The WMSGetMapRequest WMS 1.3.0 struct.
Definition: DataTypes.h:286