AddressGeocodingOp.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 AddressGeocodingOp.h
22 
23  \brief Address Geocoding operation.
24 
25  \ingroup vp
26  */
27 
28 #ifndef __TERRALIB_ADDRESSGEOCODING_INTERNAL_ADDRESSGEOCODING_OP_H
29 #define __TERRALIB_ADDRESSGEOCODING_INTERNAL_ADDRESSGEOCODING_OP_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 "../statistics/core/Enums.h"
42 
43 #include "Config.h"
44 
45 // STL
46 #include <map>
47 #include <memory>
48 #include <string>
49 #include <vector>
50 
51 namespace te
52 {
53  namespace addressgeocoding
54  {
56  {
57  public:
58 
60 
62 
63  void setInput(te::da::DataSourcePtr inDsrc,
64  std::string inDsetName,
65  int inSRID,
66  te::da::DataSourcePtr inAddressDsrc,
67  std::string inAddressDsetName);
68 
69  void setParams( std::vector<std::string> associatedProps,
70  std::string streetNumber);
71 
72  void setNumAttributes(std::string initialLeft,
73  std::string finalLeft,
74  std::string initialRight,
75  std::string finalRight);
76 
77  void setOutput( te::da::DataSourcePtr outDsrc,
78  std::string m_outDsetName);
79 
80  bool paramsAreValid();
81 
82  bool run();
83 
84  protected:
85 
86  bool save(std::auto_ptr<te::mem::DataSet> result, std::auto_ptr<te::da::DataSetType> outDsetName);
87 
88  std::auto_ptr<te::da::DataSetType> getOutputDataSetType();
89 
90  te::gm::LineString* getLineString(te::gm::Geometry* geom);
91 
92  void getLines(te::gm::Geometry* geom, std::vector<te::gm::LineString*>& lines);
93 
94  void getLines(te::gm::GeometryCollection* gc, std::vector<te::gm::LineString*>& lines);
95 
96  void getLines(te::gm::LineString* l, std::vector<te::gm::LineString*>& lines);
97 
99  std::string m_inDsetName;
100  int m_inSRID;
102  std::string m_inAddressDsetName;
103 
104  std::vector<std::string> m_associatedProps; //!< File attributes.
105  std::string m_streetNumber; //!< File attribute that represents the address number.
106 
107  std::string m_initialLeft;
108  std::string m_finalLeft;
109  std::string m_initialRight;
110  std::string m_finalRight;
111 
113  std::string m_outDsetName;
114  };
115  }
116 }
117 #endif // __TERRALIB_ADDRESSGEOCODING_INTERNAL_ADDRESSGEOCODING_OP_H
Configuration flags for the Terrralib Address Geocoding module.
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
std::string m_streetNumber
File attribute that represents the address number.
std::vector< std::string > m_associatedProps
File attributes.
LineString is a curve with linear interpolation between points.
Definition: LineString.h:62
URI C++ Library.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
It is a collection of other geometric objects.
#define TEADDRESSGEOCODINGEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61