SpatialRelations.cpp
Go to the documentation of this file.
1 // Examples
2 #include "GeometryExamples.h"
3 
4 #include <terralib_buildconfig.h>
5 
7 {
8  switch(relation)
9  {
10  case te::gm::CONTAINS:
11  return g1->contains(g2);
12 
13  case te::gm::COVEREDBY:
14  return g1->coveredBy(g2);
15 
16  case te::gm::COVERS:
17  return g1->covers(g2);
18 
19  case te::gm::CROSSES:
20  return g1->crosses(g2);
21 
22  case te::gm::DISJOINT:
23  return g1->disjoint(g2);
24 
25  case te::gm::EQUALS:
26  return g1->equals(g2);
27 
28  case te::gm::INTERSECTS:
29  return g1->intersects(g2);
30 
31  case te::gm::OVERLAPS:
32  return g1->overlaps(g2);
33 
34  case te::gm::TOUCHES:
35  return g1->touches(g2);
36 
37  case te::gm::WITHIN:
38  return g1->within(g2);
39 
40  default:
41  return false;
42  }
43 
44  return false;
45 }
46 
virtual bool disjoint(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if the geometry object is spatially disjoint from rhs geometry.
SpatialRelation
Spatial relations between geometric objects.
virtual bool intersects(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if the geometry object spatially intersects rhs geometry.
virtual bool touches(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if the geometry object spatially touches rhs geometry.
virtual bool overlaps(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if this geometry object spatially overlaps rhs geometry.
virtual bool within(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if the geometry object is spatially within rhs geometry.
bool spatialRelation(te::gm::Geometry *g1, te::gm::Geometry *g2, te::gm::SpatialRelation relation)
virtual bool contains(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if this geometry object spatially contains rhs geometry.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
A set of geometry examples.
virtual bool crosses(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if the geometry object spatially crosses rhs geometry.
virtual bool coveredBy(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if this geometry object is spatially covered by rhs geometry.
virtual bool equals(const Geometry *const rhs, const bool exact=false) const _NOEXCEPT_OP(false)
It returns true if the geometry object is spatially equal to rhs geometry.
virtual bool covers(const Geometry *const rhs) const _NOEXCEPT_OP(false)
It returns true if this geometry object spatially covers the rhs geometry.