OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Types | Public Member Functions | Private Attributes | List of all members
ossimPointCloudGeometry Class Reference

#include <ossimPointCloudGeometry.h>

Inheritance diagram for ossimPointCloudGeometry:
ossimObject ossimReferenced

Public Types

enum  PositionFormat { UNKNOWN, GEOGRAPHIC, MAP_PROJECTED, ECF_METERS }
 

Public Member Functions

 ossimPointCloudGeometry (const ossimString &wkt)
 Constructs from WKT specification. More...
 
 ossimPointCloudGeometry (PositionFormat f=GEOGRAPHIC)
 If arg left to default GEOGRAPHIC, this geometry is essentially unity transform except for a possible datum change if requested. More...
 
 ~ossimPointCloudGeometry ()
 
bool operator== (const ossimPointCloudGeometry &other) const
 
PositionFormat getRawPosFormat () const
 While the raw point positions may be specified in the data file as either geographic, map projected (feet or meters), or ECF meters, the point positions are stored in OSSIM as either as geographic or map (meters) only. More...
 
PositionFormat getStoredPosFormat () const
 This method will return either GEOGRAPHIC or MAP_PROJECTION. More...
 
const ossimMapProjectiongetProjection () const
 
const ossimDatumgetDatum () const
 
void convertPos (const ossimDpt3d &stored_pos, ossimGpt &converted_gpos) const
 Method converts a generic 3D point as stored in the argument ossim3Dpt object, and converts it to an ossimGpt, using the preset datum provided in the argument gpt. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Private Attributes

PositionFormat m_format
 
ossimRefPtr< ossimMapProjectionm_projection
 
const ossimDatumm_datum
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 26 of file ossimPointCloudGeometry.h.

Member Enumeration Documentation

◆ PositionFormat

Enumerator
UNKNOWN 
GEOGRAPHIC 
MAP_PROJECTED 
ECF_METERS 

Definition at line 29 of file ossimPointCloudGeometry.h.

30  {
31  UNKNOWN,
32  GEOGRAPHIC, // x=lon, y=lat, z=ellipsoid height
33  MAP_PROJECTED, // x=easting, y=northing, z=ellipsoid height
34  ECF_METERS // X, Y, Z (see base/ossimEcef)
35  };

Constructor & Destructor Documentation

◆ ossimPointCloudGeometry() [1/2]

ossimPointCloudGeometry::ossimPointCloudGeometry ( const ossimString wkt)

Constructs from WKT specification.

Since the projection units are unknown when the bounds are established, the caller will not know the units of the point coordinates for establishing the bounds.

Definition at line 18 of file ossimPointCloudGeometry.cpp.

References ossimWktProjectionFactory::createProjection(), ossimMapProjection::getDatum(), ossimWktProjectionFactory::instance(), ossimMapProjection::isGeographic(), m_datum, m_format, m_projection, MAP_PROJECTED, and ossimRefPtr< T >::valid().

