Utils.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/wms/Utils.h
22 
23  \brief Utility functions for WMS driver.
24 */
25 
26 #ifndef __TERRALIB_WMS_INTERNAL_UTILS_H
27 #define __TERRALIB_WMS_INTERNAL_UTILS_H
28 
29 // TerraLib
30 #include "WMSLayerInfo.h"
31 
32 // STL
33 #include <map>
34 #include <string>
35 
36 namespace te
37 {
38 // Forward declaration
39  namespace gm
40  {
41  class Envelope;
42  }
43 
44  namespace wms
45  {
46  void BuildLayersInfo(char** subdatasets, std::map<std::string, WMSLayerInfo>& info);
47 
48  WMSLayerInfo BuildLayerInfo(const std::map<std::string, std::string>& kvp);
49 
50  void ExtractRequestValues(const std::string& request,
51  std::string& layer,
52  std::string& width,
53  std::string& height,
54  std::string& format);
55 
56  std::string BuildGetMapRequest(const std::string& serverUrl,
57  const WMSLayerInfo& info,
58  const std::string& width,
59  const std::string& height,
60  const std::string& format,
61  const std::string& bbox = "");
62 
63  void GetBBOXValues(const std::string& bbox,
64  std::string& ulx, std::string& uly,
65  std::string& lrx, std::string& lry);
66 
67  void GetBBOXValues(const te::gm::Envelope& e,
68  std::string& ulx, std::string& uly,
69  std::string& lrx, std::string& lry);
70 
71  std::string GetBBOX(const te::gm::Envelope& e);
72 
73  } // end namespace wms
74 } // end namespace te
75 
76 #endif // __TERRALIB_WMS_INTERNAL_UTILS_H
void GetBBOXValues(const std::string &bbox, std::string &ulx, std::string &uly, std::string &lrx, std::string &lry)
WMSLayerInfo BuildLayerInfo(const std::map< std::string, std::string > &kvp)
Informations about WMS Layers.
std::string BuildGetMapRequest(const std::string &serverUrl, const WMSLayerInfo &info, const std::string &width, const std::string &height, const std::string &format, const std::string &bbox="")
std::string GetBBOX(const te::gm::Envelope &e)
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
void BuildLayersInfo(char **subdatasets, std::map< std::string, WMSLayerInfo > &info)
URI C++ Library.
void ExtractRequestValues(const std::string &request, std::string &layer, std::string &width, std::string &height, std::string &format)