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

#include <ossimNitfGeolobTag.h>

Inheritance diagram for ossimNitfGeolobTag:
ossimNitfRegisteredTag ossimObject ossimPropertyInterface ossimReferenced

Public Types

enum  {
  ARV_SIZE = 9, BRV_SIZE = 9, LSO_SIZE = 15, PSO_SIZE = 15,
  TAG_SIZE = 48
}
 

Public Member Functions

 ossimNitfGeolobTag ()
 default constructor More...
 
virtual void parseStream (ossim::istream &in)
 Parse method. More...
 
virtual void writeStream (ossim::ostream &out)
 Write method. More...
 
virtual std::ostream & print (std::ostream &out, const std::string &prefix) const
 Print method that outputs a key/value type format adding prefix to keys. More...
 
std::string getArvString () const
 Gets the ARV field. More...
 
ossim_uint32 getArv () const
 Gets the ARV field. More...
 
ossim_float64 getDegreesPerPixelLon () const
 Gets degrees per pixel in lonitude direction from BRV field. More...
 
void setArv (ossim_uint32 arv)
 Sets the ARV field. More...
 
void setDegreesPerPixelLon (const ossim_float64 &deltaLon)
 Sets the ARV field from decimal degrees per pixel longitude. More...
 
std::string getBrvString () const
 Gets the BRV field. More...
 
ossim_uint32 getBrv () const
 Gets the BRV field. More...
 
ossim_float64 getDegreesPerPixelLat () const
 Gets degrees per pixel in latitude direction from BRV field. More...
 
void setBrv (ossim_uint32 brv)
 Sets the BRV field. More...
 
void setDegreesPerPixelLat (const ossim_float64 &deltaLat)
 Sets the BRV field from decimal degrees per pixel latitude. More...
 
std::string getLsoString () const
 Gets the LSO field. More...
 
ossim_float64 getLso () const
 Gets the LSO field(Longitude Origin). More...
 
void setLso (const ossim_float64 &lso)
 Sets the LSO field(Longitude Origin). More...
 
std::string getPsoString () const
 Gets the PSO field. More...
 
ossim_float64 getPso () const
 Gets the PSO field(Latitude Origin). More...
 
void setPso (const ossim_float64 &pso)
 Sets the PSO field(Latitude Origin). More...
 
- Public Member Functions inherited from ossimNitfRegisteredTag
 ossimNitfRegisteredTag ()
 default constructor More...
 
 ossimNitfRegisteredTag (const std::string &tagName, ossim_uint32 tagLength)
 Constructor that takes name and size. More...
 
virtual ~ossimNitfRegisteredTag ()
 destructor More...
 
virtual std::string getRegisterTagName () const
 This will return the name of the registered tag for this user defined header. More...
 
virtual const std::string & getTagName () const
 This will return the name of the registered tag for this user defined header. More...
 
virtual void setTagName (const std::string &tagName)
 
virtual ossim_uint32 getSizeInBytes () const
 Returns the length in bytes of the tag from the CEL or REL field. More...
 
virtual ossim_uint32 getTagLength () const
 Returns the length in bytes of the tag from the CEL or REL field. More...
 
virtual void setTagLength (ossim_uint32 length)
 Set the tag length. More...
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual void getMetadata (ossimKeywordlist &kwl, const char *prefix=0) const
 Default interface to populate keyword list with metadata. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const ossimString &prefix) const
 
- 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
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 

Protected Attributes

std::string m_tagData
 
- Protected Attributes inherited from ossimNitfRegisteredTag
std::string m_tagName
 
ossim_uint32 m_tagLength
 

Additional Inherited Members

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

Detailed Description

Definition at line 25 of file ossimNitfGeolobTag.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ARV_SIZE 
BRV_SIZE 
LSO_SIZE 
PSO_SIZE 
TAG_SIZE 

Definition at line 28 of file ossimNitfGeolobTag.h.

Constructor & Destructor Documentation

◆ ossimNitfGeolobTag()

ossimNitfGeolobTag::ossimNitfGeolobTag ( )

default constructor

Definition at line 34 of file ossimNitfGeolobTag.cpp.

Member Function Documentation

