| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeTemporalSeries.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00027 #ifndef  __TERRALIB_INTERNAL_TS_H
    00028 #define  __TERRALIB_INTERNAL_TS_H
    00029
    00030
    00031 #include "TeTheme.h"
    00032 #include "TeTimeInterval.h"
    00033
    00034
    00035 /*
    00036            ATTR_DYN: a spatial object with a dynamic attribute
    00037            ATTR_DYN_GROUP: some spatial objects with a dynamic attribute table
    00038            EVENT: count of events
    00039            ATTR_EVENT: grouping the attributes of the events
    00040 */
    00042 enum TeTSType  { TeATTRDYN, TeATTRDYNGROUP, TeEVENT, TeATTREVENT};
    00043
    00044
    00046 enum TeTSDataType  { TeDATA, TeMISSING, TeDMISSING, TeOUTLIER, TeDOUTLIER, TePREDICTION };
    00047
    00048
    00050 class TL_DLL TeTSEntry
    00051 {
    00052 public:
    00053            int                                                    timeFrame_;  //the time frame of the temporal series
    00054            double                                      value_;
    00055            TeTSDataType                     type_;
    00056            int                                         nItens_; //number of instances
    00057            TeTimeInterval                   time_;
    00058            int                                                    timeInt_;
    00059
    00061            TeTSEntry():
    00062                       timeFrame_(-1),
    00063                       value_(0),
    00064                       type_(TeMISSING),
    00065                       nItens_(0),
    00066                       timeInt_(-1)
    00067                       {}
    00068
    00070            TeTSEntry(const double& val, TeTimeInterval& time, int timeFrame=-1, int nItens=0, TeTSDataType dType=TeMISSING);
    00071
    00072
    00074            TeTSEntry(const TeTSEntry& other)
    00075            {
    00076                       timeFrame_ = other.timeFrame_;
    00077                       value_ = other.value_;
    00078                       time_ = other.time_;
    00079                       nItens_ = other.nItens_;
    00080                       type_ = other.type_;
    00081                       timeInt_ = other.timeInt_;
    00082            }
    00083
    00085            TeTSEntry& operator=(const TeTSEntry& other);
    00086
    00087 };
    00088
    00090 class TL_DLL TeTSParams
    00091 {
    00092 public:
    00093            TeTSType                         type_;
    00094            TeChronon                        chronon_;
    00095            TeTimeInterval                   time_;
    00096            TeStatisticType                  timeOper_;
    00097            TeStatisticType                  spatOper_;
    00098
    00099            // Measures
    00100            TeTheme*              orTheme_;             //Pointer to the origin theme
    00101            string                           objectId_;
    00102            string                           attrTable_;               //temporal table
    00103            string                           attrColumn_;          //date column
    00104
    00105
    00107            TeTSParams():
    00108                       chronon_(TeNOCHRONON),
    00109                       timeOper_(TeNOSTATISTIC),
    00110                       spatOper_(TeNOSTATISTIC),
    00111                       orTheme_(0),
    00112                       objectId_(""),
    00113                       attrTable_(""),
    00114                       attrColumn_("")
    00115                       { }
    00116
    00118            TeTSParams(TeTheme* theme, TeChronon chr, const string& table, const string& col, TeStatisticType tOper, TeStatisticType sOper):
    00119                       chronon_(chr),
    00120                       timeOper_(tOper),
    00121                       spatOper_(sOper),
    00122                       orTheme_(theme),
    00123                       objectId_(""),
    00124                       attrTable_(table),
    00125                       attrColumn_(col)
    00126                       {}
    00127
    00129            TeTSParams(TeTheme* theme, const string& objId, TeChronon chr, const string& table, const string& col, TeStatisticType tOper, TeStatisticType sOper):
    00130                       chronon_(chr),
    00131                       timeOper_(tOper),
    00132                       spatOper_(sOper),
    00133                       orTheme_(theme),
    00134                       objectId_(objId),
    00135                       attrTable_(table),
    00136                       attrColumn_(col)
    00137                       {}
    00138
    00140            TeTSParams& operator=(const TeTSParams& other);
    00141 };
    00142
    00144 class TL_DLL TeTemporalSeries
    00145 {
    00146 public:
    00147            TeTSParams                       TSparams_;
    00148            vector<TeTSEntry>     series_;
    00149
    00151            TeTemporalSeries():
    00152                       TSparams_(TeTSParams())
    00153            {}
    00154
    00156            TeTemporalSeries(TeChronon chr, TeTheme* theme=0, const string& table="", const string& col="", TeStatisticType tOper=TeNOSTATISTIC, TeStatisticType sOper=TeNOSTATISTIC):
    00157                       TSparams_(TeTSParams(theme, chr, table, col, tOper, sOper))
    00158            {}
    00159
    00161            TeTemporalSeries(TeTheme* theme, const string& objId, TeChronon chr, const string& table, const string& col, TeStatisticType tOper, TeStatisticType sOper):
    00162                       TSparams_(TeTSParams(theme, objId, chr, table, col, tOper, sOper))
    00163            {}
    00164
    00166            bool getTSEntry(TeTSEntry& ts, unsigned int frame);
    00167
    00169            TeTemporalSeries& operator=(const TeTemporalSeries& other);
    00170
    00172            bool buildFrameIntervals();
    00173
    00175            int numTimeFrames() { return series_.size(); }
    00176
    00178            int timeInt(int frame) { return ((series_[frame-1]).timeInt_); }
    00179
    00181            bool setTSEntryValue(unsigned int frame, double val, TeTSDataType type);
    00182
    00184            TeTimeInterval time(int frame) { return ((series_[frame-1]).time_); }
    00185
    00186 };
    00187
    00188 #endif
    00189
    00190
    00191
    00192

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines