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

#include <ossimMapProjectionInfo.h>

Inheritance diagram for ossimMapProjectionInfo:
ossimObject ossimReferenced

Public Member Functions

 ossimMapProjectionInfo (const ossimMapProjection *proj, const ossimDrect &output_rect)
 
virtual ~ossimMapProjectionInfo ()
 
bool errorStatus () const
 Returns true on error false if ok. More...
 
void getGeom (ossimKeywordlist &kwl, const char *prefix=0) const
 Adds tie point to keyword list. More...
 
ossimDpt getMetersPerPixel () const
 Returns the pixel size in meters. More...
 
ossimDpt getUsSurveyFeetPerPixel () const
 Returns the pixel size in U.S. More...
 
ossimDpt getDecimalDegreesPerPixel () const
 Returns the decimal degrees per pixel. More...
 
ossimDpt ulEastingNorthingPt () const
 Returns the upper left easting and northing as a ossimDpt. More...
 
ossimDpt urEastingNorthingPt () const
 Returns the upper right easting and northing as a ossimDpt. More...
 
ossimDpt lrEastingNorthingPt () const
 Returns the lower right easting and northing as a ossimDpt. More...
 
ossimDpt llEastingNorthingPt () const
 Returns the lower left easting and northing as a ossimDpt. More...
 
ossimDpt ulEastingNorthingPtInFt () const
 Returns the upper left easting and northing as a ossimDpt. More...
 
ossimDpt urEastingNorthingPtInFt () const
 Returns the upper right easting and northing as a ossimDpt. More...
 
ossimDpt lrEastingNorthingPtInFt () const
 Returns the lower right easting and northing as a ossimDpt. More...
 
ossimDpt llEastingNorthingPtInFt () const
 Returns the lower left easting and northing as a ossimDpt. More...
 
ossimGpt ulGroundPt () const
 Returns the upper left ground point. More...
 
ossimGpt urGroundPt () const
 Returns the upper right ground point. More...
 
ossimGpt lrGroundPt () const
 Returns the lower right ground point. More...
 
ossimGpt llGroundPt () const
 Returns the lower left ground point. More...
 
ossimGpt centerGroundPt () const
 Returns the center ground point. More...
 
ossimDpt centerEastingNorthingPt () const
 
ossim_int32 linesPerImage () const
 
ossim_int32 pixelsPerLine () const
 
std::ostream & print (std::ostream &os) const
 Formatted print of data members. More...
 
void setPixelType (ossimPixelType type)
 Sets the data member "thePixelType". More...
 
ossimPixelType getPixelType () const
 Returns data member "thePixelType". More...
 
void setOutputFeetFlag (bool flag)
 Sets the data member "theOutputInfoInFeetFlag". More...
 
bool unitsInFeet () const
 Returns the data member "theOutputInfoInFeetFlag". More...
 
ossimString getImageInfoString () const
 Returns theImageInfoString. More...
 
void setImageInfoString (const ossimString &string)
 Used to set data member "theImageInfoString". More...
 
const ossimMapProjectiongetProjection () const
 Returns reference to "theProjection". More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) 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 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
 

Static Public Attributes

static const char * README_IMAGE_STRING_KW
 
static const char * PIXEL_TYPE_KW = "viewinfo.pixel_type"
 
static const char * OUTPUT_US_FT_INFO_KW
 

Private Member Functions

 ossimMapProjectionInfo ()
 
ossimMapProjectionInfooperator= (const ossimMapProjectionInfo &)
 
void initializeMembers (const ossimDrect &output_rect)
 

Private Attributes

const ossimMapProjectiontheProjection
 
bool theErrorStatus
 
int theLinesPerImage
 
int thePixelsPerLine
 
ossimGpt theCornerGroundPt [4]
 
ossimDpt theCornerEastingNorthingPt [4]
 
ossimGpt theCenterGroundPt
 
ossimDpt theCenterEastingNorthingPt
 
ossimDrect theBoundingRect
 
ossimPixelType thePixelType
 "thePixelType" defines whether the tie point coordinates are relative to the center of the pixel(which is PIXEL_IS_POINT) or the upper left corner of the pixel(PIXEL_IS_AREA). More...
 
bool theOutputInfoInFeetFlag
 If "theOutputInfoInFeetFlag" is true the readme file tie point info will be output in both meters and U.S. More...
 
ossimString theImageInfoString
 "theImageInfoString" goes in the README file "Image:" field to identify the image. More...
 

Additional Inherited Members

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

Detailed Description

Definition at line 34 of file ossimMapProjectionInfo.h.

Constructor & Destructor Documentation

◆ ossimMapProjectionInfo() [1/2]

ossimMapProjectionInfo::ossimMapProjectionInfo ( const ossimMapProjection proj,
const ossimDrect output_rect 
)

Definition at line 54 of file ossimMapProjectionInfo.cpp.

References initializeMembers(), ossimNotify(), ossimNotifyLevel_FATAL, theErrorStatus, and theProjection.

