Loading...
Searching...
No Matches
ObservationDataSetLayer.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/ObservationDataSetLayer.h
22
23 \brief A layer with a reference to an ObservationDataSet.
24*/
25
26#ifndef __TERRALIB_ST_INTERNAL_OBSERVATIONDATASETLAYER_H
27#define __TERRALIB_ST_INTERNAL_OBSERVATIONDATASETLAYER_H
28
29// ST
30#include "../Config.h"
32
33namespace te
34{
35 namespace st
36 {
37
38 //Forward declarations
39 class ObservationDataSet;
40 class ObservationDataSetInfo;
41
43
44 /*!
45 \class ObservationDataSetLayer
46
47 \brief A layer with reference to a dataset that contains observations.
48
49 \sa AbstractLayer, AbstractSTDataSetLayer
50 */
52 {
53 public:
54
55 /*!
56 \brief It initializes a new layer.
57
58 \param parent The parent layer (NULL if it has no parent).
59 \param info Infos about the data source and its data set that contains observations.
60
61 \note It will take the ownership of the given pointer info
62 */
63 ObservationDataSetLayer(AbstractLayer* parent, ObservationDataSetInfo* info);
64
65 /*!
66 \brief It initializes a new layer.
67
68 \param id The layer id.
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 ObservationDataSetLayer(const std::string& id, AbstractLayer* parent, ObservationDataSetInfo* info);
75
76 /*!
77 \brief It initializes a new Layer.
78
79 \param id The layer id.
80 \param title The title is a brief description about the layer.
81 \param parent The parent layer (NULL if it has no parent).
82 \param info Infos about the data source and its data set that contains observations.
83
84 \note It will take the ownership of the given pointer info
85 */
86 ObservationDataSetLayer(const std::string& id, const std::string& title, AbstractLayer* parent, ObservationDataSetInfo* info);
87
88 /*! \brief Destructor. */
90
91 AbstractLayer* clone() { return nullptr; }
92
93 std::unique_ptr<LayerSchema> getSchema() const;
94
95 /*!
96 \brief It returns the layer temporal extent.
97
98 \return The layer temporal extent.
99 */
101
102 std::unique_ptr<te::da::DataSet> getData(te::common::TraverseType travType = te::common::FORWARDONLY,
103 const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
104
105 std::unique_ptr<te::da::DataSet> getData(const std::string& propertyName,
106 const te::gm::Envelope* e,
109 const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
110
111 std::unique_ptr<te::da::DataSet> getData(const std::string& propertyName,
112 const te::gm::Geometry* g,
115 const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
116
117 std::unique_ptr<te::da::DataSet> getData(te::da::Expression* restriction,
119 const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
120
121 std::unique_ptr<te::da::DataSet> getData(const te::da::ObjectIdSet* oids,
123 const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
124
125 std::unique_ptr<te::st::ObservationDataSet> getObservationDataset(te::common::TraverseType travType = te::common::FORWARDONLY) const;
126
127 std::unique_ptr<te::st::ObservationDataSet> getObservationDataset(const te::gm::Envelope& e,
130
131 std::unique_ptr<te::st::ObservationDataSet> getObservationDataset(const te::gm::Geometry& g,
134
135 std::unique_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation r = te::dt::DURING,
138
139 std::unique_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
143
144 std::unique_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
148
149 std::unique_ptr<te::st::ObservationDataSet> getObservationDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation r = te::dt::DURING,
151
152 std::unique_ptr<te::st::ObservationDataSet> getObservationDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
155
156 std::unique_ptr<te::st::ObservationDataSet> getObservationDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
159
160 bool isValid() const;
161
162 void draw(te::map::Canvas* canvas, const te::gm::Envelope& bbox, int srid, const double& scale, bool* cancel);
163
164 /*!
165 \brief It returns the layer type: OBSERVATIONDATASETLAYER.
166
167 \return The layer type: OBSERVATIONDATASETLAYER.
168 */
169 const std::string& getType() const;
170
171 /*!
172 \brief
173
174 \return
175 */
176 const std::string& getDataSourceId() const;
177
178 /*!
179 \brief
180
181 \return
182 */
183 const std::string& getRendererType() const;
184
185 /*!
186 \brief
187
188 \param t
189 */
190 void setRendererType(const std::string& t);
191
192 private:
193
194 std::unique_ptr<ObservationDataSetInfo> m_info; //!< Infos about the data source and its data set that contains observations.
195 std::string m_rendererType; //!< A pointer to the internal renderer used to paint this layer.
196 static const std::string sm_type; //!< A static data member used in the implementation of getType method.
197 };
198
199 typedef boost::intrusive_ptr<ObservationDataSetLayer> ObservationDataSetLayerPtr;
200
201 } // end namespace st
202} // end namespace te
203
204#endif // __TERRALIB_ST_INTERNAL_OBSERVATIONDATASETLAYER_H
205
This file has the AbstractSTDataSetLayer class that provides an abstract interface for layers that co...
A class that models the description of a dataset.
Definition: DataSetType.h:73
This is an abstract class that models a query expression.
Definition: Expression.h:48
This class represents a set of unique ids created in the same context. i.e. from the same data set.
Definition: ObjectIdSet.h:56
An abstract class to represent a period of date and time.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:93
A layer with reference to a dataset that contains spatiotemporal data.
A class that contains infos about a DataSet that contains observations.
A layer with reference to a dataset that contains observations.
std::unique_ptr< te::st::ObservationDataSet > getObservationDataset(const te::dt::DateTime &dt, te::dt::TemporalRelation r=te::dt::DURING, te::common::TraverseType travType=te::common::FORWARDONLY) const
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.
std::unique_ptr< te::st::ObservationDataSet > getObservationDataset(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
std::unique_ptr< te::st::ObservationDataSet > getObservationDataset(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::dt::DateTimePeriod * getTemporalExtent() const
It returns the layer temporal extent.
ObservationDataSetLayer(const std::string &id, const std::string &title, AbstractLayer *parent, ObservationDataSetInfo *info)
It initializes a new Layer.
AbstractLayer * clone()
It returns a clone of the object.
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.
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.
void setRendererType(const std::string &t)
const std::string & getType() const
It returns the layer type: OBSERVATIONDATASETLAYER.
static const std::string sm_type
A static data member used in the implementation of getType method.
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...
std::unique_ptr< te::st::ObservationDataSet > getObservationDataset(te::common::TraverseType travType=te::common::FORWARDONLY) const
std::unique_ptr< te::st::ObservationDataSet > getObservationDataset(const te::gm::Geometry &g, te::gm::SpatialRelation r, te::common::TraverseType travType=te::common::FORWARDONLY) const
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.
std::unique_ptr< LayerSchema > getSchema() const
It returns the layer schema.
const std::string & getRendererType() const
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...
std::unique_ptr< te::st::ObservationDataSet > getObservationDataset(const te::gm::Envelope &e, te::gm::SpatialRelation r=te::gm::INTERSECTS, te::common::TraverseType travType=te::common::FORWARDONLY) const
const std::string & getDataSourceId() const
bool isValid() const
It returns true if the layer can be used for instance to draw, otherwise, it returns false.
ObservationDataSetLayer(const std::string &id, AbstractLayer *parent, ObservationDataSetInfo *info)
It initializes a new layer.
std::string m_rendererType
A pointer to the internal renderer used to paint this layer.
ObservationDataSetLayer(AbstractLayer *parent, ObservationDataSetInfo *info)
It initializes a new layer.
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...
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.
std::unique_ptr< ObservationDataSetInfo > m_info
Infos about the data source and its data set that contains observations.
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.
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:54
@ FORWARDONLY
Definition: Enums.h:55
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:41
@ RAccess
Definition: Enums.h:43
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
Definition: Enums.h:141
@ DURING
Definition: Enums.h:145
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:128
@ INTERSECTS
Definition: Enums.h:130
boost::intrusive_ptr< ObservationDataSetLayer > ObservationDataSetLayerPtr
te::da::DataSetType LayerSchema
TerraLib.
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88