GeometryConverters.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/geometry/GeometryConverters.h
22 
23  \brief A set of function that convert a Geometry type to other types and vice-versa.
24 */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_GEOMETRYCONVERTERS_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_GEOMETRYCONVERTERS_H
28 
29 // TerraLib
30 #include "Exception.h"
31 
32 namespace te
33 {
34 // Forward declarations
35  namespace dt
36  {
37  class AbstractData;
38  }
39 
40  namespace gm
41  {
42  /** @name Geometry Methods
43  * Methods related to Geometry conversion.
44  */
45  //@{
46 
47  /*!
48  \brief It converts a Geometry data value to a ByteArray data value.
49 
50  \param d The input data value.
51 
52  \return A new data value converted to ByteArray type. The caller will take the ownership of the returned data.
53 
54  \note The ByteArray data value will contains the Geometry encoded using WKB format.
55 
56  \exception It throws an exception if the input abstract data is not a Geometry type.
57  */
59 
60  /*!
61  \brief It converts a Geometry data value to a String data value.
62 
63  \param d The input data value.
64 
65  \return A new data value converted to String type. The caller will take the ownership of the returned data.
66 
67  \note The String data value will contains the Geometry encoded using WKT format.
68 
69  \exception It throws an exception if the input abstract data is not a Geometry type.
70  */
72 
73  /*!
74  \brief It converts a ByteArray data value to a Geometry data value.
75 
76  \param d The input data value.
77 
78  \return A new data value converted to Geometry type. The caller will take the ownership of the returned data.
79 
80  \note This method consider that the ByteArray data value contains a geometry encoded using WKB format.
81 
82  \exception It throws an exception if the input abstract data is not a ByteArray type.
83  \exception It throws an exception if the conversion can be not done.
84  */
86 
87  /*!
88  \brief It converts a String data value to a Geometry data value.
89 
90  \param d The input data value.
91 
92  \return A new data value converted to Geometry type. The caller will take the ownership of the returned data.
93 
94  \note This method consider that the String data value contains a geometry encoded using WKT format.
95 
96  \exception It throws an exception if the input abstract data is not a String type.
97  \exception It throws an exception if the conversion can be not done.
98  */
100 
101  //@}
102 
103  } // end namespace dt
104 } // end namespace te
105 
106 #endif // __TERRALIB_GEOMETRY_INTERNAL_GEOMETRYCONVERTERS_H
te::dt::AbstractData * StringToGeometryConverter(te::dt::AbstractData *d)
It converts a String data value to a Geometry data value.
URI C++ Library.
te::dt::AbstractData * ByteArrayToGeometryConverter(te::dt::AbstractData *d)
It converts a ByteArray data value to a Geometry data value.
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
te::dt::AbstractData * GeometryToStringConverter(te::dt::AbstractData *d)
It converts a Geometry data value to a String data value.
An exception class for the Geometry module.
te::dt::AbstractData * GeometryToByteArrayConverter(te::dt::AbstractData *d)
It converts a Geometry data value to a ByteArray data value.