56  :
57  theProjection (proj),
58  theErrorStatus (false),
59  theLinesPerImage (0),
60  thePixelsPerLine (0),
64  theCenterEastingNorthingPt (0.0, 0.0),
68 {
69  if (!theProjection)
70  {
71  theErrorStatus = true;
73  << "FATAL ossimMapProjectionInfo::ossimMapProjectionInfo: "
74  << "Null projection pointer passed to constructor!"
75  << "\nError status has been set. Returning..."
76  << std::endl;
77  return;
78  }
79 
80  initializeMembers(output_rect);
81 
82  if (traceDebug())
83  {
85  << "DEBUG ossimMapProjectionInfo::ossimMapProjectionInfo:\n"
86  << "output_rect: " << output_rect << "\n"
87  << *this << std::endl;
88  }
89 }
const ossimMapProjection * theProjection
ossimString theImageInfoString
"theImageInfoString" goes in the README file "Image:" field to identify the image.
void initializeMembers(const ossimDrect &output_rect)
bool theOutputInfoInFeetFlag
If "theOutputInfoInFeetFlag" is true the readme file tie point info will be output in both meters and...
ossimPixelType thePixelType
"thePixelType" defines whether the tie point coordinates are relative to the center of the pixel(whic...
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ~ossimMapProjectionInfo()

ossimMapProjectionInfo::~ossimMapProjectionInfo ( )
virtual

Definition at line 91 of file ossimMapProjectionInfo.cpp.

92 {
93 }

◆ ossimMapProjectionInfo() [2/2]

ossimMapProjectionInfo::ossimMapProjectionInfo ( )
private

Member Function Documentation

◆ centerEastingNorthingPt()

ossimDpt ossimMapProjectionInfo::centerEastingNorthingPt ( ) const
Returns
The center ground point.

Definition at line 395 of file ossimMapProjectionInfo.cpp.

References theCenterEastingNorthingPt.

396 {
398 }

◆ centerGroundPt()

ossimGpt ossimMapProjectionInfo::centerGroundPt ( ) const

Returns the center ground point.

Definition at line 389 of file ossimMapProjectionInfo.cpp.

References theCenterGroundPt.

390 {
391  // Center is simply center, no shift for pixel is area...
392  return theCenterGroundPt;
393 }

◆ errorStatus()

bool ossimMapProjectionInfo::errorStatus ( ) const

Returns true on error false if ok.

Definition at line 95 of file ossimMapProjectionInfo.cpp.

References theErrorStatus.

96 {
97  return theErrorStatus;
98 }

◆ getDecimalDegreesPerPixel()

ossimDpt ossimMapProjectionInfo::getDecimalDegreesPerPixel ( ) const

Returns the decimal degrees per pixel.

x = sample direction y = line direction

Definition at line 544 of file ossimMapProjectionInfo.cpp.

References ossimMapProjection::getDecimalDegreesPerPixel(), and theProjection.

Referenced by llGroundPt(), lrGroundPt(), print(), ulGroundPt(), and urGroundPt().

545 {
547 }
virtual const ossimDpt & getDecimalDegreesPerPixel() const
Returns decimal degrees per pixel as an ossimDpt with "x" representing longitude and "y" representing...
const ossimMapProjection * theProjection

◆ getGeom()

void ossimMapProjectionInfo::getGeom ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const

Adds tie point to keyword list.

This will be latitude, longitude if projection is geographic; else, easting, northing.

Definition at line 145 of file ossimMapProjectionInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimUnitTypeLut::instance(), ossimMapProjection::isGeographic(), OSSIM_DEGREES, OSSIM_METERS, ossimMapProjection::saveState(), theProjection, ossimKeywordNames::TIE_POINT_UNITS_KW, ossimKeywordNames::TIE_POINT_XY_KW, ossimDpt::toString(), ulEastingNorthingPt(), and ulGroundPt().

Referenced by ossimERSFileWriter::writeFile(), and ossimEnviHeaderFileWriter::writeFile().

147 {
148  theProjection->saveState(kwl, prefix);
149 
151  {
152  ossimGpt gpt = ulGroundPt();
153  kwl.add(prefix,
155  ossimDpt(gpt).toString().c_str(),
156  true);
157  kwl.add(prefix,
159  ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
160  true);
161  }
162  else
163  {
165  kwl.add(prefix,
167  dpt.toString().c_str(),
168  true);
169  kwl.add(prefix,
171  ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS),
172  true);
173  }
174 }
virtual bool isGeographic() const
const ossimMapProjection * theProjection
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static const char * TIE_POINT_XY_KW
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossimGpt ulGroundPt() const
Returns the upper left ground point.
ossimDpt ulEastingNorthingPt() const
Returns the upper left easting and northing as a ossimDpt.
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimDpt.cpp:160
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.
static const char * TIE_POINT_UNITS_KW

◆ getImageInfoString()

ossimString ossimMapProjectionInfo::getImageInfoString ( ) const

Returns theImageInfoString.

Definition at line 246 of file ossimMapProjectionInfo.cpp.

References theImageInfoString.

247 {
248  return theImageInfoString;
249 }
ossimString theImageInfoString
"theImageInfoString" goes in the README file "Image:" field to identify the image.

◆ getMetersPerPixel()

ossimDpt ossimMapProjectionInfo::getMetersPerPixel ( ) const

Returns the pixel size in meters.

x = sample direction y = line direction

Definition at line 529 of file ossimMapProjectionInfo.cpp.

References ossimMapProjection::getMetersPerPixel(), and theProjection.

