Loading...
Searching...
No Matches
SubdivideOperation.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/vp/SubdivideOperation.h
22
23 \brief This operation subdivides geometries ensuring that they don't have more than the given number of coordinates
24 */
25
26#ifndef __TERRALIB_VP_INTERNAL_SUBDIVIDEOPERATION_H
27#define __TERRALIB_VP_INTERNAL_SUBDIVIDEOPERATION_H
28
29 //Terralib include files
30#include "Config.h"
31
32#include "AbstractOperation.h"
33
34#include <memory>
35#include <mutex>
36#include <vector>
37
38namespace te
39{
40 namespace gm
41 {
42 class CellTilling;
43 }
44
45 namespace vp
46 {
47 class FeatureSet;
48
50 {
51 public:
52 SubdivideOperationParameters(std::size_t maxCoordinates = 0, te::gm::CellTilling* cellTilling = nullptr);
54
57
58 void setMaxCoordinates(std::size_t maxCoordinates);
59 std::size_t getMaxCoordinates() const;
60
61 private:
62 std::size_t m_maxCoordinates;
63 std::unique_ptr<te::gm::CellTilling> m_cellTilling;
64 };
65
67 {
68 public:
69
70 SubdivideOperationCapabilities(const std::string& operationName, std::size_t numberOfInputs, std::size_t numberOfOutputs, const std::string& dataHandlerName, bool snapGeometries, bool allowCoordinateSubdivision);
71
72 //!< Creates the parameters for this operation. If the concrete operation has specific parameters, it must override this class and instantiate the correct parameters
73 std::unique_ptr<AbstractParameters> createParameters() const override;
74 };
75
76 /*!
77 \class SubdivideOperation
78 \brief This operation subdivides geometries ensuring that they don't have more than the given number of coordinates
79 */
81 {
82 public:
83
84 /*!
85 * \brief Constructor
86 */
88
89 //!< Destructor
91
92 virtual std::unique_ptr<te::vp::AbstractOperationCapabilities> getCapabilities() const override;
93
94 std::vector<te::vp::FeatureSet> executeImpl(const std::vector<te::vp::FeatureSet>& vecInput) override;
95
96 te::da::DataSetType* createBasicOutputDataSetType(const std::string& dataSetName, int srid, te::gm::GeomType geometryType, const std::string& geometryColumnName) const override;
97
98 protected:
99
100 std::size_t safeCreateParentId();
101
102 protected:
103
104 std::size_t m_parentId;
105 std::mutex m_mutex;
106 };
107
109 {
110 public:
111
113
115
116 protected:
117
118 virtual te::vp::AbstractOperation* build() override;
119 };
120
121 }//end namespace vp
122}// end namespace te
123
124#endif // __TERRALIB_VP_INTERNAL_SUBDIVIDEOPERATION_H
Abstract Class to represent an abstract vector operation.
A class that models the description of a dataset.
Definition: DataSetType.h:73
Algorithm to help controlling creating and iterating in a tile.
Definition: CellTilling.h:49
Abstract class used to define the capabilities of the operation, inclusing number of inputs and outpu...
Abstract class used to define an operation.
Abstract class used to define the input/ ouptut parameters for TerraAmazon Operations.
Abstract factory used to create Operations.
std::unique_ptr< AbstractParameters > createParameters() const override
SubdivideOperationCapabilities(const std::string &operationName, std::size_t numberOfInputs, std::size_t numberOfOutputs, const std::string &dataHandlerName, bool snapGeometries, bool allowCoordinateSubdivision)
Creates the parameters for this operation. If the concrete operation has specific parameters,...
virtual te::vp::AbstractOperation * build() override
Concrete factories (derived from this one) must implement this method in order to create objects.
void setMaxCoordinates(std::size_t maxCoordinates)
SubdivideOperationParameters(std::size_t maxCoordinates=0, te::gm::CellTilling *cellTilling=nullptr)
std::size_t getMaxCoordinates() const
const te::gm::CellTilling * getCellTilling() const
void setCellTilling(te::gm::CellTilling *cellTilling)
std::unique_ptr< te::gm::CellTilling > m_cellTilling
This operation subdivides geometries ensuring that they don't have more than the given number of coor...
virtual std::unique_ptr< te::vp::AbstractOperationCapabilities > getCapabilities() const override
Makes all the necessaries adaptations to the input dataAccess to avoid duplicate column names.
std::size_t safeCreateParentId()
std::vector< te::vp::FeatureSet > executeImpl(const std::vector< te::vp::FeatureSet > &vecInput) override
te::da::DataSetType * createBasicOutputDataSetType(const std::string &dataSetName, int srid, te::gm::GeomType geometryType, const std::string &geometryColumnName) const override
< Creates the basic dataSetType for the output containing all the columns that are required
SubdivideOperation()
Constructor.
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).