Orfeo Toolbox  4.0
Typedefs | Functions
OGRGeometry Wrappers
+ Collaboration diagram for OGRGeometry Wrappers:

Typedefs

typedef
boost::interprocess::unique_ptr
< OGRGeometry,
internal::GeometryDeleter > 
otb::ogr::UniqueGeometryPtr
 

Functions

bool otb::ogr::Contains (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Tests for containment. More...
 
bool otb::ogr::Crosses (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Tests for crossing. More...
 
UniqueGeometryPtr otb::ogr::Difference (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Computes difference. More...
 
bool otb::ogr::Disjoint (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Tests for disjointness. More...
 
double otb::ogr::Distance (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Computes distance between two geometries. More...
 
bool otb::ogr::Equals (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Returns wheither if two geometries are equivalent. More...
 
UniqueGeometryPtr otb::ogr::Intersection (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Computes intersection. More...
 
bool otb::ogr::Intersects (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Do these features intersect? More...
 
bool otb::ogr::Overlaps (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Tests for overlap. More...
 
UniqueGeometryPtr otb::ogr::Simplify (OGRGeometry const &g, double tolerance)
 
UniqueGeometryPtr otb::ogr::SimplifyDontPreserveTopology (OGRGeometry const &g, double tolerance)
 
UniqueGeometryPtr otb::ogr::SimplifyPreserveTopology (OGRGeometry const &g, double tolerance)
 
UniqueGeometryPtr otb::ogr::SymDifference (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Computes symmetric difference. More...
 
bool otb::ogr::Touches (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Tests for touching. More...
 
UniqueGeometryPtr otb::ogr::Union (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Computes union. More...
 
UniqueGeometryPtr otb::ogr::UnionCascaded (OGRGeometry const &this_)
 Computes union using cascading. More...
 
bool otb::ogr::Within (OGRGeometry const &lhs, OGRGeometry const &rhs)
 Tests for containment. More...
 

Detailed Description

Helper definition to handle OGRGeometry objects.

Note
OTB doesn't provide anything on top of OGRGeometryFactory to create new factories. Please, never create new OGRGeometry by hand with new operator as there is no garanty they'll get destroyed within the proper memory context when released from an owning OGRFeature.

Thus, always use OGRGeometryFactory functions to create new geometries. You can then manage their lifetime manually or rely on UniqueGeometryPtr that provides a non-copyable, but movable RAII wrapper around OGRGeometry.

Since
OTB v 3.14.0

Typedef Documentation

typedef boost::interprocess::unique_ptr<OGRGeometry, internal::GeometryDeleter> otb::ogr::UniqueGeometryPtr

Smart-pointer over OGRGeometry, with move-semantics. In a few words:

  • When a function receives a unique_ptr<>, it implicitly assumes responsibility of the received pointer.
  • When a function returns a unique_ptr<>, the client code implicitly assumes responsibility of the returned pointer.
  • When exiting a scope, the pointer is destroyed. Which means, as long as we keep using unique_ptr<> around functions calls, there is no need to burden our mind with the lifetime of the encapsulated pointers.
  • Moreover, we can specify how pointers are deleted; property that we exploit to use the ad'hoc destruction function from OGR API, see GeometryDeleter.
See Also
http://www2.research.att.com/~bs/C++0xFAQ.html#rval about move-semantics.
http://www2.research.att.com/~bs/C++0xFAQ.html#std-unique_ptr about std::unique_ptr<>
GOTW #103, #104 about unique_ptr<> as well: http://herbsutter.com/gotw/_103/
Note
You may experiment difficulties to copy UniqueGeometryPtr. This is likelly to be normal. You'll have to emulate std::move() with boost::move() (with Boost v1.48+, or with boost::interprocess::move() otherwise). Check for instance Feature::StealGeometry(), or Feature::SetGeometryDirectly() to see examples.

Definition at line 92 of file otbOGRGeometryWrapper.h.

Function Documentation

bool otb::ogr::Contains ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Tests for containment.

Definition at line 78 of file otbOGRGeometryWrapper.cxx.

bool otb::ogr::Crosses ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Tests for crossing.

Definition at line 68 of file otbOGRGeometryWrapper.cxx.

otb::ogr::UniqueGeometryPtr otb::ogr::Difference ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Computes difference.

Definition at line 113 of file otbOGRGeometryWrapper.cxx.

bool otb::ogr::Disjoint ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Tests for disjointness.

Definition at line 58 of file otbOGRGeometryWrapper.cxx.

double otb::ogr::Distance ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Computes distance between two geometries.

Definition at line 88 of file otbOGRGeometryWrapper.cxx.

bool otb::ogr::Equals ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Returns wheither if two geometries are equivalent.

Definition at line 52 of file otbOGRGeometryWrapper.cxx.

otb::ogr::UniqueGeometryPtr otb::ogr::Intersection ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Computes intersection.

Definition at line 93 of file otbOGRGeometryWrapper.cxx.

Referenced by otb::OGRLayerStreamStitchingFilter< TInputImage >::ProcessStreamingLine().

bool otb::ogr::Intersects ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Do these features intersect?

Definition at line 46 of file otbOGRGeometryWrapper.cxx.

Referenced by otb::OGRLayerStreamStitchingFilter< TInputImage >::ProcessStreamingLine().

bool otb::ogr::Overlaps ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Tests for overlap.

Definition at line 83 of file otbOGRGeometryWrapper.cxx.

otb::ogr::UniqueGeometryPtr otb::ogr::Simplify ( OGRGeometry const &  g,
double  tolerance 
)

Simplifies Geometry. This function tries to uses the best simplication algorithm available in the current version of GDAL. Best in the sense of topology preservation. i.e. With GDAL v1.8.0, OGRGeometry::Simplify() is used; with GDAL v1.9.0+, OGRGeometry::SimplifyPreserveTopology() is used.

Precondition
Requires GDAL 1.8.0
See Also
OGRGeometry::Simplify()
OGRGeometry::SimplifyPreserveTopology()

Definition at line 147 of file otbOGRGeometryWrapper.cxx.

Referenced by otb::PersistentImageToOGRLayerSegmentationFilter< TImageType, TSegmentationFilter >::ProcessTile().

otb::ogr::UniqueGeometryPtr otb::ogr::SimplifyDontPreserveTopology ( OGRGeometry const &  g,
double  tolerance 
)

Simplifies Geometry with no guarantee of preserving the geometry.

Precondition
Requires GDAL 1.8.0
See Also
OGRGeometry::Simplify()

Definition at line 127 of file otbOGRGeometryWrapper.cxx.

otb::ogr::UniqueGeometryPtr otb::ogr::SimplifyPreserveTopology ( OGRGeometry const &  g,
double  tolerance 
)

Simplifies Geometry while preserving topology.

Precondition
Requires GDAL 1.9.0
See Also
OGRGeometry::SimplifyPreserveTopology()

Definition at line 137 of file otbOGRGeometryWrapper.cxx.

otb::ogr::UniqueGeometryPtr otb::ogr::SymDifference ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Computes symmetric difference.

Definition at line 118 of file otbOGRGeometryWrapper.cxx.

bool otb::ogr::Touches ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Tests for touching.

Definition at line 63 of file otbOGRGeometryWrapper.cxx.

otb::ogr::UniqueGeometryPtr otb::ogr::Union ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)
otb::ogr::UniqueGeometryPtr otb::ogr::UnionCascaded ( OGRGeometry const &  this_)

Computes union using cascading.

Definition at line 103 of file otbOGRGeometryWrapper.cxx.

bool otb::ogr::Within ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Generated at Sat Mar 8 2014 16:29:09 for Orfeo Toolbox with doxygen 1.8.3.1