◆ getArv()

ossim_uint32 ossimNitfGeolobTag::getArv ( ) const

Gets the ARV field.

Returns
ARV field as a positive integer.

Definition at line 74 of file ossimNitfGeolobTag.cpp.

References getArvString(), and ossimString::toUInt32().

Referenced by getDegreesPerPixelLon().

75 {
76  ossim_uint32 result = 0;
77  std::string s = getArvString();
78  if ( s.size() )
79  {
80  result = ossimString(s).toUInt32();
81  }
82  return result;
83 }
std::string getArvString() const
Gets the ARV field.
ossim_uint32 toUInt32() const
unsigned int ossim_uint32

◆ getArvString()

std::string ossimNitfGeolobTag::getArvString ( ) const

Gets the ARV field.

Longitude density: This field shall contain the pixel ground spacing in E/W direction that is the number of pixels or elements intervals in 360°

Pixel size in decimal degree = 360.0 / AVR

Returns
ARV field as a string.

Definition at line 69 of file ossimNitfGeolobTag.cpp.

References ARV_SIZE, and m_tagData.

Referenced by getArv(), and print().

◆ getBrv()

ossim_uint32 ossimNitfGeolobTag::getBrv ( ) const

Gets the BRV field.

Returns
BRV field as a positive integer.

Definition at line 133 of file ossimNitfGeolobTag.cpp.

References getBrvString(), and ossimString::toUInt32().

Referenced by getDegreesPerPixelLat().

134 {
135  ossim_uint32 result = 0;
136  std::string s = getBrvString();
137  if ( s.size() )
138  {
139  result = ossimString(s).toUInt32();
140  }
141  return result;
142 }
std::string getBrvString() const
Gets the BRV field.
ossim_uint32 toUInt32() const
unsigned int ossim_uint32

◆ getBrvString()

std::string ossimNitfGeolobTag::getBrvString ( ) const

Gets the BRV field.

Latitude density: This field shall contain the pixel ground spacing in N/S direction that is the number of pixels or elements intervals in 360°.

Pixel size in decimal degree = 360.0 / BVR

Returns
BRV field as a string.

Definition at line 117 of file ossimNitfGeolobTag.cpp.

References BRV_SIZE, and m_tagData.

Referenced by getBrv(), and print().

◆ getDegreesPerPixelLat()

ossim_float64 ossimNitfGeolobTag::getDegreesPerPixelLat ( ) const

Gets degrees per pixel in latitude direction from BRV field.

Pixel size in decimal degree = 360.0 / BVR

Returns
Degrees per pixel in latitude direction.

Definition at line 122 of file ossimNitfGeolobTag.cpp.

References getBrv().

123 {
124  ossim_float64 result = 0.0;
125  ossim_uint32 brv = getBrv();
126  if ( brv > 0 )
127  {
128  result = 360.0 / brv;
129  }
130  return result;
131 }
ossim_uint32 getBrv() const
Gets the BRV field.
double ossim_float64
unsigned int ossim_uint32

◆ getDegreesPerPixelLon()

ossim_float64 ossimNitfGeolobTag::getDegreesPerPixelLon ( ) const

Gets degrees per pixel in lonitude direction from BRV field.

Pixel size in decimal degree = 360.0 / AVR

Returns
Degrees per pixel in lonitude direction.

Definition at line 85 of file ossimNitfGeolobTag.cpp.

References getArv().

86 {
87  ossim_float64 result = 0.0;
88  ossim_uint32 arv = getArv();
89  if ( arv > 0 )
90  {
91  result = 360.0 / arv;
92  }
93  return result;
94 }
double ossim_float64
unsigned int ossim_uint32
ossim_uint32 getArv() const
Gets the ARV field.

◆ getLso()

ossim_float64 ossimNitfGeolobTag::getLso ( ) const

Gets the LSO field(Longitude Origin).

Returns
LSO field as a positive integer.

Definition at line 171 of file ossimNitfGeolobTag.cpp.

References getLsoString(), and ossimString::toFloat64().

