All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CellSpaceOperations.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 terralib/cellspace/CellularSpacesOperations.h
22 
23  \brief Class to provide Cellular Spaces operations.
24 */
25 
26 #ifndef __TERRALIB_CELLSPACE_INTERNAL_CELLSPACEOPERATIONS_H
27 #define __TERRALIB_CELLSPACE_INTERNAL_CELLSPACEOPERATIONS_H
28 
29 // TerraLib
30 #include "../dataaccess/datasource/DataSourceInfo.h"
31 #include "../maptools/AbstractLayer.h"
32 #include "Config.h"
33 
34 namespace te
35 {
36 
37  namespace ds
38  {
39  class DataSetType;
40  class DataSet;
41  }
42 
43  namespace gm
44  {
45  class Envelope;
46  class Geometry;
47  }
48 
49  namespace mem
50  {
51  class DataSet;
52  }
53 
54  namespace rst
55  {
56  class Raster;
57  }
58 
59  namespace cellspace
60  {
61  /*!
62  \class CellularSpacesOperations
63 
64  \brief This class provide cellular spaces operations.
65  */
67  {
68  public:
69 
70  /*! \enum Cellular Space Type. */
72  {
73  CELLSPACE_POLYGONS, /*!< Polygons Type. */
74  CELLSPACE_POINTS /*!< Points Type. */
75  };
76 
78 
80 
81  /*!
82  \brief It create a Cellular Space.
83 
84  \param name Name of the DataSet.
85  \param layerbase Layer base for cellular space creation.
86  \param resX Resolution X.
87  \param resY Resolution Y.
88  \param useMask If will use poligons as mask.
89  \param type Celluar space type (polygon, points or raster).
90  */
91  void createCellSpace(te::da::DataSourceInfoPtr outputSource,
92  const std::string& name,
93  te::map::AbstractLayerPtr layerBase,
94  double resX,
95  double resY,
96  bool useMask,
97  CellSpaceType type = CELLSPACE_POLYGONS);
98 
99  /*!
100  \brief It create a Cellular Space.
101 
102  \param name Name of the DataSet.
103  \param resX Resolution X.
104  \param resY Resolution Y.
105  \param env Envelope base to creation.
106  \param srid SRID of the envelope.
107  \param type Celluar space type (polygon, points or raster).
108  */
109  void createCellSpace(te::da::DataSourceInfoPtr outputSource,
110  const std::string& name,
111  const double resX,
112  const double resY,
113  const te::gm::Envelope& env,
114  const int srid,
115  const CellSpaceType type = CELLSPACE_POLYGONS);
116 
117  private:
118 
119  /*!
120  \brief Add a cell in the memory dataset
121 
122  \param ds DataSet where the cell will be added.
123  \param col Column number.
124  \param row Row number.
125  \param geom Geometry that will be added.
126  */
127  void addCell(te::mem::DataSet* ds, int col, int row, te::gm::Geometry* geom);
128 
129  /*!
130  \brief Get a RTree with the geometries envelopes of layer.
131 
132  \param layerBase Layer base.
133 
134  \return The RTree created.
135  */
137 
138  /*!
139  \brief Create the DataSetType of the cellular space.
140 
141  \param name DataSetType name.
142  \param srid DataSetType SRID.
143  \param type Celluar space type (polygon, points or raster).
144 
145  \return The DataSetType created.
146  */
147  te::da::DataSetType* createCellularDataSetType(const std::string& name, int srid, CellSpaceType type);
148  };
149  }
150 }
151 
152 
153 #endif // __TERRALIB_CELLSPACE_INTERNAL_CELLSPACEOPERATIONS_H
This class provide cellular spaces operations.
#define TECELLSPACEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:64
A class that represents an R-tree.
Definition: Index.h:56
A class that models the description of a dataset.
Definition: DataSetType.h:72
Configuration flags for the Cellular Spaces module of TerraLib.
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
Definition: DataSet.h:65
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
An abstract class for raster data strucutures.
Definition: Raster.h:71
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr