AbstractSTDataSetLayer.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/st/maptools/AbstractSTDataSetLayer.h
22 
23  \brief This file has the AbstractSTDataSetLayer class that provides an abstract interface
24  for layers that contains a DataSet with spatiotemporal data.
25 */
26 
27 #ifndef __TERRALIB_ST_INTERNAL_ABSTRACTSTDATASETLAYER_H
28 #define __TERRALIB_ST_INTERNAL_ABSTRACTSTDATASETLAYER_H
29 
30 // ST
31 #include "../Config.h"
32 
33 // TerraLib
34 #include "../../datatype/Enums.h"
35 #include "../../maptools/AbstractLayer.h"
36 
37 // Forward declaration
38 namespace te { namespace dt { class DateTime; class DateTimePeriod; } }
39 
40 namespace te
41 {
42 
43  namespace st
44  {
45  /*!
46  \class AbstractSTDataSetLayer
47 
48  \brief A layer with reference to a dataset that contains spatiotemporal data.
49 
50  \sa AbstractLayer
51  */
53  {
54  public:
55 
56  /*!
57  \brief It initializes a new layer.
58 
59  \param parent The parent layer (NULL if it has no parent).
60  */
61  AbstractSTDataSetLayer(AbstractLayer* parent = 0);
62 
63  /*!
64  \brief It initializes a new layer.
65 
66  \param id The layer id.
67  \param parent The parent layer (NULL if it has no parent).
68  */
69  AbstractSTDataSetLayer(const std::string& id, AbstractLayer* parent = 0);
70 
71  /*!
72  \brief It initializes a new Layer.
73 
74  \param id The layer id.
75  \param title The title is a brief description about the layer.
76  \param parent The parent layer (NULL if it has no parent).
77  */
78  AbstractSTDataSetLayer(const std::string& id, const std::string& title, AbstractLayer* parent = 0);
79 
80 
81  /*! \brief Virtual Destructor. */
83 
84  /*!
85  \brief It returns the layer temporal extent.
86 
87  \return The layer temporal extent.
88  */
89  virtual te::dt::DateTimePeriod* getTemporalExtent() const = 0;
90 
91  /*!
92  \brief It gets the dataset using a temporal filter over the phenomenon time property.
93 
94  The possible temporal relations are: 1. AFTER;
95  2. AFTER | EQUALS; 3. BEFORE; 4. BEFORE | EQUALS; 5. DURING; 6. EQUALS
96 
97  \param dt A given datetime to be used as a temporal filter when retrieving datasets.
98  \param r The temporal relation to be used during the filter.
99  \param travType The traverse type associated to the returned dataset.
100  \param rwRole The read and write permission associated to the returned dataset.
101 
102  \return A pointer to a new DataSet.
103 
104  \note The caller will take the ownership of the returned pointer.
105  \note When the temporal relation is DURING, dt must be a time period.
106 
107  \exception Exception It can throws an exception if:
108  <ul>
109  <li>something goes wrong during data retrieval</li>
110  <li>if the data source driver doesn't support the traversal type</li>
111  <li>if the data source driver doesn't support the access policy</li>
112  </ul>
113 
114  \note Not thread-safe!
115  */
116  virtual std::auto_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation r = te::dt::DURING,
118  te::common::AccessPolicy rwRole = te::common::RAccess) const = 0;
119 
120  /*!
121  \brief It gets the dataset using a temporal filter over the phenomenon time property
122  and a spatial filter over the observed geometry property.
123 
124  The possible temporal relations are: 1. AFTER;
125  2. AFTER | EQUALS; 3. BEFORE; 4. BEFORE | EQUALS; 5. DURING; 6. EQUALS
126 
127  \param dt A given datetime to be used as a temporal filter when retrieving datasets.
128  \param tr The temporal relation to be used during the filter.
129  \param e A rectangle to be used as a spatial filter when retrieving datasets.
130  \param sr The spatial relation to be used during the filter.
131  \param travType The traverse type associated to the returned dataset.
132  \param rwRole The read and write permission associated to the returned dataset.
133 
134  \return A pointer to a new DataSet.
135 
136  \note The caller will take the ownership of the returned pointer.
137  \note When the temporal relation is DURING, dt must be a time period.
138 
139  \exception Exception It can throws an exception if:
140  <ul>
141  <li>something goes wrong during data retrieval</li>
142  <li>if the data source driver doesn't support the traversal type</li>
143  <li>if the data source driver doesn't support the access policy</li>
144  </ul>
145 
146  \note Not thread-safe!
147  */
148  virtual std::auto_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
151  te::common::AccessPolicy rwRole = te::common::RAccess) const = 0;
152 
153  /*!
154  \brief It gets the dataset using a temporal filter over the phenomenon time property
155  and a spatial filter over the observed geometry property.
156 
157  The possible temporal relations are: 1. AFTER;
158  2. AFTER | EQUALS; 3. BEFORE; 4. BEFORE | EQUALS; 5. DURING; 6. EQUALS
159 
160  \param dt A given datetime to be used as a temporal filter when retrieving datasets.
161  \param tr The temporal relation to be used during the filter.
162  \param g A geometry to be used as a spatial filter when retrieving datasets.
163  \param sr The spatial relation to be used during the filter.
164  \param travType The traverse type associated to the returned dataset.
165  \param rwRole The read and write permission associated to the returned dataset.
166 
167  \return A pointer to a new DataSet.
168 
169  \note The caller will take the ownership of the returned pointer.
170  \note When the temporal relation is DURING, dt must be a time period.
171 
172  \exception Exception It can throws an exception if:
173  <ul>
174  <li>something goes wrong during data retrieval</li>
175  <li>if the data source driver doesn't support the traversal type</li>
176  <li>if the data source driver doesn't support the access policy</li>
177  </ul>
178 
179  \note Not thread-safe!
180  */
181  virtual std::auto_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
184  te::common::AccessPolicy rwRole = te::common::RAccess) const = 0;
185  };
186  } // end namespace st
187 } // end namespace te
188 
189 #endif // __TERRALIB_ST_INTERNAL_ABSTRACTSTDATASETLAYER_H
190 
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88
This is the base class for layers.
Definition: AbstractLayer.h:76
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
Definition: Enums.h:140
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:127
virtual ~AbstractSTDataSetLayer()
Virtual Destructor.
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:40
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:53
A layer with reference to a dataset that contains spatiotemporal data.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:74
An abstract class to represent a period of date and time.