Referenced by getUsSurveyFeetPerPixel(), llEastingNorthingPt(), lrEastingNorthingPt(), print(), ulEastingNorthingPt(), and urEastingNorthingPt().

530 {
532 }
const ossimMapProjection * theProjection
virtual ossimDpt getMetersPerPixel() const

◆ getPixelType()

ossimPixelType ossimMapProjectionInfo::getPixelType ( ) const

Returns data member "thePixelType".

NOTE: OSSIM_PIXEL_IS_POINT (ennumerated to a "0"): Corner coordinates are relative to the center of pixel. OSSIM_PIXEL_IS_AREA (ennumerated to a "1"): Corner coordinates are relative to the outer of the pixel.

Definition at line 231 of file ossimMapProjectionInfo.cpp.

References thePixelType.

Referenced by ossimNitfWriterBase::addBlockaTag(), llEastingNorthingPt(), llGroundPt(), lrEastingNorthingPt(), lrGroundPt(), print(), ulEastingNorthingPt(), ulGroundPt(), urEastingNorthingPt(), and urGroundPt().

232 {
233  return thePixelType;
234 }
ossimPixelType thePixelType
"thePixelType" defines whether the tie point coordinates are relative to the center of the pixel(whic...

◆ getProjection()

const ossimMapProjection * ossimMapProjectionInfo::getProjection ( ) const

Returns reference to "theProjection".

Definition at line 256 of file ossimMapProjectionInfo.cpp.

References theProjection.

Referenced by ossimGeoTiff::writeTags().

257 {
258  return theProjection;
259 }
const ossimMapProjection * theProjection

◆ getUsSurveyFeetPerPixel()

ossimDpt ossimMapProjectionInfo::getUsSurveyFeetPerPixel ( ) const

Returns the pixel size in U.S.

Survey feet. x = sample direction y = line direction

NOTE: The US survey feet per meter converion (0.3048006096 feet per meter) is NOT the same as the standard feet per meter conversion (0.3048 feet per meter).

Definition at line 534 of file ossimMapProjectionInfo.cpp.

References getMetersPerPixel(), ossim::mtrs2usft(), ossimDpt::x, and ossimDpt::y.

Referenced by print().

535 {
537 
538  pt.x = ossim::mtrs2usft(pt.x);
539  pt.y = ossim::mtrs2usft(pt.y);
540 
541  return pt;
542 }
double y
Definition: ossimDpt.h:165
ossimDpt getMetersPerPixel() const
Returns the pixel size in meters.
double x
Definition: ossimDpt.h:164
double mtrs2usft(double meters)
Definition: ossimCommon.h:375

◆ initializeMembers()

void ossimMapProjectionInfo::initializeMembers ( const ossimDrect output_rect)
private

Definition at line 100 of file ossimMapProjectionInfo.cpp.

References ossimDrect::height(), ossimMapProjection::inverse(), ossimMapProjection::lineSampleToEastingNorthing(), ossimMapProjection::lineSampleToWorld(), ossimDrect::ll(), ossimDrect::lr(), theBoundingRect, theCenterEastingNorthingPt, theCenterGroundPt, theCornerEastingNorthingPt, theCornerGroundPt, theLinesPerImage, thePixelsPerLine, theProjection, ossimDrect::ul(), ossimDrect::ur(), ossimDrect::width(), ossimDpt::x, and ossimDpt::y.

Referenced by ossimMapProjectionInfo().

101 {
102  theBoundingRect = rect;
103  theLinesPerImage = ossim::round<int>(rect.height());
104  thePixelsPerLine = ossim::round<int>(rect.width());
105 
106  theProjection->lineSampleToWorld(rect.ul(),
107  theCornerGroundPt[0]);
108 
109  theProjection->lineSampleToWorld(rect.ur(),
110  theCornerGroundPt[1]);
111 
112  theProjection->lineSampleToWorld(rect.lr(),
113  theCornerGroundPt[2]);
114 
115 
116  theProjection->lineSampleToWorld(rect.ll(),
117  theCornerGroundPt[3]);
118 
121 
124 
127 
130 
134  theCornerEastingNorthingPt[3].x) / 4.0;
135 
139  theCornerEastingNorthingPt[3].y) / 4.0;
140 
142 }
double y
Definition: ossimDpt.h:165
const ossimMapProjection * theProjection
virtual ossimGpt inverse(const ossimDpt &projectedPoint) const =0
Will take a point in meters and convert it to ground.
virtual ossimGpt lineSampleToWorld(const ossimDpt &projectedPoint) const
virtual void lineSampleToEastingNorthing(const ossimDpt &liineSample, ossimDpt &eastingNorthing) const
double x
Definition: ossimDpt.h:164

◆ linesPerImage()

ossim_int32 ossimMapProjectionInfo::linesPerImage ( ) const
Returns
The lines per image.

Definition at line 400 of file ossimMapProjectionInfo.cpp.

References theLinesPerImage.

Referenced by ossimNitfWriterBase::addBlockaTag().

401 {
402  return theLinesPerImage;
403 }

◆ llEastingNorthingPt()

ossimDpt ossimMapProjectionInfo::llEastingNorthingPt ( ) const

Returns the lower left easting and northing as a ossimDpt.

The easting is "u" and the northing is "v". Units are in meters.

Definition at line 309 of file ossimMapProjectionInfo.cpp.