20  m_projection(0),
22 {
23  // Establish projection from WKT:
24  m_projection = dynamic_cast<ossimMapProjection*>(
26 
27  if (m_projection.valid())
28  {
30  if (!m_projection->isGeographic())
32  }
33 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool isGeographic() const
ossimRefPtr< ossimMapProjection > m_projection
virtual const ossimDatum * getDatum() const
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
STUB. Not implemented.
static ossimDatumFactory * instance()
static ossimWktProjectionFactory * instance()
Implements singleton pattern.

◆ ossimPointCloudGeometry() [2/2]

ossimPointCloudGeometry::ossimPointCloudGeometry ( PositionFormat  f = GEOGRAPHIC)
inline

If arg left to default GEOGRAPHIC, this geometry is essentially unity transform except for a possible datum change if requested.

Definition at line 48 of file ossimPointCloudGeometry.h.

49  : m_format(f),
50  m_projection(0),
51  m_datum (ossimDatumFactory::instance()->wgs84()) {}
ossimRefPtr< ossimMapProjection > m_projection
static ossimDatumFactory * instance()

◆ ~ossimPointCloudGeometry()

ossimPointCloudGeometry::~ossimPointCloudGeometry ( )
inline

Definition at line 53 of file ossimPointCloudGeometry.h.

53 {}

Member Function Documentation

◆ convertPos()

void ossimPointCloudGeometry::convertPos ( const ossimDpt3d stored_pos,
ossimGpt converted_gpos 
) const

Method converts a generic 3D point as stored in the argument ossim3Dpt object, and converts it to an ossimGpt, using the preset datum provided in the argument gpt.

Definition at line 46 of file ossimPointCloudGeometry.cpp.

References ossimGpt::changeDatum(), ossimGpt::datum(), ECF_METERS, GEOGRAPHIC, ossimUnitConversionTool::getMeters(), getProjection(), ossimMapProjection::getProjectionUnits(), ossimGpt::hgt, m_datum, m_format, m_projection, ossimGpt::makeNan(), MAP_PROJECTED, ossimRefPtr< T >::valid(), ossimDpt3d::x, ossimDpt3d::y, and ossimDpt3d::z.

Referenced by ossimPdalReader::parsePoint().

47 {
48  converted_gpos.makeNan();
49 
50  // If the data buffer has existing points, transform them into the new projection and datum:
51  if (m_format == GEOGRAPHIC)
52  {
53  ossimGpt gpt (oldPt.y, oldPt.x, oldPt.z, m_datum);
54  gpt.changeDatum(converted_gpos.datum());
55  converted_gpos = gpt;
56  }
57  else if ((m_format == MAP_PROJECTED) && m_projection.valid())
58  {
60  double coord_scale = uct.getMeters();
61 
62  //Need to convert map E, N to lat, lon
63  ossimDpt oldMapPt(oldPt.x*coord_scale, oldPt.y*coord_scale);
64  ossimGpt gpt(getProjection()->inverse(oldMapPt));
65  gpt.changeDatum(m_datum);
66  gpt.hgt = oldPt.z*coord_scale;
67  gpt.changeDatum(converted_gpos.datum());
68  converted_gpos = gpt;
69  }
70  else if (m_format == ECF_METERS)
71  {
72  ossimEcefPoint oldEcfPt(oldPt);
73  converted_gpos = ossimGpt (oldEcfPt, converted_gpos.datum());
74  }
75 
76  return;
77 }
bool valid() const
Definition: ossimRefPtr.h:75
void makeNan()
Definition: ossimGpt.h:130
ossimRefPtr< ossimMapProjection > m_projection
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
const ossimMapProjection * getProjection() const
ossimUnitType getProjectionUnits() const
OSSIM considers all map projection coordinates (including false eastings and northings) to be in mete...

◆ getDatum()

const ossimDatum* ossimPointCloudGeometry::getDatum ( ) const
inline

Definition at line 72 of file ossimPointCloudGeometry.h.

72 { return m_datum; }

◆ getProjection()

const ossimMapProjection* ossimPointCloudGeometry::getProjection ( ) const
inline

Definition at line 71 of file ossimPointCloudGeometry.h.

Referenced by convertPos().

71 { return m_projection.get(); }
ossimRefPtr< ossimMapProjection > m_projection

◆ getRawPosFormat()

PositionFormat ossimPointCloudGeometry::getRawPosFormat ( ) const
inline

While the raw point positions may be specified in the data file as either geographic, map projected (feet or meters), or ECF meters, the point positions are stored in OSSIM as either as geographic or map (meters) only.

This method is used by the Point cloud handler object for interpreting the input file's raw position format.

Definition at line 63 of file ossimPointCloudGeometry.h.

63 { return m_format; }

◆ getStoredPosFormat()

PositionFormat ossimPointCloudGeometry::getStoredPosFormat ( ) const
inline

This method will return either GEOGRAPHIC or MAP_PROJECTION.

For the latter, the stored coordinates will be in meters.

Definition at line 69 of file ossimPointCloudGeometry.h.

◆ operator==()

bool ossimPointCloudGeometry::operator== ( const ossimPointCloudGeometry other) const

Definition at line 35 of file ossimPointCloudGeometry.cpp.

References m_format, m_projection, and ossimRefPtr< T >::valid().

36 {
37  if (m_format != other.m_format)
38  return false;
39 
40  if (m_projection.valid() && other.m_projection.valid() && (*m_projection == *(other.m_projection)))
41  return true;
42 
43  return false;
44 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimMapProjection > m_projection

Member Data Documentation

◆ m_datum

const ossimDatum* ossimPointCloudGeometry::m_datum
private

Definition at line 83 of file ossimPointCloudGeometry.h.

Referenced by convertPos(), and ossimPointCloudGeometry().

◆ m_format

PositionFormat ossimPointCloudGeometry::m_format
private

Definition at line 81 of file ossimPointCloudGeometry.h.

Referenced by convertPos(), operator==(), and ossimPointCloudGeometry().

◆ m_projection

ossimRefPtr<ossimMapProjection> ossimPointCloudGeometry::m_projection
private

Definition at line 82 of file ossimPointCloudGeometry.h.

Referenced by convertPos(), operator==(), and ossimPointCloudGeometry().


The documentation for this class was generated from the following files: