All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
STDataLoaderFromMemDS.cpp
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 STDataLoaderFromMemDS.cpp
22 
23  \brief This file contains a class responsible for loading spatiotemporal data
24  from a ST in-memory DataSource which contains an internal chache of
25  in-memory DataSets indexed by space and time.
26 */
27 
28 //TerraLib
29 #include "../../dataaccess/datasource/DataSourceInfo.h"
30 #include "../../dataaccess/datasource/DataSourceManager.h"
31 #include "../../dataaccess/dataset/DataSet.h"
32 #include "../../dataaccess/utils/Utils.h"
33 #include "../../datatype/DateTimePeriod.h"
34 #include "../../geometry/Utils.h"
35 
36 //STMEM
37 #include "../../stmemory/DataSource.h"
38 #include "../../stmemory/DataSet.h"
39 
40 //ST
41 #include "../Exception.h"
42 #include "../Utils.h"
43 #include "../Globals.h"
44 #include "STDataLoaderFromMemDS.h"
45 #include "../core/observation/ObservationDataSetInfo.h"
46 #include "../core/trajectory/TrajectoryDataSetInfo.h"
47 #include "../core/timeseries/TimeSeriesDataSetInfo.h"
48 #include "../core/observation/ObservationDataSet.h"
49 #include "../core/trajectory/TrajectoryDataSet.h"
50 #include "../core/timeseries/TimeSeriesDataSet.h"
51 
52 //STL
53 #include <vector>
54 
56 {
57  //use the DataSourceManager to get the DataSource
59 
60  if(m_ds.get()==0)
61  throw Exception("The STDataLoader is not inialized! Please, use the method STDataLoader::initialize");
62 
63  if(!m_ds->isOpened())
64  m_ds->open();
65 }
66 
67 std::auto_ptr<te::st::ObservationDataSet>
69  te::common::TraverseType travType)
70 {
71  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
72  if(!m_ds->dataSetExists(info.getDataSetName()))
73  loadDataSet(info.getDataSourceInfo(), info.getDataSetName(), info.getBeginTimePropName(),
74  info.getEndTimePropName(), info.getGeomPropName());
75 
76  std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.getDataSetName(), travType));
77 
78  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
79 }
80 
81 
82 std::auto_ptr<te::st::ObservationDataSet>
85 {
86  if(!info.hasGeomProp())
87  return std::auto_ptr<te::st::ObservationDataSet>();
88 
89  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
90  if(!m_ds->dataSetExists(info.getDataSetName()))
91  loadDataSet(info.getDataSourceInfo(), info.getDataSetName(), info.getBeginTimePropName(),
92  info.getEndTimePropName(), info.getGeomPropName());
93 
94  //get the geometry property name
95  std::string geomPropName = info.getGeomPropName();
96 
97  //get the data set applying he filter
98  std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.getDataSetName(), geomPropName, &e, r, travType));
99 
100  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
101 }
102 
103 std::auto_ptr<te::st::ObservationDataSet>
106 {
107  if(!info.hasGeomProp())
108  return std::auto_ptr<te::st::ObservationDataSet>();
109 
110  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
111  if(!m_ds->dataSetExists(info.getDataSetName()))
112  loadDataSet(info.getDataSourceInfo(), info.getDataSetName(), info.getBeginTimePropName(),
113  info.getEndTimePropName(), info.getGeomPropName());
114 
115  //get the geometry property name
116  std::string geomPropName = info.getGeomPropName();
117 
118  //get the data set applying he filter
119  std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.getDataSetName(), geomPropName, &geom, r, travType));
120 
121  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
122 }
123 
124 std::auto_ptr<te::st::ObservationDataSet>
127  te::common::TraverseType travType)
128 {
129  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
130  if(!m_ds->dataSetExists(info.getDataSetName()))
131  loadDataSet(info.getDataSourceInfo(), info.getDataSetName(), info.getBeginTimePropName(),
132  info.getEndTimePropName(), info.getGeomPropName());
133 
134  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
135 
136  std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(info.getDataSetName(), &dt, r, travType));
137 
138  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
139 }
140 
141 std::auto_ptr<te::st::ObservationDataSet>
143  const te::dt::DateTime& dt,
145  const te::gm::Envelope& e,
147  te::common::TraverseType travType)
148 {
149  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
150  if(!m_ds->dataSetExists(info.getDataSetName()))
151  loadDataSet(info.getDataSourceInfo(), info.getDataSetName(), info.getBeginTimePropName(),
152  info.getEndTimePropName(), info.getGeomPropName());
153 
154  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
155 
156  std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
157  info.getDataSetName(), &e, sr, &dt, tr, travType));
158 
159  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
160 }
161 
162 std::auto_ptr<te::st::ObservationDataSet>
166  te::common::TraverseType travType)
167 {
168  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
169  if(!m_ds->dataSetExists(info.getDataSetName()))
170  loadDataSet(info.getDataSourceInfo(), info.getDataSetName(), info.getBeginTimePropName(),
171  info.getEndTimePropName(), info.getGeomPropName());
172 
173  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
174 
175  std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(info.getDataSetName(), &geom, sr, &dt, tr, travType));
176 
177  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
178 }
179 
180 void
181 te::st::STDataLoaderFromMemDS::getInfo( const TrajectoryDataSetInfo& /*input*/, std::vector<TrajectoryDataSetInfo>& /*output*/)
182 {
183  return;
184 }
185 
186 std::auto_ptr<te::st::TrajectoryDataSet>
188 {
189  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
190  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
195 
196  //get the data set
197  std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.getObservationDataSetInfo().getDataSetName(), travType));
198 
199  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
200 }
201 
202 std::auto_ptr<te::st::TrajectoryDataSet>
205  te::common::TraverseType travType)
206 {
208  return std::auto_ptr<te::st::TrajectoryDataSet>();
209 
210  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
211  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
216 
217  //get data set type to get the geometry property name
218  std::string geomPropName = info.getObservationDataSetInfo().getGeomPropName();
219 
220  //get the data set, applying the spatial filter
221  std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.getObservationDataSetInfo().getDataSetName(),
222  geomPropName, &geom, r, travType));
223 
224  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
225 }
226 
227 std::auto_ptr<te::st::TrajectoryDataSet>
230  te::common::TraverseType travType)
231 {
233  return std::auto_ptr<te::st::TrajectoryDataSet>();
234 
235  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
236  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
241 
242  //get data set type to get the geometry property name
243  std::string geomPropName = info.getObservationDataSetInfo().getGeomPropName();
244 
245  //get the data set, applying the spatial filter
246  std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.getObservationDataSetInfo().getDataSetName(),
247  geomPropName, &e, r, travType));
248 
249  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
250 }
251 
252 std::auto_ptr<te::st::TrajectoryDataSet>
255  te::common::TraverseType travType)
256 {
257  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
258  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
263 
264  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
265 
266  std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
267  info.getObservationDataSetInfo().getDataSetName(), &dt, r, travType));
268 
269  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
270 }
271 
272 std::auto_ptr<te::st::TrajectoryDataSet>
274  const te::dt::DateTime& dt,
276  const te::gm::Envelope& e,
278  te::common::TraverseType travType)
279 {
280  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
281  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
286 
287  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
288 
289  std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
290  info.getObservationDataSetInfo().getDataSetName(), &e, sr, &dt, tr, travType));
291 
292  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
293 }
294 
295 std::auto_ptr<te::st::TrajectoryDataSet>
299  te::common::TraverseType travType)
300 {
301  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
302  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
307 
308  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
309 
310  std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
311  info.getObservationDataSetInfo().getDataSetName(), &geom, sr, &dt, tr, travType));
312 
313  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
314 }
315 
317  std::vector<TimeSeriesDataSetInfo>& /*output*/)
318 {
319  return;
320 }
321 
322 std::auto_ptr<te::st::TimeSeriesDataSet>
324  te::common::TraverseType travType)
325 {
326  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
327  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
332 
333  //get the data set
334  std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.getObservationDataSetInfo().getDataSetName(), travType));
335 
336  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
337 }
338 
339 std::auto_ptr<te::st::TimeSeriesDataSet>
342  te::common::TraverseType travType)
343 {
345  return std::auto_ptr<te::st::TimeSeriesDataSet>();
346 
347  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
348  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
353 
354  //get data set type to get the geometry property name
355  std::string geomPropName = info.getObservationDataSetInfo().getGeomPropName();
356 
357  //get the data set, applying the spatial filter
358  std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.getObservationDataSetInfo().getDataSetName(),
359  geomPropName, &geom, r, travType));
360 
361  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
362 }
363 
364 std::auto_ptr<te::st::TimeSeriesDataSet>
367  te::common::TraverseType travType)
368 {
370  return std::auto_ptr<te::st::TimeSeriesDataSet>();
371 
372  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
373  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
378 
379  //get data set type to get the geometry property name
380  std::string geomPropName = info.getObservationDataSetInfo().getGeomPropName();
381 
382  //get the data set, applying the spatial filter
383  std::auto_ptr<te::da::DataSet> dset(m_ds->getDataSet(info.getObservationDataSetInfo().getDataSetName(),
384  geomPropName, &e, r, travType));
385 
386  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
387 }
388 
389 std::auto_ptr<te::st::TimeSeriesDataSet>
392  te::common::TraverseType travType)
393 {
394  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
395  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
400 
401  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
402 
403  std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
404  info.getObservationDataSetInfo().getDataSetName(), &dt, r, travType));
405 
406  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
407 }
408 
409 std::auto_ptr<te::st::TimeSeriesDataSet>
411  const te::dt::DateTime& dt,
413  const te::gm::Envelope& e,
415  te::common::TraverseType travType)
416 {
417  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
418  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
423 
424  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
425 
426  std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
427  info.getObservationDataSetInfo().getDataSetName(), &e, sr, &dt, tr, travType));
428 
429  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
430 }
431 
432 std::auto_ptr<te::st::TimeSeriesDataSet>
436  te::common::TraverseType travType)
437 {
438  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
439  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
444 
445  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
446 
447  std::auto_ptr<te::da::DataSet> dset(inMemDataSource->getDataSet(
448  info.getObservationDataSetInfo().getDataSetName(), &geom, sr, &dt, tr, travType));
449 
450  return buildDataSet(static_cast<te::stmem::DataSet*>(dset.release()), info);
451 }
452 
453 std::auto_ptr<te::dt::DateTimePeriod>
455 {
456  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
457  if(!m_ds->dataSetExists(info.getDataSetName()))
458  loadDataSet(info.getDataSourceInfo(), info.getDataSetName(), info.getBeginTimePropName(),
459  info.getEndTimePropName(), info.getGeomPropName());
460 
461  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
462 
463  return inMemDataSource->getTemporalExtent(info.getDataSetName());
464 }
465 
466 std::auto_ptr<te::dt::DateTimePeriod>
468 {
469  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
470  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
475 
476  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
477 
478  return inMemDataSource->getTemporalExtent(info.getObservationDataSetInfo().getDataSetName());
479 }
480 
481 std::auto_ptr<te::dt::DateTimePeriod>
483 {
484  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
485  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
490 
491  te::stmem::DataSource* inMemDataSource = static_cast<te::stmem::DataSource*>(m_ds.get());
492 
493  return inMemDataSource->getTemporalExtent(info.getObservationDataSetInfo().getDataSetName());
494 }
495 
498 {
499  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
500  if(!m_ds->dataSetExists(info.getDataSetName()))
501  loadDataSet(info.getDataSourceInfo(), info.getDataSetName(), info.getBeginTimePropName(),
502  info.getEndTimePropName(), info.getGeomPropName());
503 
504  std::auto_ptr<te::gm::Envelope> res(m_ds->getExtent(info.getDataSetName(), info.getGeomPropName()));
505  return *res.get();
506 }
507 
510 {
511  //load the DataSet from its origin DataSource and put it into the In-Mem DataSource
512  if(!m_ds->dataSetExists(info.getObservationDataSetInfo().getDataSetName()))
517 
518  std::auto_ptr<te::gm::Envelope> res(m_ds->getExtent(info.getObservationDataSetInfo().getDataSetName(),
520  return *res.get();
521 }
522 
523 //protected
524 void te::st::STDataLoaderFromMemDS::loadDataSet(const te::da::DataSourceInfo& info, const std::string dsname,
525  const std::string& begTimePropName, const std::string& endTimePropName,
526  const std::string& gmPropName)
527 {
528  std::auto_ptr<te::da::DataSet> dset(te::da::GetDataSet(dsname, info.getId()));
529  if(!dset.get())
530  throw Exception("The DataSet was not loaded correctly!");
531 
532  std::auto_ptr<te::da::DataSetType> dsettype(te::da::GetDataSetType(dsname, info.getId()));
533  if(!dsettype.get())
534  throw Exception("The DataSetType was not loaded correctly!");
535 
536  //Get indexes
537  int begTimePropIdx = te::da::GetPropertyPos(dsettype.get(), begTimePropName);
538  int endTimePropIdx = te::da::GetPropertyPos(dsettype.get(), endTimePropName);
539  int gmPropIdx = te::da::GetPropertyPos(dsettype.get(), gmPropName);
540 
541  //Before creating a stmem DataSet, we need to put it in a right place to be copied.
542  dset->moveNext();
543  te::stmem::DataSet* inMemdset = new te::stmem::DataSet(dset.get(), begTimePropIdx, endTimePropIdx, gmPropIdx, 0);
544 
545  //Add them into the in-mem data source
546  te::stmem::DataSource* memDS = static_cast<te::stmem::DataSource*>(m_ds.get());
547  memDS->add(dsname, dsettype.release(), inMemdset);
548 }
549 
550 std::auto_ptr<te::st::ObservationDataSet>
552 {
553  //get type from info
554  ObservationDataSetType obsType = te::st::GetType(info);
555 
556  //get temporal and spatial extents
557  std::auto_ptr<te::dt::DateTimePeriod> period(ds->getTemporalExtent());
558  std::auto_ptr<te::gm::Geometry> geom;
559  if(info.hasGeomProp())
560  {
561  std::size_t idx = te::da::GetPropertyPos(ds, info.getGeomPropName());
562  std::auto_ptr<te::gm::Envelope> aux = ds->getExtent(idx);
563  geom.reset(te::gm::GetGeomFromEnvelope(aux.get(), -1));
564  }
565 
566  obsType.setSpatialExtent(geom.release());
567  obsType.setTemporalExtent(period.release());
568  return std::auto_ptr<ObservationDataSet> (new ObservationDataSet(ds, obsType));
569 }
570 
571 std::auto_ptr<te::st::TrajectoryDataSet>
573 {
574  //get type from info
575  const ObservationDataSetInfo& info = tjInfo.getObservationDataSetInfo();
576  ObservationDataSetType obsType = te::st::GetType(info);
577 
578  //get temporal and spatial extents
579  std::auto_ptr<te::dt::DateTimePeriod> period(ds->getTemporalExtent());
580  std::auto_ptr<te::gm::Geometry> geom;
581  if(info.hasGeomProp())
582  {
583  std::size_t idx = te::da::GetPropertyPos(ds, info.getGeomPropName());
584  std::auto_ptr<te::gm::Envelope> aux = ds->getExtent(idx);
585  geom.reset(te::gm::GetGeomFromEnvelope(aux.get(), -1));
586  }
587 
588  obsType.setSpatialExtent(geom.release());
589  obsType.setTemporalExtent(period.release());
590 
591  return std::auto_ptr<TrajectoryDataSet> (new TrajectoryDataSet(ds, obsType));
592 }
593 
594 std::auto_ptr<te::st::TimeSeriesDataSet>
596 {
597  //get type from info
598  const ObservationDataSetInfo& info = tsInfo.getObservationDataSetInfo();
599  ObservationDataSetType obsType = te::st::GetType(info);
600 
601  //get temporal extents
602  std::auto_ptr<te::dt::DateTimePeriod> period(ds->getTemporalExtent());
603  obsType.setTemporalExtent(period.release());
604 
605  return std::auto_ptr<TimeSeriesDataSet> ( new TimeSeriesDataSet(ds, obsType,
606  tsInfo.getValuePropNames()));
607 }
608 
610 {
611 }
612 
613 
614 
static const std::string sm_STMemoryDataSourceId
The global id of the st memory data source.
Definition: Globals.h:51
std::string getBeginTimePropName() const
It returns the name of the DataSet property that contains the phenomenon beginning time...
void loadDataSet(const te::da::DataSourceInfo &info, const std::string dsname, const std::string &begTimePropName, const std::string &endTimePropName, const std::string &gmPropName)
It loads DataSet from the original DataSource and put it in the In-Memory DataSource.
A class to represent a time series data set.
A class to represent a DataSet that contains observations.
A class that contains infos about a DataSet that contains observations.
This file contains a class responsible for loading spatiotemporal data from a ST in-memory DataSource...
std::auto_ptr< ObservationDataSet > getDataSet(const ObservationDataSetInfo &info, te::common::TraverseType travType=te::common::FORWARDONLY)
It returns a ObservationDataSet, that is, a DataSet that contains observations.
std::string getGeomPropName() const
It returns the name of the property that is a geometry property.
Implements a DataSource that contains In-Memory DataSets indexed by space and time.
Definition: DataSource.h:57
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
Definition: Enums.h:140
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
Definition: Utils.cpp:500
const ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the time series observations.
void add(const std::string &name, te::da::DataSetType *t, DataSet *d)
It adds a new DataSet and DataSetType into the DataSource.
Definition: DataSource.cpp:179
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:122
void getInfo(const TrajectoryDataSetInfo &input, std::vector< TrajectoryDataSetInfo > &output)
It returns the information about all trajectories that exist in a single DataSet. ...
std::auto_ptr< te::dt::DateTimePeriod > getTemporalExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with observations.
const ObservationDataSetInfo & getObservationDataSetInfo() const
It returns information about the DataSet that contains the trajectory observations.
std::auto_ptr< te::gm::Envelope > getExtent(std::size_t i)
It computes the bounding rectangle for a spatial property of the dataset.
Definition: DataSet.cpp:588
TESTEXPORT ObservationDataSetType GetType(const ObservationDataSetInfo &info)
An auxiliary function that transform ObservationDataSetInfo into ObservationDataSetType.
Definition: Utils.cpp:39
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:53
const std::vector< std::string > & getValuePropNames() const
It returns the names of the DataSet properties that contains the values associated to the time series...
std::auto_ptr< te::dt::DateTimePeriod > getTemporalExtent(const std::string &name)
It returns the temporal extent associated to a DataSet.
Definition: DataSource.cpp:210
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
TEDATAACCESSEXPORT DataSet * GetDataSet(const std::string &name, const std::string &datasourceId)
Definition: Utils.cpp:213
std::auto_ptr< ObservationDataSet > buildDataSet(te::stmem::DataSet *ds, const ObservationDataSetInfo &info)
It builds an ObservationDataSet from a given DataSet.
const te::da::DataSourceInfo & getDataSourceInfo() const
It returns the information about the DataSource.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
A class that contains infos about a DataSet that contains observations of one or more trajectories...
A class to represent a trajectory data set.
const std::string & getId() const
Implementation of a in-memory data set that contains spatiotemporal observations indexed by time and ...
Definition: DataSet.h:61
void setSpatialExtent(te::gm::Geometry *se)
It sets the spatial extent of all observations.
std::auto_ptr< te::dt::DateTimePeriod > getTemporalExtent() const
It returns the temporal extent of the observations.
Definition: DataSet.cpp:376
A class that contains infos about a DataSet that contains observations of one or more time series...
void setTemporalExtent(te::dt::DateTimePeriod *te)
It sets the temporal extent of all observations.
A class that contains complemental DataSetType information about a DataSet that holds observations...
A class that represents a data source component.
std::string getDataSetName() const
It returns the DataSet name.
TEDATAACCESSEXPORT DataSetType * GetDataSetType(const std::string &name, const std::string &datasourceId)
Definition: Utils.cpp:228
std::string getEndTimePropName() const
It returns the name of the DataSet property that contains the phenomenon end time.
te::gm::Envelope getSpatialExtent(const ObservationDataSetInfo &info)
It returns the temporal extent of the data set with observations of a coverage series.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
Definition: Utils.cpp:38