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

Typedefs

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

Functions

OTBGdalAdapters_EXPORT bool otb::ogr::Contains (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT bool otb::ogr::Crosses (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT
UniqueGeometryPtr 
otb::ogr::Difference (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT bool otb::ogr::Disjoint (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT double otb::ogr::Distance (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT bool otb::ogr::Equals (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT
UniqueGeometryPtr 
otb::ogr::Intersection (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT bool otb::ogr::Intersects (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT bool otb::ogr::Overlaps (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT
UniqueGeometryPtr 
otb::ogr::SimplifyDontPreserveTopology (OGRGeometry const &g, double tolerance)
 
OTBGdalAdapters_EXPORT
UniqueGeometryPtr 
otb::ogr::SimplifyPreserveTopology (OGRGeometry const &g, double tolerance)
 
OTBGdalAdapters_EXPORT
UniqueGeometryPtr 
otb::ogr::SymDifference (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT bool otb::ogr::Touches (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT
UniqueGeometryPtr 
otb::ogr::Union (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT
UniqueGeometryPtr 
otb::ogr::UnionCascaded (OGRGeometry const &this_)
 
OTBGdalAdapters_EXPORT bool otb::ogr::Within (OGRGeometry const &lhs, OGRGeometry const &rhs)
 
OTBGdalAdapters_EXPORT
UniqueGeometryPtr 
otb::ogr::Simplify (OGRGeometry const &g, double tolerance)
 

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 105 of file otbOGRGeometryWrapper.h.

Function Documentation

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

Tests for containment.

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

Tests for crossing.

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

Computes difference.

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

Tests for disjointness.

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

Computes distance between two geometries.

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

Returns wheither if two geometries are equivalent.

OTBGdalAdapters_EXPORT UniqueGeometryPtr otb::ogr::Intersection ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)
OTBGdalAdapters_EXPORT bool otb::ogr::Intersects ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)
OTBGdalAdapters_EXPORT bool otb::ogr::Overlaps ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Tests for overlap.

OTBGdalAdapters_EXPORT 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()

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

OTBGdalAdapters_EXPORT 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()
OTBGdalAdapters_EXPORT UniqueGeometryPtr otb::ogr::SimplifyPreserveTopology ( OGRGeometry const &  g,
double  tolerance 
)

Simplifies Geometry while preserving topology.

Precondition
Requires GDAL 1.9.0
See Also
OGRGeometry::SimplifyPreserveTopology()
OTBGdalAdapters_EXPORT UniqueGeometryPtr otb::ogr::SymDifference ( OGRGeometry const &  lhs,
OGRGeometry const &  rhs 
)

Computes symmetric difference.

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

Tests for touching.

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

Computes union using cascading.

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