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 "../sam/rtree/Index.h"
33 #include "Config.h"
34 
35 namespace te
36 {
37 
38  namespace ds
39  {
40  class DataSetType;
41  class DataSet;
42  }
43 
44  namespace gm
45  {
46  class Envelope;
47  class Geometry;
48  }
49 
50  namespace mem
51  {
52  class DataSet;
53  }
54 
55  namespace rst
56  {
57  class Raster;
58  }
59 
60  namespace cellspace
61  {
62  /*!
63  \class CellularSpacesOperations
64 
65  \brief This class provide cellular spaces operations.
66  */
68  {
69  public:
70 
71  /*! \enum Cellular Space Type. */
73  {
74  CELLSPACE_POLYGONS, /*!< Polygons Type. */
75  CELLSPACE_POINTS /*!< Points Type. */
76  };
77 
79 
81 
82  /*!
83  \brief It creates a Cellular Space.
84 
85  \param outputSource Information about the output datasource.
86  \param name Name of the output layer.
87  \param resX Cells resolution in X-dimension.
88  \param resY Cells resolution in X-dimension.
89  \param env The bouding box of the cell space.
90  \param srid The spatial reference for the bouding box.
91  \param type The type of cell space to be created.
92  */
94  const std::string& name,
95  const double& resX,
96  const double& resY,
97  const te::gm::Envelope& env,
98  const int srid,
99  CellSpaceType type,
100  te::map::AbstractLayerPtr layerBase);
101  private:
102 
103  /*!
104  \brief Add a cell in the memory dataset
105 
106  \param ds DataSet where the cell will be added.
107  \param col Column number.
108  \param row Row number.
109  \param geom Geometry that will be added.
110  */
111  void addCell(te::mem::DataSet* ds, int col, int row, te::gm::Geometry* geom);
112 
113  /*!
114  \brief Get a RTree with the geometries envelopes of layer.
115 
116  \param layerBase Layer base.
117 
118  \return The RTree created.
119  */
121 
122  /*!
123  \brief Create the DataSetType of the cellular space.
124 
125  \param name DataSetType name.
126  \param srid DataSetType SRID.
127  \param type Celluar space type (polygon, points or raster).
128 
129  \return The DataSetType created.
130  */
131  te::da::DataSetType* createCellularDataSetType(const std::string& name, int srid, CellSpaceType type);
132  };
133  }
134 }
135 
136 
137 #endif // __TERRALIB_CELLSPACE_INTERNAL_CELLSPACEOPERATIONS_H
This class provide cellular spaces operations.
void addCell(te::mem::DataSet *ds, int col, int row, te::gm::Geometry *geom)
Add a cell in the memory dataset.
te::da::DataSetType * createCellularDataSetType(const std::string &name, int srid, CellSpaceType type)
Create the DataSetType of the cellular space.
void createCellSpace(te::da::DataSourceInfoPtr outputSource, const std::string &name, const double &resX, const double &resY, const te::gm::Envelope &env, const int srid, CellSpaceType type, te::map::AbstractLayerPtr layerBase)
It creates a Cellular Space.
te::sam::rtree::Index< size_t, 8 > * getRtree(te::map::AbstractLayerPtr layerBase)
Get a RTree with the geometries envelopes of layer.
A class that models the description of a dataset.
Definition: DataSetType.h:73
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver.
Definition: DataSet.h:66
An abstract class for raster data strucutures.
Definition: Raster.h:72
A class that represents an R-tree.
Definition: Index.h:57
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TerraLib.
#define TECELLSPACEEXPORT
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).