TrajectoryDataSetLayer.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/TrajectoryDataSetLayer.h
22 
23  \brief A layer with a reference to an TrajectoryDataSet.
24 */
25 
26 #ifndef __TERRALIB_ST_INTERNAL_TRAJECTORYDATASETLAYER_H
27 #define __TERRALIB_ST_INTERNAL_TRAJECTORYDATASETLAYER_H
28 
29 // ST
30 #include "../Config.h"
31 #include "AbstractSTDataSetLayer.h"
32 
33 // Boost
34 #include <boost/ptr_container/ptr_vector.hpp>
35 
36 namespace te
37 {
38  namespace st
39  {
40 
41  //Forward declarations
42  class TrajectoryDataSet;
43  class TrajectoryDataSetInfo;
44 
46 
47  /*!
48  \class TrajectoryDataSetLayer
49 
50  \brief A layer with reference to a dataset that contains trajectories.
51 
52  \sa AbstractLayer, AbstractSTDataSetLayer
53  */
55  {
56  public:
57 
58 
59  /*!
60  \brief It initializes a new layer.
61 
62  \param parent The parent layer (NULL if it has no parent).
63  */
64  TrajectoryDataSetLayer(AbstractLayer* parent = 0);
65 
66  /*!
67  \brief It initializes a new layer.
68 
69  \param parent The parent layer (NULL if it has no parent).
70  \param info Infos about the data source and its data set that contains observations.
71 
72  \note It will take the ownership of the given pointer info
73  */
74  TrajectoryDataSetLayer(AbstractLayer* parent, TrajectoryDataSetInfo* info);
75 
76  /*!
77  \brief It initializes a new layer.
78 
79  \param id The layer id.
80  \param parent The parent layer (NULL if it has no parent).
81  \param info Infos about the data source and its data set that contains observations.
82 
83  \note It will take the ownership of the given pointer info
84  */
85  TrajectoryDataSetLayer(const std::string& id, AbstractLayer* parent, TrajectoryDataSetInfo* info);
86 
87  /*!
88  \brief It initializes a new Layer.
89 
90  \param id The layer id.
91  \param title The title is a brief description about the layer.
92  \param parent The parent layer (NULL if it has no parent).
93  \param info Infos about the data source and its data set that contains observations.
94 
95  \note It will take the ownership of the given pointer info
96  */
97  TrajectoryDataSetLayer(const std::string& id, const std::string& title, AbstractLayer* parent, TrajectoryDataSetInfo* info);
98 
99  /*! \brief Destructor. */
101 
102  AbstractLayer* clone() { return nullptr; }
103 
104  std::unique_ptr<LayerSchema> getSchema() const;
105 
106  /*!
107  \brief It returns the layer temporal extent.
108 
109  \return The layer temporal extent.
110  */
112 
113  std::unique_ptr<te::da::DataSet> getData(te::common::TraverseType travType = te::common::FORWARDONLY,
114  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
115 
116  std::unique_ptr<te::da::DataSet> getData(const std::string& propertyName,
117  const te::gm::Envelope* e,
120  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
121 
122  std::unique_ptr<te::da::DataSet> getData(const std::string& propertyName,
123  const te::gm::Geometry* g,
126  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
127 
128  std::unique_ptr<te::da::DataSet> getData(te::da::Expression* restriction,
130  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
131 
132  std::unique_ptr<te::da::DataSet> getData(const te::da::ObjectIdSet* oids,
134  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
135 
136  std::unique_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset(te::common::TraverseType travType = te::common::FORWARDONLY) const;
137 
138  std::unique_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset(const te::gm::Envelope& e,
141 
142  std::unique_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset(const te::gm::Geometry& g,
145 
146  std::unique_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation r = te::dt::DURING,
149 
150  std::unique_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
154 
155  std::unique_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
159 
160  std::unique_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation r = te::dt::DURING,
162 
163  std::unique_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
166 
167  std::unique_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
170 
171  bool isValid() const;
172 
173  void draw(te::map::Canvas* canvas, const te::gm::Envelope& bbox, int srid, const double& scale, bool* cancel);
174 
175  /*!
176  \brief It returns the layer type: TRAJECTORYDATASETLAYER.
177 
178  \return The layer type: TRAJECTORYDATASETLAYER.
179  */
180  const std::string& getType() const;
181 
182  /*!
183  \brief
184 
185  \return
186  */
187  const std::string& getDataSourceId() const;
188 
189  /*!
190  \brief
191 
192  \return
193  */
194  const std::string& getRendererType() const;
195 
196  /*!
197  \brief
198 
199  \param t
200  */
201  void setRendererType(const std::string& t);
202 
203  /*!
204  \brief Checks if the layer has any childs
205 
206  \return true if the layer has any childs, otherwise returns false
207  */
208 
209  bool hasChilds();
210 
211  private:
212 
213  boost::ptr_vector<TrajectoryDataSetLayer> m_layers; //!, A container the holds any child layers.
214  std::unique_ptr<TrajectoryDataSetInfo> m_info; //!< Infos about the data source and its data set that contains observations.
215  std::string m_rendererType; //!< A pointer to the internal renderer used to paint this layer.
216  static const std::string sm_type; //!< A static data member used in the implementation of getType method.
217  };
218 
219  typedef boost::intrusive_ptr<TrajectoryDataSetLayer> TrajectoryDataSetLayerPtr;
220 
221  } // end namespace st
222 } // end namespace te
223 
224 #endif // __TERRALIB_ST_INTERNAL_TRAJECTORYDATASETLAYER_H
te::st::TrajectoryDataSetLayer::sm_type
static const std::string sm_type
A static data member used in the implementation of getType method.
Definition: TrajectoryDataSetLayer.h:216
te::gm::Envelope
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
te::st::TrajectoryDataSetLayer::~TrajectoryDataSetLayer
~TrajectoryDataSetLayer()
Destructor.
te::st::TrajectoryDataSetLayer::getTrajectoryDataset
std::unique_ptr< te::st::TrajectoryDataSet > getTrajectoryDataset(const te::dt::DateTime &dt, te::dt::TemporalRelation r=te::dt::DURING, te::common::TraverseType travType=te::common::FORWARDONLY) const
te::st::TrajectoryDataSetLayer::setRendererType
void setRendererType(const std::string &t)
te::st::TrajectoryDataSetLayer::getDataSourceId
const std::string & getDataSourceId() const
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::st::TrajectoryDataSetLayer::getData
std::unique_ptr< te::da::DataSet > getData(const te::dt::DateTime &dt, te::dt::TemporalRelation tr, const te::gm::Envelope &e, te::gm::SpatialRelation sr=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY, te::common::AccessPolicy rwRole=te::common::RAccess) const
It gets the dataset using a temporal filter over the phenomenon time property and a spatial filter ov...
te::common::RAccess
@ RAccess
Definition: Enums.h:43
te::st::TrajectoryDataSetLayer::hasChilds
bool hasChilds()
Checks if the layer has any childs.
te::dt::DateTime
Definition: DateTime.h:56
te::st::TrajectoryDataSetLayer::getTrajectoryDataset
std::unique_ptr< te::st::TrajectoryDataSet > getTrajectoryDataset(const te::dt::DateTime &dt, te::dt::TemporalRelation tr, const te::gm::Geometry &g, te::gm::SpatialRelation sr=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY) const
te::dt::DateTimePeriod
An abstract class to represent a period of date and time.
Definition: DateTimePeriod.h:49
te::st::TrajectoryDataSetLayer::TrajectoryDataSetLayer
TrajectoryDataSetLayer(AbstractLayer *parent=0)
It initializes a new layer.
te::st::TrajectoryDataSetLayer::isValid
bool isValid() const
It returns true if the layer can be used for instance to draw, otherwise, it returns false.
te::st::TrajectoryDataSetLayer::getData
std::unique_ptr< te::da::DataSet > getData(const std::string &propertyName, const te::gm::Geometry *g, te::gm::SpatialRelation r, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const
It gets the dataset identified by the layer name using a spatial filter over the given geometric prop...
te::st::TrajectoryDataSetLayer::m_layers
boost::ptr_vector< TrajectoryDataSetLayer > m_layers
Definition: TrajectoryDataSetLayer.h:213
te::st::TrajectoryDataSetLayer::clone
AbstractLayer * clone()
It returns a clone of the object.
Definition: TrajectoryDataSetLayer.h:102
te::dt::DURING
@ DURING
Definition: Enums.h:145
te::common::TraverseType
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:54
te::st::TrajectoryDataSetLayer::getType
const std::string & getType() const
It returns the layer type: TRAJECTORYDATASETLAYER.
te::st::TrajectoryDataSetLayer::getTrajectoryDataset
std::unique_ptr< te::st::TrajectoryDataSet > getTrajectoryDataset(const te::dt::DateTime &dt, te::dt::TemporalRelation tr, const te::gm::Envelope &e, te::gm::SpatialRelation sr=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY) const
te::st::TrajectoryDataSetLayer::getData
std::unique_ptr< te::da::DataSet > getData(const te::dt::DateTime &dt, te::dt::TemporalRelation tr, const te::gm::Geometry &g, te::gm::SpatialRelation sr=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY, te::common::AccessPolicy rwRole=te::common::RAccess) const
It gets the dataset using a temporal filter over the phenomenon time property and a spatial filter ov...
te::st::TrajectoryDataSetLayer::getData
std::unique_ptr< te::da::DataSet > getData(const te::dt::DateTime &dt, te::dt::TemporalRelation r=te::dt::DURING, te::common::TraverseType travType=te::common::FORWARDONLY, te::common::AccessPolicy rwRole=te::common::RAccess) const
It gets the dataset using a temporal filter over the phenomenon time property.
te::st::TrajectoryDataSetLayer::getTrajectoryDataset
std::unique_ptr< te::st::TrajectoryDataSet > getTrajectoryDataset(const te::gm::Geometry &g, te::gm::SpatialRelation r, te::common::TraverseType travType=te::common::FORWARDONLY) const
te::st::LayerSchema
te::da::DataSetType LayerSchema
Definition: ObservationDataSetLayer.h:40
te::st::TrajectoryDataSetLayer::getData
std::unique_ptr< te::da::DataSet > getData(const std::string &propertyName, const te::gm::Envelope *e, te::gm::SpatialRelation r=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const
It gets the dataset identified by the layer name using a spatial filter over the specified property.
te::st::TrajectoryDataSetLayer::m_info
std::unique_ptr< TrajectoryDataSetInfo > m_info
, A container the holds any child layers.
Definition: TrajectoryDataSetLayer.h:214
te::st::TrajectoryDataSetLayer::getRendererType
const std::string & getRendererType() const
te::st::TrajectoryDataSetLayer::getSchema
std::unique_ptr< LayerSchema > getSchema() const
It returns the layer schema.
te::st::TrajectoryDataSetLayer::m_rendererType
std::string m_rendererType
A pointer to the internal renderer used to paint this layer.
Definition: TrajectoryDataSetLayer.h:215
te::st::TrajectoryDataSetInfo
A class that contains infos about a DataSet that contains observations of one or more trajectories.
Definition: TrajectoryDataSetInfo.h:60
te::gm::SpatialRelation
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:128
te::da::Expression
This is an abstract class that models a query expression.
Definition: Expression.h:48
te::st::TrajectoryDataSetLayer::getData
std::unique_ptr< te::da::DataSet > getData(te::da::Expression *restriction, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const
It gets the dataset identified by the layer name using the given restriction.
te::st::TrajectoryDataSetLayer::TrajectoryDataSetLayer
TrajectoryDataSetLayer(const std::string &id, AbstractLayer *parent, TrajectoryDataSetInfo *info)
It initializes a new layer.
te::map::Canvas
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:93
te::st::AbstractSTDataSetLayer
A layer with reference to a dataset that contains spatiotemporal data.
Definition: AbstractSTDataSetLayer.h:53
te::gm::INTERSECTS
@ INTERSECTS
Definition: Enums.h:130
AbstractSTDataSetLayer.h
This file has the AbstractSTDataSetLayer class that provides an abstract interface for layers that co...
TESTEXPORT
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88
te::st::TrajectoryDataSetLayerPtr
boost::intrusive_ptr< TrajectoryDataSetLayer > TrajectoryDataSetLayerPtr
Definition: TrajectoryDataSetLayer.h:219
te::st::TrajectoryDataSetLayer::TrajectoryDataSetLayer
TrajectoryDataSetLayer(AbstractLayer *parent, TrajectoryDataSetInfo *info)
It initializes a new layer.
te::st::TrajectoryDataSetLayer::getData
std::unique_ptr< te::da::DataSet > getData(const te::da::ObjectIdSet *oids, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const
It gets the dataset from the given set of objects identification.
te::st::TrajectoryDataSetLayer::draw
void draw(te::map::Canvas *canvas, const te::gm::Envelope &bbox, int srid, const double &scale, bool *cancel)
It draws the layer geographic objects in the given canvas using the informed SRS.
te::st::TrajectoryDataSetLayer::getData
std::unique_ptr< te::da::DataSet > getData(te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess) const
It gets the dataset identified by the layer name.
te::st::TrajectoryDataSetLayer::getTrajectoryDataset
std::unique_ptr< te::st::TrajectoryDataSet > getTrajectoryDataset(te::common::TraverseType travType=te::common::FORWARDONLY) const
te::st::TrajectoryDataSetLayer::getTrajectoryDataset
std::unique_ptr< te::st::TrajectoryDataSet > getTrajectoryDataset(const te::gm::Envelope &e, te::gm::SpatialRelation r=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY) const
te::st::TrajectoryDataSetLayer::TrajectoryDataSetLayer
TrajectoryDataSetLayer(const std::string &id, const std::string &title, AbstractLayer *parent, TrajectoryDataSetInfo *info)
It initializes a new Layer.
te::st::TrajectoryDataSetLayer::getTemporalExtent
te::dt::DateTimePeriod * getTemporalExtent() const
It returns the layer temporal extent.
te::da::DataSetType
A class that models the description of a dataset.
Definition: DataSetType.h:73
te::gm::Geometry
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
te::dt::TemporalRelation
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
Definition: Enums.h:141
te::common::AccessPolicy
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:41
te::da::ObjectIdSet
This class represents a set of unique ids created in the same context. i.e. from the same data set.
Definition: ObjectIdSet.h:56
te::st::TrajectoryDataSetLayer
A layer with reference to a dataset that contains trajectories.
Definition: TrajectoryDataSetLayer.h:55
te::common::FORWARDONLY
@ FORWARDONLY
Definition: Enums.h:55