Loading...
Searching...
No Matches
IntersectionOp.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 IntersectionOp.h
22
23 \brief Intersection operation.
24
25 \ingroup vp
26 */
27
28#ifndef __TERRALIB_VP_INTERNAL_INTERSECTION_OP_H
29#define __TERRALIB_VP_INTERNAL_INTERSECTION_OP_H
30
31//Terralib
32
33#include "../dataaccess/dataset/DataSet.h"
34#include "../dataaccess/dataset/DataSetTypeConverter.h"
35#include "../dataaccess/datasource/DataSource.h"
36
37#include "../datatype/Property.h"
38
39#include "../geometry/Enums.h"
40#include "../memory/DataSet.h"
41
42#include "IntersectionOp.h"
43#include "Config.h"
44
45// STL
46#include <map>
47#include <memory>
48#include <string>
49#include <vector>
50
51namespace te
52{
53 namespace vp
54 {
56 {
57 public:
58
60
61 virtual ~IntersectionOp() {}
62
63 virtual bool run() = 0;
64
65 virtual bool paramsAreValid();
66
68 std::string inFirstDsetName,
69 std::unique_ptr<te::da::DataSetTypeConverter> firstConverter,
70 te::da::DataSourcePtr inSecondDsrc,
71 std::string inSecondDsetName,
72 std::unique_ptr<te::da::DataSetTypeConverter> secondConverter,
73 const te::da::ObjectIdSet* firstOidSet = 0,
74 const te::da::ObjectIdSet* secondOidSet = 0);
75
77 std::string inFirstDsetName,
78 std::unique_ptr<te::da::DataSetType> firstDsType,
79 std::unique_ptr<te::da::DataSet> firstDs,
80 std::unique_ptr<te::da::DataSetTypeConverter> firstConverter,
81 te::da::DataSourcePtr inSecondDsrc,
82 std::string inSecondDsetName,
83 std::unique_ptr<te::da::DataSetType> secondDsType,
84 std::unique_ptr<te::da::DataSet> secondDs,
85 std::unique_ptr<te::da::DataSetTypeConverter> secondConverter,
86 const te::da::ObjectIdSet* firstOidSet = 0,
87 const te::da::ObjectIdSet* secondOidSet = 0);
88
89 void setParams(const std::vector<std::pair<int, std::string> > &attributeVec);
90
91 void setOutput(te::da::DataSourcePtr outDsrc, std::string dsname);
92
94
96
98
99 protected:
100
101 std::vector<te::dt::Property*> getTabularProps(te::da::DataSetType* dsType);
102
103 // it defines the type of the result considering the input geometries.
105
106 bool isSelectedProperty(const int &id, const dt::Property &prop);
107
108 protected:
110 std::string m_inFirstDsetName;
111 std::unique_ptr<te::da::DataSetTypeConverter> m_firstConverter;
114 std::unique_ptr<te::da::DataSetTypeConverter> m_secondConverter;
117
118 std::unique_ptr<te::da::DataSetType> m_firstDsType;
119 std::unique_ptr<te::da::DataSet> m_firstDs;
120 std::unique_ptr<te::da::DataSetType> m_secondDsType;
121 std::unique_ptr<te::da::DataSet> m_secondDs;
122
125
126 std::vector<std::pair<int, std::string> > m_attributeVec;
127
129 std::string m_outDsetName;
130 };
131 }
132}
133#endif // __TERRALIB_VP_INTERNAL_INTERSECTION_OP_H
Intersection operation.
A class that models the description of a dataset.
Definition: DataSetType.h:73
This class represents a set of unique ids created in the same context. i.e. from the same data set.
Definition: ObjectIdSet.h:56
It models a property definition.
Definition: Property.h:60
std::unique_ptr< te::da::DataSetType > m_secondDsType
te::gm::GeomType setGeomResultType(te::gm::GeomType firstGeom, te::gm::GeomType secondGeom)
te::da::DataSourcePtr m_inFirstDsrc
std::string m_inFirstDsetName
void setInput(te::da::DataSourcePtr inFirstDsrc, std::string inFirstDsetName, std::unique_ptr< te::da::DataSetTypeConverter > firstConverter, te::da::DataSourcePtr inSecondDsrc, std::string inSecondDsetName, std::unique_ptr< te::da::DataSetTypeConverter > secondConverter, const te::da::ObjectIdSet *firstOidSet=0, const te::da::ObjectIdSet *secondOidSet=0)
std::vector< te::dt::Property * > getTabularProps(te::da::DataSetType *dsType)
void setParams(const std::vector< std::pair< int, std::string > > &attributeVec)
std::unique_ptr< te::da::DataSetTypeConverter > m_firstConverter
std::unique_ptr< te::da::DataSetTypeConverter > m_secondConverter
bool isSelectedProperty(const int &id, const dt::Property &prop)
std::string m_inSecondDsetName
virtual bool run()=0
std::unique_ptr< te::da::DataSet > m_firstDs
te::da::DataSetType * getOutputDsType()
std::unique_ptr< te::da::DataSetType > m_firstDsType
const te::da::ObjectIdSet * m_firstOidSet
void setInput(te::da::DataSourcePtr inFirstDsrc, std::string inFirstDsetName, std::unique_ptr< te::da::DataSetType > firstDsType, std::unique_ptr< te::da::DataSet > firstDs, std::unique_ptr< te::da::DataSetTypeConverter > firstConverter, te::da::DataSourcePtr inSecondDsrc, std::string inSecondDsetName, std::unique_ptr< te::da::DataSetType > secondDsType, std::unique_ptr< te::da::DataSet > secondDs, std::unique_ptr< te::da::DataSetTypeConverter > secondConverter, const te::da::ObjectIdSet *firstOidSet=0, const te::da::ObjectIdSet *secondOidSet=0)
const te::da::ObjectIdSet * m_secondOidSet
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsname)
virtual bool paramsAreValid()
te::da::DataSourcePtr m_inSecondDsrc
std::unique_ptr< te::da::DataSet > m_secondDs
te::da::DataSourcePtr m_outDsrc
std::vector< std::pair< int, std::string > > m_attributeVec
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:42
TerraLib.
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
Proxy configuration file for TerraView (see terraview_config.h).