172 {
173  ossim_float64 result = 0;
174  std::string s = getLsoString();
175  if ( s.size() )
176  {
177  result = ossimString(s).toFloat64();
178  }
179  return result;
180 }
std::string getLsoString() const
Gets the LSO field.
double ossim_float64
ossim_float64 toFloat64() const

◆ getLsoString()

std::string ossimNitfGeolobTag::getLsoString ( ) const

Gets the LSO field.

Longitude of Reference Origin: This field shall contain the longitude of the origin pixel (row number 0, column number 0) in the absolute coordinate system.

Returns
LSO field as a string.

Definition at line 166 of file ossimNitfGeolobTag.cpp.

References LSO_SIZE, and m_tagData.

Referenced by getLso(), and print().

◆ getPso()

ossim_float64 ossimNitfGeolobTag::getPso ( ) const

Gets the PSO field(Latitude Origin).

Returns
PSO field as a positive integer.

Definition at line 202 of file ossimNitfGeolobTag.cpp.

References getPsoString(), and ossimString::toFloat64().

203 {
204  ossim_float64 result = 0;
205  std::string s = getPsoString();
206  if ( s.size() )
207  {
208  result = ossimString(s).toFloat64();
209  }
210  return result;
211 }
std::string getPsoString() const
Gets the PSO field.
double ossim_float64
ossim_float64 toFloat64() const

◆ getPsoString()

std::string ossimNitfGeolobTag::getPsoString ( ) const

Gets the PSO field.

Latitude of Reference Origin: This field shall contain the latitude of the origin pixel (row number 0, column number 0) in the absolute coordinate system.

Returns
PSO field as a string.

Definition at line 197 of file ossimNitfGeolobTag.cpp.

References m_tagData, and PSO_SIZE.

Referenced by getPso(), and print().

◆ parseStream()

void ossimNitfGeolobTag::parseStream ( ossim::istream in)
virtual

Parse method.

Parameters
inStream to parse.

Implements ossimNitfRegisteredTag.

Definition at line 40 of file ossimNitfGeolobTag.cpp.

References m_tagData, and TAG_SIZE.

◆ print()

std::ostream & ossimNitfGeolobTag::print ( std::ostream &  out,
const std::string &  prefix 
) const
virtual

Print method that outputs a key/value type format adding prefix to keys.

Parameters
outStream to output to.
prefixPrefix added to key like "image0.";

Reimplemented from ossimNitfRegisteredTag.

Definition at line 50 of file ossimNitfGeolobTag.cpp.

References getArvString(), getBrvString(), getLsoString(), getPsoString(), ossimNitfRegisteredTag::getTagLength(), and ossimNitfRegisteredTag::getTagName().

52 {
53  std::string pfx = prefix;
54  pfx += getTagName();
55  pfx += ".";
56 
57  out << setiosflags(ios::left)
58  << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
59  << pfx << std::setw(24) << "CEL:" << getTagLength() << "\n"
60  << pfx << std::setw(24) << "ARV:" << getArvString() << "\n"
61  << pfx << std::setw(24) << "BRV:" << getBrvString() << "\n"
62  << pfx << std::setw(24) << "LSO:" << getLsoString() << "\n"
63  << pfx << std::setw(24) << "PSO:" << getPsoString() << "\n";
64 
65  return out;
66 }
virtual const std::string & getTagName() const
This will return the name of the registered tag for this user defined header.
std::string getLsoString() const
Gets the LSO field.
std::string getBrvString() const
Gets the BRV field.
std::string getArvString() const
Gets the ARV field.
std::string getPsoString() const
Gets the PSO field.
virtual ossim_uint32 getTagLength() const
Returns the length in bytes of the tag from the CEL or REL field.

◆ setArv()

void ossimNitfGeolobTag::setArv ( ossim_uint32  arv)

Sets the ARV field.

Valid range: 000000002 to 999999999 arv

Definition at line 96 of file ossimNitfGeolobTag.cpp.

References ARV_SIZE, and m_tagData.

Referenced by setDegreesPerPixelLon().

