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
4  applications.
5 
6  TerraLib is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License,
9  or (at your option) any later version.
10 
11  TerraLib is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with TerraLib. See COPYING. If not, write to
18  TerraLib Team at <terralib-team@terralib.org>.
19  */
20 
21 /*!
22  \file RasterToVector.h
23 
24  \brief Raster to Vector processing.
25 
26  \ingroup attributefill
27  */
28 
29 #ifndef __TERRALIB_ATTRIBUTEFILL_INTERNAL_RASTER_TO_VECTOR_H
30 #define __TERRALIB_ATTRIBUTEFILL_INTERNAL_RASTER_TO_VECTOR_H
31 
32 // Terralib
33 
34 #include "../dataaccess/dataset/DataSet.h"
35 #include "../dataaccess/dataset/DataSetType.h"
36 #include "../dataaccess/dataset/ObjectIdSet.h"
37 #include "../dataaccess/datasource/DataSource.h"
38 
39 #include "../datatype/Property.h"
40 
41 #include "../memory/DataSet.h"
42 #include "../raster/Raster.h"
43 #include "../rp/Texture.h"
44 #include "../statistics/core/Enums.h"
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:
62 
64  {
65  }
66 
67  void setInput(te::rst::Raster* inRaster,
68  te::da::DataSourcePtr inVectorDsrc,
69  std::string inVectorName,
70  std::auto_ptr<te::da::DataSetTypeConverter> inVectorDsType,
71  const te::da::ObjectIdSet* oidSet = 0);
72 
73  void setParams(std::vector<unsigned int> bands,
74  std::vector<te::stat::StatisticalSummary> statSum,
75  bool texture, bool readAll);
76 
77  void setOutput(te::da::DataSourcePtr outDsrc, std::string dsName);
78 
79  bool paramsAreValid();
80 
81  bool run();
82 
83  protected:
84  void getPixelDistinct(rst::Raster& inputRaster,
85  unsigned int inputRasterBand,
86  std::vector<double>& values);
87 
88  std::auto_ptr<te::da::DataSetType> getDataSetType(
89  std::vector<std::vector<double> > pixelDistinct =
90  std::vector<std::vector<double> >());
91 
92  std::vector<te::rp::Texture> getTexture(te::rst::Raster* rst,
93  te::gm::Geometry* geom, int band,
94  bool readAll = false);
95 
96  bool save(std::auto_ptr<te::mem::DataSet> result,
97  std::auto_ptr<te::da::DataSetType> outDsType);
98 
101  std::string m_inVectorName;
102  std::auto_ptr<te::da::DataSetTypeConverter> m_inVectorDsType;
104 
105  std::vector<te::stat::StatisticalSummary> m_statSum;
106  std::vector<unsigned int> m_bands;
107  bool m_texture;
108  bool m_readAll;
109 
111  std::string m_outDset;
112  };
113  }
114 }
115 #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:1438
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:74