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 "../raster/Raster.h"
42 #include "../rp/Texture.h"
43 #include "../statistics/core/Enums.h"
44 
45 
46 #include "Config.h"
47 
48 // STL
49 #include <map>
50 #include <memory>
51 #include <string>
52 #include <vector>
53 
54 namespace te
55 {
56  namespace attributefill
57  {
59  {
60  public:
61 
63 
65 
66  void setInput(te::rst::Raster* inRaster,
67  te::da::DataSourcePtr inVectorDsrc,
68  std::string inVectorName,
69  std::auto_ptr<te::da::DataSetTypeConverter> inVectorDsType,
70  const te::da::ObjectIdSet* oidSet = 0);
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 
96  std::string m_inVectorName;
97  std::auto_ptr<te::da::DataSetTypeConverter> m_inVectorDsType;
99 
100  std::vector<te::stat::StatisticalSummary> m_statSum;
101  std::vector<unsigned int> m_bands;
102  bool m_texture;
103 
105  std::string m_outDset;
106  };
107  }
108 }
109 #endif // __TERRALIB_ATTRIBUTEFILL_INTERNAL_RASTER_TO_VECTOR_H
std::auto_ptr< te::da::DataSetTypeConverter > m_inVectorDsType
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
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
An abstract class for raster data strucutures.
Definition: Raster.h:71
const te::da::ObjectIdSet * m_oidSet
URI C++ Library.
te::da::DataSourcePtr m_inVectorDsrc
std::vector< unsigned int > m_bands
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73