97 {
98  if ( (arv >= 2) && (arv <= 999999999) )
99  {
101  s.fill('0');
102  s << std::setw(ossimNitfGeolobTag::ARV_SIZE) << arv;
103  m_tagData.replace( 0, ossimNitfGeolobTag::ARV_SIZE, s.str() );
104  }
105 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35

◆ setBrv()

void ossimNitfGeolobTag::setBrv ( ossim_uint32  brv)

Sets the BRV field.

Valid range: 000000002 to 999999999 brv

Definition at line 144 of file ossimNitfGeolobTag.cpp.

References BRV_SIZE, and m_tagData.

Referenced by setDegreesPerPixelLat().

145 {
146  if ( (brv >= 2) && (brv <= 999999999) )
147  {
149  s.fill('0');
150  s << std::setw(ossimNitfGeolobTag::BRV_SIZE) << brv;
151 
152  m_tagData.replace( 9, ossimNitfGeolobTag::BRV_SIZE, s.str() );
153  }
154 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35

◆ setDegreesPerPixelLat()

void ossimNitfGeolobTag::setDegreesPerPixelLat ( const ossim_float64 deltaLat)

Sets the BRV field from decimal degrees per pixel latitude.

deltaLon

Definition at line 156 of file ossimNitfGeolobTag.cpp.

References setBrv().

Referenced by ossimNitfWriterBase::addGeolobTag().

157 {
158  if ( deltaLat > 0.0 )
159  {
160  ossim_uint32 pixels = (ossim_uint32)((1.0/deltaLat)*360.0 + .5);
161  setBrv(pixels);
162  }
163 }
unsigned int ossim_uint32
void setBrv(ossim_uint32 brv)
Sets the BRV field.

◆ setDegreesPerPixelLon()

void ossimNitfGeolobTag::setDegreesPerPixelLon ( const ossim_float64 deltaLon)

Sets the ARV field from decimal degrees per pixel longitude.

deltaLon

Definition at line 107 of file ossimNitfGeolobTag.cpp.

References setArv().

Referenced by ossimNitfWriterBase::addGeolobTag().

108 {
109  if ( deltaLon > 0.0 )
110  {
111  ossim_uint32 pixels = (ossim_uint32)((1.0/deltaLon)*360.0 + .5);
112  setArv(pixels);
113  }
114 }
unsigned int ossim_uint32
void setArv(ossim_uint32 arv)
Sets the ARV field.

◆ setLso()

void ossimNitfGeolobTag::setLso ( const ossim_float64 lso)

Sets the LSO field(Longitude Origin).

Valid range: -180.0 to +180.0 lso

Definition at line 182 of file ossimNitfGeolobTag.cpp.

References LSO_SIZE, and m_tagData.

Referenced by ossimNitfWriterBase::addGeolobTag().

183 {
184  if ( (lso >= -180.0) && (lso <= 180.0) )
185  {
187  s.precision(10);
188  s.fill('0');
189  s << std::left << std::showpos << std::fixed
190  << std::setw(ossimNitfGeolobTag::LSO_SIZE) << lso;
191 
192  m_tagData.replace( 18, ossimNitfGeolobTag::LSO_SIZE, s.str() );
193  }
194 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35

◆ setPso()

void ossimNitfGeolobTag::setPso ( const ossim_float64 pso)

Sets the PSO field(Latitude Origin).

Valid range: -90.0 to +90.0 pso

Definition at line 213 of file ossimNitfGeolobTag.cpp.

References m_tagData, and PSO_SIZE.

Referenced by ossimNitfWriterBase::addGeolobTag().

214 {
215  if ( (pso >= -180.0) && (pso <= 180.0) )
216  {
218  s.precision(10);
219  s.fill('0');
220  s << std::left << std::showpos << std::fixed
221  << std::setw(ossimNitfGeolobTag::PSO_SIZE) << pso;
222 
223  m_tagData.replace( 33, ossimNitfGeolobTag::PSO_SIZE, s.str() );
224  }
225 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35

◆ writeStream()

void ossimNitfGeolobTag::writeStream ( ossim::ostream out)
virtual

Write method.

Parameters
outStream to write to.

Implements ossimNitfRegisteredTag.

Definition at line 45 of file ossimNitfGeolobTag.cpp.

References m_tagData, and TAG_SIZE.

Member Data Documentation

◆ m_tagData

std::string ossimNitfGeolobTag::m_tagData
protected

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