References getMetersPerPixel(), getPixelType(), OSSIM_PIXEL_IS_AREA, theCornerEastingNorthingPt, ossimDpt::x, and ossimDpt::y.

Referenced by llEastingNorthingPtInFt(), and ossimNitfWriterBase::writeGeometry().

310 {
312  {
313  ossimDpt mpp = getMetersPerPixel();
314  ossimDpt pt;
315  pt.x = theCornerEastingNorthingPt[3].x - (mpp.x / 2.0);
316  pt.y = theCornerEastingNorthingPt[3].y - (mpp.y / 2.0);
317  return pt;
318  }
319  else
320  {
321  return theCornerEastingNorthingPt[3];
322  }
323 }
double y
Definition: ossimDpt.h:165
ossimPixelType getPixelType() const
Returns data member "thePixelType".
ossimDpt getMetersPerPixel() const
Returns the pixel size in meters.
double x
Definition: ossimDpt.h:164

◆ llEastingNorthingPtInFt()

ossimDpt ossimMapProjectionInfo::llEastingNorthingPtInFt ( ) const

Returns the lower left easting and northing as a ossimDpt.

The easting is "u" and the northing is "v". Units are in U.S. Survey feet.

Definition at line 521 of file ossimMapProjectionInfo.cpp.

References llEastingNorthingPt(), ossim::mtrs2usft(), ossimDpt::x, and ossimDpt::y.

522 {
524  pt.x = ossim::mtrs2usft(pt.x);
525  pt.y = ossim::mtrs2usft(pt.y);
526  return pt;
527 }
double y
Definition: ossimDpt.h:165
ossimDpt llEastingNorthingPt() const
Returns the lower left easting and northing as a ossimDpt.
double x
Definition: ossimDpt.h:164
double mtrs2usft(double meters)
Definition: ossimCommon.h:375

◆ llGroundPt()

ossimGpt ossimMapProjectionInfo::llGroundPt ( ) const

Returns the lower left ground point.

Definition at line 373 of file ossimMapProjectionInfo.cpp.

References getDecimalDegreesPerPixel(), getPixelType(), ossimGpt::latd(), ossimGpt::lond(), OSSIM_PIXEL_IS_AREA, theCornerGroundPt, ossimDpt::x, and ossimDpt::y.

Referenced by ossimNitfWriterBase::addBlockaTag(), and ossimNitfWriterBase::writeGeometry().

