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 creates a Cellular Space.
83 
84  \param outputSource Information about the output datasource.
85  \param name Name of the output layer.
86  \param resX Cells resolution in X-dimension.
87  \param resY Cells resolution in X-dimension.
88  \param env The bouding box of the cell space.
89  \param srid The spatial reference for the bouding box.
90  \param type The type of cell space to be created.
91  */
92  void createCellSpace(te::da::DataSourceInfoPtr outputSource,
93  const std::string& name,
94  const double& resX,
95  const double& resY,
96  const te::gm::Envelope& env,
97  const int srid,
98  CellSpaceType type,
99  te::map::AbstractLayerPtr layerBase);
100  private:
101 
102  /*!
103  \brief Add a cell in the memory dataset
104 
105  \param ds DataSet where the cell will be added.
106  \param col Column number.
107  \param row Row number.
108  \param geom Geometry that will be added.
109  */
110  void addCell(te::mem::DataSet* ds, int col, int row, te::gm::Geometry* geom);
111 
112  /*!
113  \brief Get a RTree with the geometries envelopes of layer.
114 
115  \param layerBase Layer base.
116 
117  \return The RTree created.
118  */
120 
121  /*!
122  \brief Create the DataSetType of the cellular space.
123 
124  \param name DataSetType name.
125  \param srid DataSetType SRID.
126  \param type Celluar space type (polygon, points or raster).
127 
128  \return The DataSetType created.
129  */
130  te::da::DataSetType* createCellularDataSetType(const std::string& name, int srid, CellSpaceType type);
131  };
132  }
133 }
134 
135 
136 #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:61
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
URI C++ Library.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:74
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr