CommonFunctions.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/vp/CommonDataStructures.h
22 
23  \brief Utility classes, structures and definitions for Vector Processing.
24  */
25 
26 #ifndef __TERRALIB_VP_INTERNAL_COMMONFUNCTIONS_H
27 #define __TERRALIB_VP_INTERNAL_COMMONFUNCTIONS_H
28 
29 //Terralib include files
30 #include "Config.h"
31 
32 #include "../geometry/CommonDataStructures.h"
33 #include "../geometry/Enums.h"
34 
35 
36 //STL include files
37 #include <vector>
38 
39 namespace te
40 {
41  namespace gm
42  {
43  struct Coord2D;
44  class Envelope;
45  class Geometry;
46  }
47 
48  namespace vp
49  {
50  class Feature;
51  class FeatureSet;
52  class GeometryInfo;
53  class SegmentInfo;
54 
55 
56 
57  /*!
58  * \brief Gets the segment information related to all segments from the given geometry. An Optional filter can be used to filter the segments that will be returned
59  *
60  * \param geometry The geometry to be analysed
61  * \param filter The optional filter
62  * \param vecSegmentInfo [Return] The segments from the given geometry. The return is a parameter to make easier to create a list containing segments from several geometries
63  */
64  TEVPEXPORT void GetAllSegments(const te::gm::Geometry* geometry, const te::gm::Envelope& filter, std::vector<SegmentInfo>& vecSegmentInfo);
65 
66  /*!
67  \brief Algorithm to fast detection of spatial relations between geometries. Very useful to fase dectect if two geomtries dont intercept themselves
68  Sometimes can generate false positives for overlaps, but never generates false positives for disjoint and touches
69 
70  \param geometryA The input geometry A
71  \param geometryB The input geometry B
72 
73  \return The detected spatial relation
74  */
76 
77  /*!
78  \brief Algorithm to fast detection of spatial relations between geometries. Very useful to fase dectect if two geomtries dont intercept themselves
79  Sometimes can generate false positives for overlaps, but never generates false positives for disjoint and touches
80 
81  \param geometryA The input geometry A
82  \param geometryB The input geometry B
83 
84  \return The detected spatial relation
85  */
87 
88  //!< Discards all the features from the set that have null or empty geometries
90 
91  //!< Splits all feature that have geometry collections in to features that have single type geometries. All the attributes are copied
92  TEVPEXPORT void Multi2Single(const te::vp::Feature* feature, te::vp::FeatureSet& singleFeatureSet);
93 
94  //!< Splits all the features that have geometry collections in to features that have single type geometries. All the attributes are copied
95  TEVPEXPORT void Multi2Single(const te::vp::FeatureSet& featureSet, te::vp::FeatureSet& singleFeatureSet);
96 
97  //!< Adjust the given geometry to the given geometry type. If the conversion is not possible, the geometry is discarded
99 
100  //!< Adjust the given geometry to the given geometry type. If the conversion is not possible, the geometry is discarded
102  }
103 }
104 
105 
106 
107 #endif //__TERRALIB_VP_INTERNAL_COMMONFUNCTIONS_H
te::gm::Envelope
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
te::vp::AdjustToGeomType
TEVPEXPORT te::gm::GeometryVector AdjustToGeomType(const te::gm::Geometry *geometry, te::gm::GeomType geomType)
Adjust the given geometry to the given geometry type. If the conversion is not possible,...
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::vp::DiscardFeaturesWithNullAndEmptyGeometries
TEVPEXPORT void DiscardFeaturesWithNullAndEmptyGeometries(te::vp::FeatureSet &featureSet)
Splits all feature that have geometry collections in to features that have single type geometries....
te::vp::GetAllSegments
TEVPEXPORT void GetAllSegments(const te::gm::Geometry *geometry, const te::gm::Envelope &filter, std::vector< SegmentInfo > &vecSegmentInfo)
Gets the segment information related to all segments from the given geometry. An Optional filter can ...
te::vp::FastRelationCalculator
TEVPEXPORT te::gm::SpatialRelation FastRelationCalculator(const te::vp::GeometryInfo *geometryInfoA, const te::vp::GeometryInfo *geometryInfoB)
Algorithm to fast detection of spatial relations between geometries. Very useful to fase dectect if t...
te::gm::GeometryVector
std::vector< te::gm::Geometry * > GeometryVector
Definition: CommonDataStructures.h:50
TEVPEXPORT
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
te::gm::SpatialRelation
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:128
te::vp::Multi2Single
TEVPEXPORT void Multi2Single(const te::vp::Feature *feature, te::vp::FeatureSet &singleFeatureSet)
Splits all the features that have geometry collections in to features that have single type geometrie...
te::vp::GeometryInfo
Definition: CommonDataStructures.h:273
te::vp::FeatureSet
An alias for a set of Features.
Definition: Feature.h:60
te::vp::Feature
A feature is a composition of a geometry and its attributes.
Definition: Feature.h:70
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::gm::Geometry
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
te::gm::GeomType
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:42