374 {
376  {
378  ossimGpt gpt;
379  gpt.latd(theCornerGroundPt[3].latd() - (ddpp.y / 2.0));
380  gpt.lond(theCornerGroundPt[3].lond() - (ddpp.x / 2.0));
381  return gpt;
382  }
383  else
384  {
385  return theCornerGroundPt[3];
386  }
387 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double y
Definition: ossimDpt.h:165
ossimDpt getDecimalDegreesPerPixel() const
Returns the decimal degrees per pixel.
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
ossimPixelType getPixelType() const
Returns data member "thePixelType".
double x
Definition: ossimDpt.h:164

◆ loadState()

bool ossimMapProjectionInfo::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of the object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimObject.

Definition at line 410 of file ossimMapProjectionInfo.cpp.

References ossimString::contains(), ossimString::downcase(), ossimKeywordlist::find(), OSSIM_PIXEL_IS_AREA, OSSIM_PIXEL_IS_POINT, OUTPUT_US_FT_INFO_KW, ossimKeywordNames::PIXEL_TYPE_KW, README_IMAGE_STRING_KW, theImageInfoString, theOutputInfoInFeetFlag, and thePixelType.

412 {
413  const char* lookupReturn = kwl.find(README_IMAGE_STRING_KW);
414 
415  //***
416  // "theImageInfoString" goes in the README file "Image:" field and can
417  // be used to identify the image.
418  //***
419  if (lookupReturn) theImageInfoString = lookupReturn;
420 
421  lookupReturn = kwl.find(ossimKeywordNames::PIXEL_TYPE_KW);
422 
423  if (lookupReturn)
424  {
425  ossimString tmp = lookupReturn;
426 
427  tmp.downcase();
428 
429  if (tmp.contains("area"))
430  {
432  }
433  else
434  {
436  }
437  }
438 
439  lookupReturn = kwl.find(OUTPUT_US_FT_INFO_KW);
440 
441  if (lookupReturn)
442  {
443  int tmp = atoi(lookupReturn);
444 
445  if (tmp)
446  {
448  }
449  else
450  {
451  theOutputInfoInFeetFlag = false;
452  }
453  }
454 
455  if (traceDebug())
456  {
458  << "DEBUG ossimMapProjectionInfo::loadState:"
459  << "\ntheImageInfoString: " << theImageInfoString
460  << "\nthePixelType: " << int(thePixelType)
461  << "\ntheOutputInfoInFeetFlag: " << theOutputInfoInFeetFlag
462  << endl;
463  }
464 
465  return true;
466 }
const char * find(const char *key) const
bool contains(char aChar) const
Definition: ossimString.h:58
static const char * README_IMAGE_STRING_KW
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString theImageInfoString
"theImageInfoString" goes in the README file "Image:" field to identify the image.
static const char * PIXEL_TYPE_KW
bool theOutputInfoInFeetFlag
If "theOutputInfoInFeetFlag" is true the readme file tie point info will be output in both meters and...
ossimPixelType thePixelType
"thePixelType" defines whether the tie point coordinates are relative to the center of the pixel(whic...
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
static const char * OUTPUT_US_FT_INFO_KW

◆ lrEastingNorthingPt()

ossimDpt ossimMapProjectionInfo::lrEastingNorthingPt ( ) const

Returns the lower right easting and northing as a ossimDpt.

The easting is "u" and the northing is "v". Units are in meters.

Definition at line 293 of file ossimMapProjectionInfo.cpp.

References getMetersPerPixel(), getPixelType(), OSSIM_PIXEL_IS_AREA, theCornerEastingNorthingPt, ossimDpt::x, and ossimDpt::y.

Referenced by lrEastingNorthingPtInFt(), and ossimNitfWriterBase::writeGeometry().

294 {
296  {
297  ossimDpt mpp = getMetersPerPixel();
298  ossimDpt pt;
299  pt.x = theCornerEastingNorthingPt[2].x + (mpp.x / 2.0);
300  pt.y = theCornerEastingNorthingPt[2].y - (mpp.y / 2.0);
301  return pt;
302  }
303  else
304  {
305  return theCornerEastingNorthingPt[2];
306  }
307 }
double y
Definition: ossimDpt.h:165
ossimPixelType getPixelType() const
Returns data member "thePixelType".
ossimDpt getMetersPerPixel() const
Returns the pixel size in meters.
double x
Definition: ossimDpt.h:164

◆ lrEastingNorthingPtInFt()

ossimDpt ossimMapProjectionInfo::lrEastingNorthingPtInFt ( ) const

Returns the lower right easting and northing as a ossimDpt.

The easting is "u" and the northing is "v". Units are in U.S. Survey feet.

Definition at line 513 of file ossimMapProjectionInfo.cpp.

References lrEastingNorthingPt(), ossim::mtrs2usft(), ossimDpt::x, and ossimDpt::y.

514 {
516  pt.x = ossim::mtrs2usft(pt.x);
517  pt.y = ossim::mtrs2usft(pt.y);
518  return pt;
519 }
double y
Definition: ossimDpt.h:165
ossimDpt lrEastingNorthingPt() const
Returns the lower right easting and northing as a ossimDpt.
double x
Definition: ossimDpt.h:164
double mtrs2usft(double meters)
Definition: ossimCommon.h:375

◆ lrGroundPt()

ossimGpt ossimMapProjectionInfo::lrGroundPt ( ) const

Returns the lower right ground point.

Definition at line 357 of file ossimMapProjectionInfo.cpp.

References getDecimalDegreesPerPixel(), getPixelType(), ossimGpt::latd(), ossimGpt::lond(), OSSIM_PIXEL_IS_AREA, theCornerGroundPt, ossimDpt::x, and ossimDpt::y.

Referenced by ossimNitfWriterBase::addBlockaTag(), and ossimNitfWriterBase::writeGeometry().

358 {
360  {
362  ossimGpt gpt;
363  gpt.latd(theCornerGroundPt[2].latd() - (ddpp.y / 2.0));
364  gpt.lond(theCornerGroundPt[2].lond() + (ddpp.x / 2.0));
365  return gpt;
366  }
367  else
368  {
369  return theCornerGroundPt[2];
370  }
371 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double y
Definition: ossimDpt.h:165
ossimDpt getDecimalDegreesPerPixel() const
Returns the decimal degrees per pixel.
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
ossimPixelType getPixelType() const
Returns data member "thePixelType".
double x
Definition: ossimDpt.h:164

◆ operator=()

ossimMapProjectionInfo& ossimMapProjectionInfo::operator= ( const ossimMapProjectionInfo )
private

◆ pixelsPerLine()

ossim_int32 ossimMapProjectionInfo::pixelsPerLine ( ) const
Returns
The pixels per line (samples).

Definition at line 405 of file ossimMapProjectionInfo.cpp.

References thePixelsPerLine.

406 {
407  return thePixelsPerLine;
408 }

◆ print()

std::ostream & ossimMapProjectionInfo::print ( std::ostream &  os) const
virtual

Formatted print of data members.

Used by operator <<.

Reimplemented from ossimObject.

Definition at line 176 of file ossimMapProjectionInfo.cpp.

References getDecimalDegreesPerPixel(), getMetersPerPixel(), getPixelType(), ossimMapProjection::getProjectionName(), getUsSurveyFeetPerPixel(), OSSIM_PIXEL_IS_POINT, ossimMapProjection::print(), theCenterEastingNorthingPt, theCenterGroundPt, theCornerEastingNorthingPt, theCornerGroundPt, theLinesPerImage, thePixelsPerLine, and theProjection.

177 {
178  if (!os)
179  {
180  return os;
181  }
182 
183  os << setiosflags(ios::left)
184  << setiosflags(ios::fixed)
185  << "ossimMapProjectionInfo Data Members:\n"
186  << "Projection name: " << theProjection->getProjectionName()
187  << setw(30) << "\nOutput pixel type:"
188  << ((getPixelType() == OSSIM_PIXEL_IS_POINT) ? "pixel is point" :
189  "pixel is area")
190  << setw(30) << "\nMeters per pixel:"
191  << getMetersPerPixel()
192  << setw(30) << "\nUS survey feet per pixel:"
194  << setw(30) << "\nDecimal degrees per pixel:"
196  << setw(30) << "\nNumber of lines:"
198  << setw(30) << "\nNumber of pixels:"
200  << setw(30) << "\nUpper left ground point:"
201  << theCornerGroundPt[0]
202  << setw(30) << "\nUpper right ground point:"
203  << theCornerGroundPt[1]
204  << setw(30) << "\nLower right ground point:"
205  << theCornerGroundPt[2]
206  << setw(30) << "\nLower left ground point:"
207  << theCornerGroundPt[3]
208  << setw(30) << "\nUpper left easting_northing:"
210  << setw(30) << "\nUpper right easting_northing:"
212  << setw(30) << "\nLower right easting_northing:"
214  << setw(30) << "\nLower left easting_northing:"
216  << setw(30) << "\nCenter ground point:"
218  << setw(30) << "\nCenter easting_northing:"
220  << "\nMap Projection dump:";
221  theProjection->print(os);
222 
223  return os;
224 }
ossimDpt getUsSurveyFeetPerPixel() const
Returns the pixel size in U.S.
ossimDpt getDecimalDegreesPerPixel() const
Returns the decimal degrees per pixel.
const ossimMapProjection * theProjection
ossimPixelType getPixelType() const
Returns data member "thePixelType".
virtual ossimString getProjectionName() const
Returns the projection name.
ossimDpt getMetersPerPixel() const
Returns the pixel size in meters.
virtual std::ostream & print(std::ostream &out) const
Prints data members to stream.

◆ saveState()

bool ossimMapProjectionInfo::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of the object to a keyword list. Return true if ok or false on error.

Reimplemented from ossimObject.

Definition at line 468 of file ossimMapProjectionInfo.cpp.

References ossimKeywordlist::add(), ossimString::chars(), OSSIM_PIXEL_IS_POINT, OUTPUT_US_FT_INFO_KW, PIXEL_TYPE_KW, README_IMAGE_STRING_KW, theImageInfoString, theOutputInfoInFeetFlag, and thePixelType.

470 {
473 
474  ossimString tmp;
475 
477  {
478  tmp = "point";
479  }
480  else
481  {
482  tmp = "area";
483  }
484 
485  kwl.add(PIXEL_TYPE_KW,
486  tmp.chars());
487 
490 
491  return true;
492 }
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static const char * README_IMAGE_STRING_KW
const char * chars() const
For backward compatibility.
Definition: ossimString.h:77
ossimString theImageInfoString
"theImageInfoString" goes in the README file "Image:" field to identify the image.
static const char * PIXEL_TYPE_KW
bool theOutputInfoInFeetFlag
If "theOutputInfoInFeetFlag" is true the readme file tie point info will be output in both meters and...
ossimPixelType thePixelType
"thePixelType" defines whether the tie point coordinates are relative to the center of the pixel(whic...
static const char * OUTPUT_US_FT_INFO_KW

◆ setImageInfoString()

void ossimMapProjectionInfo::setImageInfoString ( const ossimString string)

Used to set data member "theImageInfoString".

This will be output in the "Image: " field of the README file.

Definition at line 251 of file ossimMapProjectionInfo.cpp.

References theImageInfoString.

252 {
253  theImageInfoString = string;
254 }
ossimString theImageInfoString
"theImageInfoString" goes in the README file "Image:" field to identify the image.

◆ setOutputFeetFlag()

void ossimMapProjectionInfo::setOutputFeetFlag ( bool  flag)

Sets the data member "theOutputInfoInFeetFlag".

Definition at line 236 of file ossimMapProjectionInfo.cpp.

References theOutputInfoInFeetFlag.

237 {
239 }
bool theOutputInfoInFeetFlag
If "theOutputInfoInFeetFlag" is true the readme file tie point info will be output in both meters and...

◆ setPixelType()

void ossimMapProjectionInfo::setPixelType ( ossimPixelType  type)

Sets the data member "thePixelType".

NOTE: PIXEL_IS_POINT (ennumerated to a "0"): Corner coordinates are relative to the center of pixel. PIXEL_IS_AREA (ennumerated to a "1"): Corner coordinates are relative to the outer edge of the pixel.

Definition at line 226 of file ossimMapProjectionInfo.cpp.

References thePixelType.

Referenced by ossimNitfWriterBase::addBlockaTag(), ossimNitfWriterBase::writeGeometry(), and ossimGeoTiff::writeJp2GeotiffBox().

227 {
228  thePixelType = type;
229 }
ossimPixelType thePixelType
"thePixelType" defines whether the tie point coordinates are relative to the center of the pixel(whic...

◆ ulEastingNorthingPt()

ossimDpt ossimMapProjectionInfo::ulEastingNorthingPt ( ) const

Returns the upper left easting and northing as a ossimDpt.

The easting is "u" and the northing is "v". Units are in meters.

Definition at line 261 of file ossimMapProjectionInfo.cpp.

References getMetersPerPixel(), getPixelType(), OSSIM_PIXEL_IS_AREA, theCornerEastingNorthingPt, ossimDpt::x, and ossimDpt::y.

Referenced by getGeom(), ulEastingNorthingPtInFt(), and ossimNitfWriterBase::writeGeometry().

262 {
264  {
265  ossimDpt mpp = getMetersPerPixel();
266  ossimDpt pt;
267  pt.x = theCornerEastingNorthingPt[0].x - (mpp.x / 2.0);
268  pt.y = theCornerEastingNorthingPt[0].y + (mpp.y / 2.0);
269  return pt;
270  }
271  else
272  {
273  return theCornerEastingNorthingPt[0];
274  }
275 }
double y
Definition: ossimDpt.h:165
ossimPixelType getPixelType() const
Returns data member "thePixelType".
ossimDpt getMetersPerPixel() const
Returns the pixel size in meters.
double x
Definition: ossimDpt.h:164

◆ ulEastingNorthingPtInFt()

ossimDpt ossimMapProjectionInfo::ulEastingNorthingPtInFt ( ) const

Returns the upper left easting and northing as a ossimDpt.

The easting is "u" and the northing is "v". Units are in U.S. Survey feet.

Definition at line 494 of file ossimMapProjectionInfo.cpp.

References ossim::mtrs2usft(), ulEastingNorthingPt(), ossimDpt::x, and ossimDpt::y.

495 {
497 
498  pt.x = ossim::mtrs2usft(pt.x);
499 
500  pt.y = ossim::mtrs2usft(pt.y);
501 
502  return pt;
503 }
double y
Definition: ossimDpt.h:165
ossimDpt ulEastingNorthingPt() const
Returns the upper left easting and northing as a ossimDpt.
double x
Definition: ossimDpt.h:164
double mtrs2usft(double meters)
Definition: ossimCommon.h:375

◆ ulGroundPt()

ossimGpt ossimMapProjectionInfo::ulGroundPt ( ) const

Returns the upper left ground point.

Definition at line 325 of file ossimMapProjectionInfo.cpp.

References getDecimalDegreesPerPixel(), getPixelType(), ossimGpt::latd(), ossimGpt::lond(), OSSIM_PIXEL_IS_AREA, theCornerGroundPt, ossimDpt::x, and ossimDpt::y.

Referenced by ossimNitfWriterBase::addBlockaTag(), getGeom(), and ossimNitfWriterBase::writeGeometry().

326 {
328  {
330  ossimGpt gpt;
331  gpt.latd(theCornerGroundPt[0].latd() + (ddpp.y / 2.0));
332  gpt.lond(theCornerGroundPt[0].lond() - (ddpp.x / 2.0));
333  return gpt;
334  }
335  else
336  {
337  return theCornerGroundPt[0];
338  }
339 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double y
Definition: ossimDpt.h:165
ossimDpt getDecimalDegreesPerPixel() const
Returns the decimal degrees per pixel.
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
ossimPixelType getPixelType() const
Returns data member "thePixelType".
double x
Definition: ossimDpt.h:164

◆ unitsInFeet()

bool ossimMapProjectionInfo::unitsInFeet ( ) const

Returns the data member "theOutputInfoInFeetFlag".

True = feet, false = meters.

Definition at line 241 of file ossimMapProjectionInfo.cpp.

References theOutputInfoInFeetFlag.

242 {
244 }
bool theOutputInfoInFeetFlag
If "theOutputInfoInFeetFlag" is true the readme file tie point info will be output in both meters and...

◆ urEastingNorthingPt()

ossimDpt ossimMapProjectionInfo::urEastingNorthingPt ( ) const

Returns the upper right easting and northing as a ossimDpt.

The easting is "u" and the northing is "v". Units are in meters.

Definition at line 277 of file ossimMapProjectionInfo.cpp.

References getMetersPerPixel(), getPixelType(), OSSIM_PIXEL_IS_AREA, theCornerEastingNorthingPt, ossimDpt::x, and ossimDpt::y.

Referenced by urEastingNorthingPtInFt(), and ossimNitfWriterBase::writeGeometry().

278 {
280  {
281  ossimDpt mpp = getMetersPerPixel();
282  ossimDpt pt;
283  pt.x = theCornerEastingNorthingPt[1].x + (mpp.x / 2.0);
284  pt.y = theCornerEastingNorthingPt[1].y + (mpp.y / 2.0);
285  return pt;
286  }
287  else
288  {
289  return theCornerEastingNorthingPt[1];
290  }
291 }
double y
Definition: ossimDpt.h:165
ossimPixelType getPixelType() const
Returns data member "thePixelType".
ossimDpt getMetersPerPixel() const
Returns the pixel size in meters.
double x
Definition: ossimDpt.h:164

◆ urEastingNorthingPtInFt()

ossimDpt ossimMapProjectionInfo::urEastingNorthingPtInFt ( ) const

Returns the upper right easting and northing as a ossimDpt.

The easting is "u" and the northing is "v". Units are in U.S. Survey feet.

Definition at line 505 of file ossimMapProjectionInfo.cpp.

References ossim::mtrs2usft(), urEastingNorthingPt(), ossimDpt::x, and ossimDpt::y.

506 {
508  pt.x = ossim::mtrs2usft(pt.x);
509  pt.y = ossim::mtrs2usft(pt.y);
510  return pt;
511 }
double y
Definition: ossimDpt.h:165
ossimDpt urEastingNorthingPt() const
Returns the upper right easting and northing as a ossimDpt.
double x
Definition: ossimDpt.h:164
double mtrs2usft(double meters)
Definition: ossimCommon.h:375

◆ urGroundPt()

ossimGpt ossimMapProjectionInfo::urGroundPt ( ) const

Returns the upper right ground point.

Definition at line 341 of file ossimMapProjectionInfo.cpp.

References getDecimalDegreesPerPixel(), getPixelType(), ossimGpt::latd(), ossimGpt::lond(), OSSIM_PIXEL_IS_AREA, theCornerGroundPt, ossimDpt::x, and ossimDpt::y.

Referenced by ossimNitfWriterBase::addBlockaTag(), and ossimNitfWriterBase::writeGeometry().

342 {
344  {
346  ossimGpt gpt;
347  gpt.latd(theCornerGroundPt[1].latd() + (ddpp.y / 2.0));
348  gpt.lond(theCornerGroundPt[1].lond() + (ddpp.x / 2.0));
349  return gpt;
350  }
351  else
352  {
353  return theCornerGroundPt[1];
354  }
355 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double y
Definition: ossimDpt.h:165
ossimDpt getDecimalDegreesPerPixel() const
Returns the decimal degrees per pixel.
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
ossimPixelType getPixelType() const
Returns data member "thePixelType".
double x
Definition: ossimDpt.h:164

Member Data Documentation

◆ OUTPUT_US_FT_INFO_KW

const char * ossimMapProjectionInfo::OUTPUT_US_FT_INFO_KW
static
Initial value:
=
"viewinfo.output_readme_in_us_ft_flag"

Definition at line 223 of file ossimMapProjectionInfo.h.

Referenced by loadState(), and saveState().

◆ PIXEL_TYPE_KW

const char * ossimMapProjectionInfo::PIXEL_TYPE_KW = "viewinfo.pixel_type"
static

Definition at line 222 of file ossimMapProjectionInfo.h.

Referenced by saveState().

◆ README_IMAGE_STRING_KW

const char * ossimMapProjectionInfo::README_IMAGE_STRING_KW
static
Initial value:
=
"viewinfo.readme_image_string"

Definition at line 221 of file ossimMapProjectionInfo.h.

Referenced by loadState(), and saveState().

◆ theBoundingRect

ossimDrect ossimMapProjectionInfo::theBoundingRect
private

Definition at line 247 of file ossimMapProjectionInfo.h.

Referenced by initializeMembers().

◆ theCenterEastingNorthingPt

ossimDpt ossimMapProjectionInfo::theCenterEastingNorthingPt
private

Definition at line 246 of file ossimMapProjectionInfo.h.

Referenced by centerEastingNorthingPt(), initializeMembers(), and print().

◆ theCenterGroundPt

ossimGpt ossimMapProjectionInfo::theCenterGroundPt
private

Definition at line 245 of file ossimMapProjectionInfo.h.

Referenced by centerGroundPt(), initializeMembers(), and print().

◆ theCornerEastingNorthingPt

ossimDpt ossimMapProjectionInfo::theCornerEastingNorthingPt[4]
private

◆ theCornerGroundPt

ossimGpt ossimMapProjectionInfo::theCornerGroundPt[4]
private

◆ theErrorStatus

bool ossimMapProjectionInfo::theErrorStatus
mutableprivate

Definition at line 240 of file ossimMapProjectionInfo.h.

Referenced by errorStatus(), and ossimMapProjectionInfo().

◆ theImageInfoString

ossimString ossimMapProjectionInfo::theImageInfoString
private

"theImageInfoString" goes in the README file "Image:" field to identify the image.

Definition at line 273 of file ossimMapProjectionInfo.h.

Referenced by getImageInfoString(), loadState(), saveState(), and setImageInfoString().

◆ theLinesPerImage

int ossimMapProjectionInfo::theLinesPerImage
private

Definition at line 241 of file ossimMapProjectionInfo.h.

Referenced by initializeMembers(), linesPerImage(), and print().

◆ theOutputInfoInFeetFlag

bool ossimMapProjectionInfo::theOutputInfoInFeetFlag
private

If "theOutputInfoInFeetFlag" is true the readme file tie point info will be output in both meters and U.S.

feet. NOTE: U.S. feet conversion is "meters/0.3048006096" not the standard "meters/0.3048". Reference for U.S. feet value: U.S.G.S. "Map Projections - A Working Manual" USGS Professional paper 1395 page 51.

Definition at line 267 of file ossimMapProjectionInfo.h.

Referenced by loadState(), saveState(), setOutputFeetFlag(), and unitsInFeet().

◆ thePixelsPerLine

int ossimMapProjectionInfo::thePixelsPerLine
private

Definition at line 242 of file ossimMapProjectionInfo.h.

Referenced by initializeMembers(), pixelsPerLine(), and print().

◆ thePixelType

ossimPixelType ossimMapProjectionInfo::thePixelType
private

"thePixelType" defines whether the tie point coordinates are relative to the center of the pixel(which is PIXEL_IS_POINT) or the upper left corner of the pixel(PIXEL_IS_AREA).

The default pixle type is PIXEL_IS_POINT.

Definition at line 255 of file ossimMapProjectionInfo.h.

Referenced by getPixelType(), loadState(), saveState(), and setPixelType().

◆ theProjection

const ossimMapProjection* ossimMapProjectionInfo::theProjection
private

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