Loading...
Searching...
No Matches
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/DataSetTypeConverter.h"
37#include "../dataaccess/dataset/ObjectIdSet.h"
38#include "../dataaccess/datasource/DataSource.h"
39
40#include "../datatype/Property.h"
41
42#include "../memory/DataSet.h"
43#include "../raster/Raster.h"
44#include "../rp/Texture.h"
45#include "../statistics/core/Enums.h"
46
47#include "Config.h"
48
49// STL
50#include <memory>
51#include <string>
52#include <vector>
53
54namespace 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 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 iteratorByBox, bool texture);
76
77 void setOutput(te::da::DataSourcePtr outDsrc, std::string dsName);
78
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::unique_ptr<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
95 void joinMaps(std::map<double, int>& mainMap, std::map<double, int>& newMap);
96
97 void joinMaps(std::map<double, double>& mainMap, std::map<double, double>& newMap);
98
99 void save(te::da::DataSet* result, te::da::DataSetType* outDsType);
100
103 std::string m_inVectorName;
104 std::unique_ptr<te::da::DataSetTypeConverter> m_inVectorDsType;
106
107 std::vector<te::stat::StatisticalSummary> m_statSum;
108 std::vector<unsigned int> m_bands;
111
113 std::string m_outDset;
114 };
115 }
116}
117#endif // __TERRALIB_ATTRIBUTEFILL_INTERNAL_RASTER_TO_VECTOR_H
void setParams(std::vector< unsigned int > bands, std::vector< te::stat::StatisticalSummary > statSum, bool iteratorByBox, bool texture)
std::vector< te::rp::Texture > getTexture(te::rst::Raster *rst, te::gm::Geometry *geom, int band)
std::vector< unsigned int > m_bands
std::unique_ptr< da::DataSetType > getDataSetType(std::vector< std::vector< double > > pixelDistinct=std::vector< std::vector< double > >())
te::da::DataSourcePtr m_outDsrc
std::unique_ptr< te::da::DataSetTypeConverter > m_inVectorDsType
std::vector< te::stat::StatisticalSummary > m_statSum
const te::da::ObjectIdSet * m_oidSet
te::da::DataSourcePtr m_inVectorDsrc
void joinMaps(std::map< double, double > &mainMap, std::map< double, double > &newMap)
void getPixelDistinct(rst::Raster &inputRaster, unsigned int inputRasterBand, std::vector< double > &values)
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsName)
void setInput(te::rst::Raster *inRaster, te::da::DataSourcePtr inVectorDsrc, std::string inVectorName, te::da::DataSetTypeConverter *inVectorDsType, const te::da::ObjectIdSet *oidSet=0)
void save(te::da::DataSet *result, te::da::DataSetType *outDsType)
void joinMaps(std::map< double, int > &mainMap, std::map< double, int > &newMap)
An converter for DataSetType.
A class that models the description of a dataset.
Definition: DataSetType.h:73
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:114
This class represents a set of unique ids created in the same context. i.e. from the same data set.
Definition: ObjectIdSet.h:56
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
An abstract class for raster data strucutures.
Definition: Raster.h:72
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
TerraLib.
#define TEATTRIBUTEFILLEXPORT
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).