RasterToVector.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 RasterToVector.h
22 
23  \brief Raster to Vector processing.
24 
25  \ingroup attributefill
26  */
27 
28 #ifndef __TERRALIB_ATTRIBUTEFILL_INTERNAL_RASTER_TO_VECTOR_H
29 #define __TERRALIB_ATTRIBUTEFILL_INTERNAL_RASTER_TO_VECTOR_H
30 
31 //Terralib
32 
33 #include "../dataaccess/dataset/DataSet.h"
34 #include "../dataaccess/dataset/DataSetType.h"
35 #include "../dataaccess/dataset/ObjectIdSet.h"
36 #include "../dataaccess/datasource/DataSource.h"
37 
38 #include "../datatype/Property.h"
39 
40 #include "../memory/DataSet.h"
41 #include "../rp/Texture.h"
42 #include "../statistics/core/Enums.h"
43 
44 
45 #include "Config.h"
46 
47 // STL
48 #include <map>
49 #include <memory>
50 #include <string>
51 #include <vector>
52 
53 namespace te
54 {
55  namespace attributefill
56  {
58  {
59  public:
60 
62 
64 
65  void setInput(te::da::DataSourcePtr inRasterDsrc,
66  std::string inRasterName,
67  std::auto_ptr<te::da::DataSetType> inRasterDsType,
68  te::da::DataSourcePtr inVectorDsrc,
69  std::string inVectorName,
70  std::auto_ptr<te::da::DataSetType> inVectorDsType);
71 
72  void setParams(std::vector<unsigned int> bands,
73  std::vector<te::stat::StatisticalSummary> statSum,
74  bool texture);
75 
76  void setOutput(te::da::DataSourcePtr outDsrc, std::string dsName);
77 
78  bool paramsAreValid();
79 
80  bool run();
81 
82  protected:
83 
84  std::vector<std::set<int> > getPixelDistinct(te::rst::Raster* rst, std::vector<unsigned int> bands);
85 
86  std::auto_ptr<te::da::DataSetType> getDataSetType(std::vector<std::set<int> > pixelDistinct = std::vector<std::set<int> >());
87 
88  std::vector<te::rp::Texture> getTexture(te::rst::Raster* rst,
89  te::gm::Geometry* geom,
90  int bands);
91 
92  bool save(std::auto_ptr<te::mem::DataSet> result, std::auto_ptr<te::da::DataSetType> outDsType);
93 
95  std::string m_inRasterName;
96  std::auto_ptr<te::da::DataSetType> m_inRasterDsType;
98  std::string m_inVectorName;
99  std::auto_ptr<te::da::DataSetType> m_inVectorDsType;
100 
101  std::vector<te::stat::StatisticalSummary> m_statSum;
102  std::vector<unsigned int> m_bands;
103  bool m_texture;
104 
106  std::string m_outDset;
107  };
108  }
109 }
110 #endif // __TERRALIB_ATTRIBUTEFILL_INTERNAL_RASTER_TO_VECTOR_H
Configuration flags for the Attribute Fill module of TerraLib.
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
te::da::DataSourcePtr m_outDsrc
std::vector< te::stat::StatisticalSummary > m_statSum
#define TEATTRIBUTEFILLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
An abstract class for raster data strucutures.
Definition: Raster.h:71
std::auto_ptr< te::da::DataSetType > m_inRasterDsType
URI C++ Library.
te::da::DataSourcePtr m_inVectorDsrc
std::vector< unsigned int > m_bands
te::da::DataSourcePtr m_inRasterDsrc
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
std::auto_ptr< te::da::DataSetType > m_inVectorDsType