DataTypes.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/DataTypes.h
22 
23  \brief Specifies containers for WMS data types.
24 
25  \author Emerson Moraes
26 */
27 
28 #ifndef __TERRALIB_WS_OGC_WMS_DATATYPES_H
29 #define __TERRALIB_WS_OGC_WMS_DATATYPES_H
30 
31 #include "Config.h"
32 
33 #include <vector>
34 #include <string>
35 
36 #include <boost/lexical_cast.hpp>
37 
38 namespace te
39 {
40  namespace ws
41  {
42  namespace ogc
43  {
44  namespace wms
45  {
46 
47  /*!
48  * \brief The OnlineResource WMS 1.3.0 struct.
49  *
50  * An OnlineResource is typically an HTTP URL.
51  * The URL is placed in the xlink:href attribute, and the value "simple" is placed in the xlink:type attribute.
52  */
54  {
55  std::string m_href;
56  std::string m_type;
57  };
58 
60  {
63  };
64 
65  /*!
66  * \brief The GeographicBoundingBox WMS 1.3.0 struct.
67  *
68  * The EX_GeographicBoundingBox attributes indicate the limits of the enclosing rectangle in longitude and latitude decimal degrees.
69  */
71  {
76 
78  m_westBoundLongitude(0.0),
79  m_eastBoundLongitude(0.0),
80  m_southBoundLatitude(0.0),
81  m_northBoundLatitude(0.0)
82  {}
83  };
84 
85  /*!
86  * \brief The BoundingBox WMS 1.3.0 struct.
87  *
88  * The BoundingBox attributes indicate the limits of the bounding box in units of the specified coordinate reference system.
89  */
91  {
92  std::string m_crs;
93  double m_minX;
94  double m_minY;
95  double m_maxX;
96  double m_maxY;
97  double m_resX;
98  double m_resY;
99 
101  m_minX(0.0),
102  m_minY(0.0),
103  m_maxX(0.0),
104  m_maxY(0.0),
105  m_resX(0.0),
106  m_resY(0.0)
107  {}
108  };
109 
110  /*!
111  * \brief The Dimension WMS 1.3.0 struct.
112  *
113  * The Dimension element declares the existence of a dimension and indicates what values along a dimension are valid.
114  */
116  {
117  std::string m_name;
118  std::string m_units;
119  std::string m_unitSymbol;
120  std::string m_default;
123  bool m_current;
124  std::vector<std::string> m_allowedValues;
125 
127  m_multipleValues(false),
128  m_nearestValue(false),
129  m_current(false)
130  {}
131  };
132 
133  /*!
134  * \brief The LegendURL WMS 1.3.0 struct.
135  *
136  * A Map Server may use zero or more LegendURL elements to provide an image(s) of a legend relevant to each Style of a Layer.
137  * The Format element indicates the MIME type of the legend.
138  * Width and height attributes may be provided to assist client applications in laying out space to display the legend.
139  */
141  {
142  std::string m_format;
144  unsigned int m_width;
145  unsigned int m_height;
146 
148  m_width(0),
149  m_height(0)
150  {}
151  };
152 
153  /*!
154  * \brief The Operation WMS 1.3.0 struct.
155  *
156  * For each operation offered by the server,
157  * list the available output formats and the online resource.
158  */
160  {
161  std::vector<std::string> m_formats;
162  std::vector<HTTP> m_dcps;
163  };
164 
165  /*!
166  * \brief The StyleSheeetURL WMS 1.3.0 struct.
167  *
168  * StyleSheeetURL provides symbology information for each Style of a Layer.
169  */
171  {
172  std::string m_format;
174  };
175 
176  /*!
177  * \brief The StyleURL WMS 1.3.0 struct.
178  *
179  * A Map Server may use StyleURL to offer more information about the data or symbology underlying a particular Style.
180  * While the semantics are not well-defined,
181  * as long as the results of an HTTP GET request against the StyleURL are properly MIME-typed,
182  * Viewer Clients and Cascading Map Servers can make use of this.
183  * A possible use could be to allow a Map Server to provide legend information.
184  */
186  {
187  std::string m_format;
189  };
190 
191  /*!
192  * \brief The Style WMS 1.3.0 struct.
193  *
194  * A Style element lists the name by which a style is requested and a human-readable title for pick lists,
195  * optionally (and ideally) provides a human-readable description, and optionally gives a style URL.
196  */
198  {
199  std::string m_name;
200  std::string m_title;
201  std::string m_abstract;
205  };
206 
207  /*!
208  * \brief The Layer WMS 1.3.0 struct.
209  *
210  * Nested list of zero or more map Layers offered by WMS server.
211  */
213  {
214  std::string m_name;
215  std::string m_title;
216  std::string m_abstract;
217  std::vector<std::string> m_crs;
218  std::vector<std::string> m_keywordList;
220  std::vector<BoundingBox> m_boundingBoxes;
221  std::vector<Dimension> m_dimensions;
222  std::vector<Style> m_styles;
225  std::vector<Layer> m_layers;
227  unsigned int m_cascaded;
228  bool m_opaque;
230  unsigned int m_fixedWidth;
231  unsigned int m_fixedHeight;
232 
233  Layer() :
234  m_minScaleDenominator(0.0),
235  m_maxScaleDenominator(0.0),
236  m_queryable(false),
237  m_cascaded(0),
238  m_opaque(false),
239  m_noSubsets(false),
240  m_fixedWidth(0),
241  m_fixedHeight(0)
242  {}
243  };
244 
245  /*!
246  * \brief The Request WMS 1.3.0 struct.
247  *
248  * Available WMS Operations are listed in a Request element.
249  */
251  {
255  };
256 
257  /*!
258  * \brief The Capability WMS 1.3.0 struct.
259  *
260  * A Capability lists available request types.
261  * It also includes an optional list of map layers available from this server.
262  */
264  {
267  };
268 
269  /*!
270  * \brief The Capability WMS 1.3.0 struct.
271  *
272  * A WMSCapabilities document is returned in response
273  * to a GetCapabilities request made on a WMS.
274  */
276  {
278  };
279 
280  /*!
281  * \brief The WMSGetMapRequest WMS 1.3.0 struct.
282  *
283  * A WMSGetMapRequest is a struct to be used on
284  * WMS 1.3.0 GetMap requests.
285  */
287  {
288  std::vector<std::string> m_layers;
289  std::vector<std::string> m_styles;
290  std::string m_srs;
292  int m_width;
293  int m_height;
294  std::string m_format;
296  std::string m_bgColor;
297  std::string m_time;
298 
300  m_srs(TE_OGC_WMS_DEFAULT_SRS),
301  m_width(boost::lexical_cast<int>(TE_OGC_WMS_DEFAULT_WIDTH)),
302  m_height(boost::lexical_cast<int>(TE_OGC_WMS_DEFAULT_HEIGHT)),
304  m_transparent(false),
305  m_bgColor(""),
306  m_time("")
307  {}
308  };
309 
310  /*!
311  * \brief The WMSGetMapResponse WMS 1.3.0 struct.
312  *
313  * A WMSGetMapResponse is a sctruct that is used to
314  * retrieve 1.3.0 GetMap images as a buffer.
315  */
317  {
318  std::string m_buffer;
319  int m_size;
320  std::string m_format;
321  };
322 
323  }
324  }
325  }
326 }
327 
328 #endif
std::vector< std::string > m_layers
Definition: DataTypes.h:288
unsigned int m_cascaded
Definition: DataTypes.h:227
OnlineResource m_onlineResource
Definition: DataTypes.h:188
The Capability WMS 1.3.0 struct.
Definition: DataTypes.h:263
#define TEOGCWMSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:90
std::vector< std::string > m_crs
Definition: DataTypes.h:217
#define TE_OGC_WMS_DEFAULT_IMAGE_FORMAT
It specifies the default image format used on GetMap request.
Definition: Config.h:50
StyleSheetURL m_styleSheetURL
Definition: DataTypes.h:203
std::string m_abstract
Definition: DataTypes.h:216
std::vector< Layer > m_layers
Definition: DataTypes.h:225
unsigned int m_fixedWidth
Definition: DataTypes.h:230
OnlineResource m_onlineResource
Definition: DataTypes.h:143
#define TE_OGC_WMS_DEFAULT_WIDTH
It specifies the default width used on GetMap request.
Definition: Config.h:36
The Capability WMS 1.3.0 struct.
Definition: DataTypes.h:275
#define TE_OGC_WMS_DEFAULT_SRS
It specifies the default SRS used on GetMap request.
Definition: Config.h:57
std::vector< std::string > m_formats
Definition: DataTypes.h:161
std::vector< std::string > m_styles
Definition: DataTypes.h:289
std::vector< Dimension > m_dimensions
Definition: DataTypes.h:221
Configuration flags for the Terrralib WS OGC WMS module.
std::vector< std::string > m_allowedValues
Definition: DataTypes.h:124
std::vector< Style > m_styles
Definition: DataTypes.h:222
URI C++ Library.
The Dimension WMS 1.3.0 struct.
Definition: DataTypes.h:115
The Operation WMS 1.3.0 struct.
Definition: DataTypes.h:159
The Layer WMS 1.3.0 struct.
Definition: DataTypes.h:212
The WMSGetMapResponse WMS 1.3.0 struct.
Definition: DataTypes.h:316
The OnlineResource WMS 1.3.0 struct.
Definition: DataTypes.h:53
The LegendURL WMS 1.3.0 struct.
Definition: DataTypes.h:140
The Style WMS 1.3.0 struct.
Definition: DataTypes.h:197
std::string m_abstract
Definition: DataTypes.h:201
OnlineResource m_onlineResource
Definition: DataTypes.h:173
#define TE_OGC_WMS_DEFAULT_HEIGHT
It specifies the default height used on GetMap request.
Definition: Config.h:43
The Request WMS 1.3.0 struct.
Definition: DataTypes.h:250
std::vector< std::string > m_keywordList
Definition: DataTypes.h:218
The StyleSheeetURL WMS 1.3.0 struct.
Definition: DataTypes.h:170
GeographicBoundingBox m_geoBoundingBox
Definition: DataTypes.h:219
OnlineResource m_post
Definition: DataTypes.h:62
The GeographicBoundingBox WMS 1.3.0 struct.
Definition: DataTypes.h:70
unsigned int m_fixedHeight
Definition: DataTypes.h:231
std::vector< HTTP > m_dcps
Definition: DataTypes.h:162
The StyleURL WMS 1.3.0 struct.
Definition: DataTypes.h:185
std::vector< BoundingBox > m_boundingBoxes
Definition: DataTypes.h:220
The WMSGetMapRequest WMS 1.3.0 struct.
Definition: DataTypes.h:286
OnlineResource m_get
Definition: DataTypes.h:61
The BoundingBox WMS 1.3.0 struct.
Definition: DataTypes.h:90