STDataLoader.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 STDataLoader.h
22 
23  \brief This file contains a class that contains a set of static methods
24  to load spatiotemporal data from data sources.
25 */
26 
27 #ifndef __TERRALIB_ST_INTERNAL_STDATALOADER_H
28 #define __TERRALIB_ST_INTERNAL_STDATALOADER_H
29 
30 //TerraLib
31 #include "../../common/Enums.h"
32 #include "../../geometry/Enums.h"
33 #include "../../geometry/Envelope.h"
34 #include "../../datatype/Enums.h"
35 
36 //ST
37 #include "../Config.h"
38 #include "../core/coverage/CoverageSeriesDataSetInfo.h"
39 
40 //STL
41 #include <memory>
42 
43 //Boost
44 #include <boost/ptr_container/ptr_vector.hpp>
45 
46 // Forward declarations
47 namespace te { namespace gm { class Geometry; } }
48 namespace te { namespace dt { class DateTime; class DateTimePeriod; } }
49 
50 namespace te
51 {
52  namespace st
53  {
54  // Forward declarations
55  class ObservationDataSet;
56  class TrajectoryDataSet;
57  class TimeSeriesDataSet;
58  class ObservationDataSetInfo;
59  class TrajectoryDataSetInfo;
60  class TimeSeriesDataSetInfo;
61  class CoverageSeriesDataSetInfo;
62  class PointCoverageDataSetInfo;
63  class RasterCoverageDataSetInfo;
64  class Trajectory;
65  class TimeSeries;
66  class CoverageSeries;
67  class PointCoverage;
68  class AbstractPointCoverageInterp;
69  class RasterCoverage;
70 
71  /*!
72  \class STDataLoader
73 
74  \brief A class that contains a set of static methods to load spatiotemporal
75  data from data sources.
76 
77  \ingroup st
78 
79  \note Before using the methods of this class, certify that the Data Source exists in the DataSourceManager
80  \note The methods of this class can throw an Exception when internal errors occur.
81 
82  \sa ObservationDataSet ObservationDataSetInfo
83  \sa TrajectoryDataSet TrajectoryDataSetInfo
84  \sa CoverageSeriesDataSet CoverageSeriesDataSetInfo
85  */
87  {
88  public:
89 
90  /*! \name Operations for loading ObservationDataSet */
91  //@{
92 
93  /*!
94  \brief It returns a ObservationDataSet, that is, a DataSet that contains observations.
95 
96  \param info Information about the DataSource which the observation are from and
97  the DataSet which contains the observations.
98  \param travType The traverse type associated to the returned dataset.
99 
100  \return A pointer to a new ObservationDataSet.
101 
102  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
103  its "id" is correct in the info parameter
104  \note The caller will take the ownership of the returned pointer.
105  \note It can throw an Exception when internal errors occur.
106  */
107  static std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
109 
110  /*!
111  \brief It returns a data set with observations whose observed geometries satisfy a
112  given spatial relation.
113 
114  \param info Information about the DataSource which the observation are from and
115  the DataSet which contains the observations.
116  \param e A given envelope.
117  \param r A given spatial relation.
118  \param travType The traverse type associated to the returned dataset.
119 
120  \return A pointer to a new ObservationDataSet.
121 
122  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
123  its "id" is correct in the info parameter
124  \note The caller will take the ownership of the returned pointer.
125  \note It can throw an Exception when internal errors occur.
126  */
127  static std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info, const te::gm::Envelope& e,
130 
131  /*!
132  \brief It returns a data set with observations whose observed geometries satisfy a
133  given spatial relation.
134 
135  The possible spatial relations implemented here are: INTERSECTS
136 
137  \param info Information about the DataSource which the observation are from and
138  the DataSet which contains the observations.
139  \param geom A given geometry.
140  \param r A given spatial relation.
141  \param travType The traverse type associated to the returned dataset.
142 
143  \return A pointer to a new ObservationDataSet.
144 
145  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
146  its "id" is correct in the info parameter
147  \note The caller will take the ownership of the returned pointer.
148  \note It can throw an Exception when internal errors occur.
149  */
150  static std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info, const te::gm::Geometry& geom,
153 
154  /*!
155  \brief It returns a data set with observations whose phenomenon times satisfy a
156  given temporal relation.
157 
158  The possible temporal relations are:
159  1. BEFORE; 2. AFTER; 3. DURING; 4. EQUALS;
160  5. MEETS; 6. OVERLAPS 7 - STARTS; 8 -FINISHES;
161 
162  \param info Information about the DataSource which the observation are from and
163  the DataSet which contains the observations.
164  \param dt A given datetime.
165  \param r A given temporal relation.
166  \param travType The traverse type associated to the returned dataset.
167 
168  \return A pointer to a new ObservationDataSet.
169 
170  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
171  its "id" is correct in the info parameter
172  \note The caller will take the ownership of the returned pointer.
173  \note When the temporal relation is DURING, dt must be a time period.
174  \note It can throw an Exception when internal errors occur.
175  */
176  static std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
179 
180  /*!
181  \brief It returns a data set with observations whose observed geometries
182  satisfy a given spatial relation and phenomenon times satisfy a given temporal relation.
183 
184  The possible temporal relations are:
185  1. BEFORE; 2. AFTER; 3. DURING; 4. EQUALS;
186  5. MEETS; 6. OVERLAPS 7 - STARTS; 8 -FINISHES;
187 
188  \param info Information about the DataSource which the observation of trajectpries
189  are from and the DataSet which contains the observations.
190  \param dt A given datetime.
191  \param tr A given temporal relation.
192  \param e A given envelope.
193  \param sr A given spatial relation.
194  \param travType The traverse type associated to the returned dataset.
195 
196  \return A pointer to a new ObservationDataSet.
197 
198  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
199  its "id" is correct in the info parameter
200  \note The caller will take the ownership of the returned pointer.
201  \note When the temporal relation is DURING, dt must be a time period.
202  \note It can throw an Exception when internal errors occur.
203  */
204 
205  static std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
206  const te::dt::DateTime& dt,
208  const te::gm::Envelope& e,
211 
212  /*!
213  \brief It returns a data set with observations whose observed geometries satisfy a
214  given spatial relation and phenomenon times satisfy a given temporal relation.
215 
216  The possible spatial relations are: INTERSECTS
217  The possible temporal relations are:
218  1. BEFORE; 2. AFTER; 3. DURING; 4. EQUALS;
219  5. MEETS; 6. OVERLAPS 7 - STARTS; 8 -FINISHES;
220 
221  \param info Information about the DataSource which the observation are from and
222  the DataSet which contains the observations.
223  \param geom A given geometry.
224  \param sr A given spatial relation.
225  \param dt A given datetime.
226  \param tr A given temporal relation.
227  \param travType The traverse type associated to the returned dataset.
228 
229  \return A pointer to a new ObservationDataSet.
230 
231  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
232  its "id" is correct in the info parameter
233  \note The caller will take the ownership of the returned pointer.
234  \note It will NOT take the ownership of the given pointers.
235  \note When the temporal relation is DURING, dt must be a time period.
236  \note It can throw an Exception when internal errors occur.
237  */
238  static std::auto_ptr<ObservationDataSet> getDataSet(const ObservationDataSetInfo& info,
242  //@}
243 
244  /*! \name Operations for loading TrajectoryDataSet */
245  //@{
246 
247  /*!
248  \brief It returns the information about all trajectories that exist in a single DataSet.
249 
250  The information about the DataSource and DataSet that contains trajectories is defined
251  as a TrajectoryDataSetInfo (input parameter).
252 
253  The information about each trajectory (its correct id) is returned as a
254  TrajectoryDataSetInfo of the parameter output.
255  These results can be used to create TrajectoryDataSetLayers.
256 
257  \param input The information about the DataSource and DataSet that contains trajectories
258  \param output The information about each trajectory (its correct id).
259 
260  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
261  its "id" is correct in the info parameter
262  \note It can throw an Exception when internal errors occur.
263  */
264  static void getInfo( const TrajectoryDataSetInfo& input,
265  std::vector<TrajectoryDataSetInfo>& output);
266 
267  /*!
268  \brief It returns a data set with observations of trajectories.
269 
270  When the DataSet contains more than one trajectory, the info parameter
271  (TrajectoryDataSetInfo) must contain the id of the desire trajectory that
272  must be returned as a TrajectoryDataSet.
273 
274  \param info Information about the DataSource which the observations of a trajectory
275  are from and the DataSet which contains these observations.
276  \param travType The traverse type associated to the returned datasets.
277  \param rwRole The read and write permission associated to the returned datasets.
278  \return The returned TrajectoryDataSet.
279 
280  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
281  its "id" is correct in the info parameter
282  \note The caller will take the ownership of the returned pointer.
283  \note It can throw an Exception when internal errors occur.
284  */
285  static std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
287 
288  /*!
289  \brief It returns patches of a trajectory whose geometries
290  satisfy a given spatial relation.
291 
292  When the DataSet contains more than one trajectory, the info parameter
293  (TrajectoryDataSetInfo) must contain the id of the desire trajectory that
294  must be returned as a TrajectoryDataSet.
295 
296  The possible spatial relations implemented here are: INTERSECTS
297 
298  \param info Information about the DataSource which the observations of a trajectory
299  are from and the DataSet which contains these observations.
300  \param geom A given geometry.
301  \param r A given spatial relation.
302  \param travType The traverse type associated to the returned dataset.
303 
304  \return The returned trajectoy data set.
305 
306  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
307  its "id" is correct in the info parameter
308  \note The caller will take the ownership of the returned pointer.
309  \note It can throw an Exception when internal errors occur.
310  */
311  static std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
314 
315  /*!
316  \brief It returns patches of a trajectory whose geometries
317  satisfy a given spatial relation.
318 
319  When the DataSet contains more than one trajectory, the info parameter
320  (TrajectoryDataSetInfo) must contain the id of the desire trajectory that
321  must be returned as a TrajectoryDataSet.
322 
323  \param info Information about the DataSource which the observations of a trajectory are from
324  and the DataSet which contains the observations.
325  \param e A given envelope.
326  \param r A given spatial relation.
327  \param travType The traverse type associated to the returned dataset.
328 
329  \return The returned trajectoy data set.
330 
331  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
332  its "id" is correct in the info parameter
333  \note The caller will take the ownership of the returned pointer.
334  \note It can throw an Exception when internal errors occur.
335  */
336  static std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
339 
340  /*!
341  \brief It returns a data set with observations of trajectories whose times
342  satisfy a given temporal relation.
343 
344  When the DataSet contains more than one trajectory, the info parameter
345  (TrajectoryDataSetInfo) must contain the id of the desire trajectory that
346  must be returned as a TrajectoryDataSet.
347 
348  The possible temporal relations are:
349  1. BEFORE; 2. AFTER; 3. DURING; 4. EQUALS;
350  5. MEETS; 6. OVERLAPS 7 - STARTS; 8 -FINISHES;
351 
352  \param info Information about the DataSource which the observation of trajectpries
353  are from and the DataSet which contains the observations.
354  \param dt A given datetime.
355  \param r A given temporal relation.
356  \param travType The traverse type associated to the returned dataset.
357 
358  \return A pointer to a new TrajectoryDataSet.
359 
360  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
361  its "id" is correct in the info parameter
362  \note The caller will take the ownership of the returned pointer.
363  \note When the temporal relation is DURING, dt must be a time period.
364  \note It can throw an Exception when internal errors occur.
365  */
366  static std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
369 
370  /*!
371  \brief It returns patches of a trajectory whose envelope
372  satisfy a given spatial relation and times satisfy a given temporal relation.
373 
374  When the DataSet contains more than one trajectory, the info parameter
375  (TrajectoryDataSetInfo) must contain the id of the desire trajectory that
376  must be returned as a TrajectoryDataSet.
377 
378  The possible temporal relations are:
379  1. BEFORE; 2. AFTER; 3. DURING; 4. EQUALS;
380  5. MEETS; 6. OVERLAPS 7 - STARTS; 8 -FINISHES;
381 
382  \param info Information about the DataSource which the observation of trajectpries
383  are from and the DataSet which contains the observations.
384  \param dt A given datetime.
385  \param tr A given temporal relation.
386  \param e A given envelope.
387  \param sr A given spatial relation.
388  \param travType The traverse type associated to the returned dataset.
389 
390  \return A pointer to a new TrajectoryDataSet.
391 
392  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
393  its "id" is correct in the info parameter
394  \note The caller will take the ownership of the returned pointer.
395  \note When the temporal relation is DURING, dt must be a time period.
396  \note It can throw an Exception when internal errors occur.
397  */
398  static std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
399  const te::dt::DateTime& dt,
401  const te::gm::Envelope& e,
404 
405  /*!
406  \brief It returns patches of a trajectory whose geometries
407  satisfy a given spatial relation and times satisfy a given temporal relation.
408 
409  When the DataSet contains more than one trajectory, the info parameter
410  (TrajectoryDataSetInfo) must contain the id of the desire trajectory that
411  must be returned as a TrajectoryDataSet.
412 
413  The possible spatial relations are: INTERSECTS
414  The possible temporal relations are:
415  1. BEFORE; 2. AFTER; 3. DURING; 4. EQUALS;
416  5. MEETS; 6. OVERLAPS 7 - STARTS; 8 -FINISHES;
417 
418  \param info Information about the DataSource which the observations of trajectories
419  are from and the DataSet which contains these observations.
420  \param geom A given geometry.
421  \param sr A given spatial relation.
422  \param dt A given datetime.
423  \param tr A given temporal relation.
424  \param travType The traverse type associated to the returned dataset.
425 
426  \return The returned trajectoy data set.
427 
428  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
429  its "id" is correct in the info parameter
430  \note The caller will take the ownership of the returned pointer.
431  \note It will NOT take the ownership of the given pointers.
432  \note When the temporal relation is DURING, dt must be a time period.
433  \note It can throw an Exception when internal errors occur.
434  */
435  static std::auto_ptr<TrajectoryDataSet> getDataSet(const TrajectoryDataSetInfo& info,
439  //@}
440 
441  /*! \name Operations for loading TimeSeriesDataSet */
442  //@{
443 
444  /*!
445  \brief It returns the information about all time series that exist in a single DataSet.
446 
447  The information about the DataSource and DataSet that contains time series is defined
448  as a TimeSeriesDataSetInfo (input parameter).
449 
450  The information about each time series (its correct id) is returned as a
451  TimeSeriesDataSetInfo of the parameter output.
452  These results can be used to create TimeSeriesDataSetLayers.
453 
454  \param input The information about the DataSource and DataSet that contains time series
455  \param output The information about each time series (its correct id).
456 
457  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
458  its "id" is correct in the info parameter
459  \note It can throw an Exception when internal errors occur.
460  */
461  static void getInfo( const TimeSeriesDataSetInfo& input,
462  std::vector<TimeSeriesDataSetInfo>& output);
463 
464  /*!
465  \brief It returns a data set with observations of time series.
466 
467  When the DataSet contains more than one time series, the info parameter
468  (TimeSeriesDataSetInfo) must contain the id of the desire time series that
469  must be returned as a TimeSeriesDataSet.
470 
471  \param info Information about the DataSource which the observations of a time series
472  are from and the DataSet which contains these observations.
473  \param travType The traverse type associated to the returned datasets.
474 
475  \return The returned TimeSeriesDataSet.
476 
477  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
478  its "id" is correct in the info parameter
479  \note The caller will take the ownership of the returned pointer.
480  \note It can throw an Exception when internal errors occur.
481  */
482  static std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
484 
485  /*!
486  \brief It returns a data set with observations of time series whose times
487  satisfy a given temporal relation.
488 
489  When the DataSet contains more than one time series, the info parameter
490  (TimeSeriesDataSetInfo) must contain the id of the desire time series that
491  must be returned as a TimeSeriesDataSet.
492 
493  The possible temporal relations are:
494  1. BEFORE; 2. AFTER; 3. DURING; 4. EQUALS;
495  5. MEETS; 6. OVERLAPS 7 - STARTS; 8 -FINISHES;
496 
497  \param info Information about the DataSource which the observation of time series
498  are from and the DataSet which contains the observations.
499  \param dt A given datetime.
500  \param r A given temporal relation.
501  \param travType The traverse type associated to the returned dataset.
502 
503  \return A pointer to a new TimeSeriesDataSet.
504 
505  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
506  its "id" is correct in the info parameter
507  \note The caller will take the ownership of the returned pointer.
508  \note When the temporal relation is DURING, dt must be a time period.
509  \note It can throw an Exception when internal errors occur.
510  */
511  static std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
514 
515  /*!
516  \brief It returns patches of a timeseries whose geometries
517  satisfy a given spatial relation.
518 
519  When the DataSet contains more than one trajectory, the info parameter
520  (TrajectoryDataSetInfo) must contain the id of the desire trajectory that
521  must be returned as a TrajectoryDataSet.
522 
523  \param info Information about the DataSource which the observations of a trajectory are from
524  and the DataSet which contains the observations.
525  \param e A given envelope.
526  \param r A given spatial relation.
527  \param travType The traverse type associated to the returned dataset.
528 
529  \return The returned trajectoy data set.
530 
531  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
532  its "id" is correct in the info parameter
533  \note The caller will take the ownership of the returned pointer.
534  \note It can throw an Exception when internal errors occur.
535  */
536  static std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info, const te::gm::Envelope& e,
539 
540  /*!
541  \brief It returns data set with observations of time series whose geometries
542  satisfy a given spatial relation.
543 
544  \param info Information about the DataSource which the observations of a time series are from
545  and the DataSet which contains the observations.
546  \param geom A given geometry.
547  \param r A given spatial relation.
548  \param travType The traverse type associated to the returned dataset.
549 
550  \return The returned time series data set.
551 
552  \note The caller will take the ownership of the returned pointer.
553  \note It can throw an Exception when internal errors occur.
554  */
555  static std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info, const te::gm::Geometry& geom,
558 
559  /*!
560  \brief It returns data set with observations of time series whose geometries
561  satisfy a given spatial relation and times satisfy a given temporal relation
562 
563  \param info Information about the DataSource which the observations of a time series are from
564  and the DataSet which contains the observations.
565  \param dt A given datetime.
566  \param tr A given temporal relation.
567  \param e A given envelope.
568  \param sr A given spatial relation.
569  \param travType The traverse type associated to the returned dataset.
570 
571  \return The returned time series data set.
572 
573  \note The caller will take the ownership of the returned pointer.
574  \note It can throw an Exception when internal errors occur.
575  */
576  static std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
577  const te::dt::DateTime& dt,
579  const te::gm::Envelope& e,
582 
583  /*!
584  \brief It returns data set with observations of time series whose geometries
585  satisfy a given spatial relation and times satisfy a given temporal relation.
586 
587  \param info Information about the DataSource which the observations of a time series are from
588  and the DataSet which contains the observations.
589  \param e A given envelope.
590  \param r A given spatial relation.
591  \param travType The traverse type associated to the returned dataset.
592 
593  \return The returned time series data set.
594 
595  \note The caller will take the ownership of the returned pointer.
596  \note It can throw an Exception when internal errors occur.
597  */
598  static std::auto_ptr<TimeSeriesDataSet> getDataSet(const TimeSeriesDataSetInfo& info,
602 
603  //@}
604 
605  /*! \name Operations for loading spatiotemporal data types
606  (TimeSeries, Trajetory, CoverageSeries) directly from data sources, without using
607  DataSets. */
608  //@{
609 
610  /*!
611  \brief It returns a point coverage series.
612 
613  \param info Information about the DataSource which the observations of a coverage series
614  are from and the data sets which contain these observations.
615  \param interp The interpolator associated to each
616 
617  \return The returned CoverageSeries.
618 
619  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
620  its "id" is correct in the info parameter
621  \note The caller will take the ownership of the returned pointer.
622  \note It can throw an Exception when internal errors occur.
623  */
624  static std::auto_ptr<CoverageSeries> getCoverageSeries( const PointCoverageSeriesDataSetInfo& info,
625  AbstractPointCoverageInterp* interp);
626 
627  /*!
628  \brief It returns a raster coverage series.
629 
630  \param info Information about the DataSource which the observations of a coverage series
631  are from and the data sets which contain these observations.
632 
633  \return The returned CoverageSeries.
634 
635  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
636  its "id" is correct in the info parameter
637  \note The caller will take the ownership of the returned pointer.
638  \note It can throw an Exception when internal errors occur.
639  */
640  static std::auto_ptr<CoverageSeries> getCoverageSeries(const RasterCoverageSeriesDataSetInfo& info);
641 
642  /*!
643  \brief It returns a raster coverage.
644 
645  \param info Information about the DataSource which the observations of a raster coverage
646  are from and the data sets which contain these observations.
647 
648  \return The returned RasterCoverage.
649 
650  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
651  its "id" is correct in the info parameter
652  \note The caller will take the ownership of the returned pointer.
653  \note It can throw an Exception when internal errors occur.
654  */
655  static std::auto_ptr<RasterCoverage> getCoverage(const RasterCoverageDataSetInfo& info);
656 
657  /*!
658  \brief It returns a point coverage.
659 
660  \param info Information about the DataSource which the observations of a point coverage
661  are from and the data sets which contain these observations.
662  \param interp The interpolator associated to the point coverage
663 
664  \return The returned PointCoverage.
665 
666  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
667  its "id" is correct in the info parameter
668  \note The caller will take the ownership of the returned pointer.
669  \note It will take the ownership of the given pointers.
670  \note It can throw an Exception when internal errors occur.
671  */
672  static std::auto_ptr<PointCoverage> getCoverage(const PointCoverageDataSetInfo& info,
674 
675  /*!
676  \brief It returns a time series associated to a point of a coverage series.
677 
678  If info contains information about raster coverages and its associated data source
679  supports raster data type, this function is executed by the data source.
680  Otherwise, it is executed in two steps: (1) creating a CoverageSeries type
681  and (2) using its method getTimeSeries.
682 
683  \param info Information about the DataSource which the observations of a coverage series
684  are from and the data sets which contain these observations.
685  \param p A given point.
686 
687  \return The returned CoverageSeries.
688 
689  \note The caller will take the ownership of the returned pointer.
690  \note It can throw an Exception when internal errors occur.
691 
692  \\TO DO: (1) vantagem de usar o DataSetCoverageDataSet é ele fica armazenado no driver
693  \\em memória (stmem) ao invés de toda hora gerar o CoverageSeries para cada ponto
694  \\que queremos extrair a time series.
695  */
696  //static std::auto_ptr<CoverageSeries> getTimeSeries(const CoverageSeriesDataSetInfo& info,
697  // const te::gm::Point& p);
698  //@}
699 
700  /*! \name Operations for loading temporal and spatial extent */
701  //@{
702 
703  /*!
704  \brief It returns the temporal extent of the data set with observations.
705 
706  \return The temporal extent of the observations.
707 
708  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
709  its "id" is correct in the info parameter
710  \note The caller will take the ownership of the returned pointer.
711  \note It will NOT take the ownership of the given pointer "info".
712  \note It can throw an Exception when internal errors occur.
713  */
714  static std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const ObservationDataSetInfo& info);
715 
716  /*!
717  \brief It returns the temporal extent of the data set with observations of a trajectory.
718 
719  \return The temporal extent of the observations of a trajectory.
720 
721  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
722  its "id" is correct in the info parameter
723  \note The caller will take the ownership of the returned pointer.
724  \note It will NOT take the ownership of the given pointer "info".
725  \note It can throw an Exception when internal errors occur.
726  */
727  static std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TrajectoryDataSetInfo& info);
728 
729  /*!
730  \brief It returns the temporal extent of the data set with observations of a time series.
731 
732  \return The temporal extent of the observations of a time series.
733 
734  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
735  its "id" is correct in the info parameter
736  \note The caller will take the ownership of the returned pointer.
737  \note It will NOT take the ownership of the given pointer "info".
738  \note It can throw an Exception when internal errors occur.
739  */
740  static std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const TimeSeriesDataSetInfo& info);
741 
742  /*!
743  \brief It returns the temporal extent of the data set with observations of a coverage series.
744 
745  \return The temporal extent of the observations of a coverage series.
746 
747  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
748  its "id" is correct in the info parameter
749  \note The caller will take the ownership of the returned pointer.
750  \note It will NOT take the ownership of the given pointer "info".
751  \note It can throw an Exception when internal errors occur.
752  */
753  //static std::auto_ptr<te::dt::DateTimePeriod> getTemporalExtent(const CoverageSeriesDataSetInfo& info);
754 
755  /*!
756  \brief It returns the spatial extent of the observations, when there is an observed value of geometry type.
757 
758  \return The spatial extent of the observations.
759 
760  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
761  its "id" is correct in the info parameter
762  \note The caller will take the ownership of the returned pointer.
763  \note It can throw an Exception when internal errors occur.
764  */
765  static te::gm::Envelope getSpatialExtent(const ObservationDataSetInfo& info);
766 
767  /*!
768  \brief It returns the spatial extent of the observations of a trajectory.
769 
770  \return The spatial extent of the observations of a trajectory.
771 
772  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
773  its "id" is correct in the info parameter
774  \note The caller will take the ownership of the returned pointer.
775  \note It can throw an Exception when internal errors occur.
776  */
777  static te::gm::Envelope getSpatialExtent(const TrajectoryDataSetInfo& info);
778 
779  /*!
780  \brief It returns the spatial extent of the observations of a coverage series.
781 
782  \return The spatial extent of the observations of a coverage series.
783 
784  \note Before using this method, certify that the Data Source exists in the DataSourceManager and
785  its "id" is correct in the info parameter
786  \note The caller will take the ownership of the returned pointer.
787  \note It can throw an Exception when internal errors occur.
788  */
789  //static te::gm::Envelope getSpatialExtent(const CoverageSeriesDataSetInfo& info);
790  //@}
791 
792  /*!
793  \brief It initialize the STDataLoader
794 
795  It creates a ST Memory data source and adds it into the DataSourceManager.
796 
797  \note The user must use this method before using the other methods.
798  \note It can throw an Exception when internal errors occur.
799  */
800  static void initialize();
801 
802  /*!
803  \brief It finalize the STDataLoader
804 
805  It closes (cleans its iternal DataSets) ST Memory data source in the DataSourceManager.
806 
807  \note The user must use this method after using the STDataLoader.
808  \note It can throw an Exception when internal errors occur.
809  */
810  static void finalize();
811 
812  /*! \brief Virtual destructor. */
813  virtual ~STDataLoader();
814 
815  public:
816  static bool sm_STDataLoaderInitialized; //!< Indictes if the st data loader support was initialized
817 
818  protected:
819 
820  /*! \brief Protected constructor */
821  STDataLoader();
822  };
823 
824  } // end namespace st
825 } // end namespace te
826 
827 #endif // __TERRALIB_ST_INTERNAL_STDATALOADER_H
828 
829 
830 
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:88
A class that contains infos about a DataSet that contains observations.
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
Definition: Enums.h:140
An abstract class for interpolation function or interpolator that estimate values at non-observaved l...
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:127
std::vector< RasterCoverageDataSetInfo > RasterCoverageSeriesDataSetInfo
A class that contains infos about a DataSource and DataSet that contains observations of a point cove...
std::vector< PointCoverageDataSetInfo > PointCoverageSeriesDataSetInfo
A class that contains a set of static methods to load spatiotemporal data from data sources...
Definition: STDataLoader.h:86
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:53
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
A class that contains infos about a DataSet that contains observations of one or more trajectories...
A class that contains infos about a DataSet that contains observations of one or more time series...
static bool sm_STDataLoaderInitialized
Indictes if the st data loader support was initialized.
Definition: STDataLoader.h:816
A class that contains infos about a DataSource and DataSet that contains observations of a raster cov...