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
ossimInfo Class Reference

ossimInfo class. More...

#include <ossimInfo.h>

Inheritance diagram for ossimInfo:
ossimTool ossimObject ossim::JsonInterface ossimReferenced

Public Member Functions

 ossimInfo ()
 default constructor More...
 
virtual ~ossimInfo ()
 virtual destructor More...
 
virtual void setUsage (ossimArgumentParser &ap)
 Adds application arguments to the argument parser. More...
 
virtual bool initialize (ossimArgumentParser &ap)
 Initial method. More...
 
virtual bool execute ()
 execute method. More...
 
virtual ossimString getClassName () const
 
ossim_uint32 executeImageOptions (const ossimFilename &file)
 handles image options. More...
 
void getImageInfo (const ossimFilename &file, bool dumpFlag, bool dnoFlag, bool imageGeomFlag, bool imageInfoFlag, bool metaDataFlag, bool paletteFlag, ossimKeywordlist &kwl) const
 getImageInfo Method to open image "file" and get image info in the form of a ossimKeywordlist. More...
 
bool getImageInfo (const ossimFilename &file, ossim_uint32 entry, ossimKeywordlist &kwl) const
 getImageInfo Method to open image "file" and get image info for entry in the form of a ossimKeywordlist. More...
 
void openImage (const ossimFilename &file)
 Opens image handler and stores in m_img data member. More...
 
void openImageFromState (const ossimFilename &file)
 Opens image handler and stores in m_img data member. More...
 
void closeImage ()
 Closes image if open. More...
 
ossimRefPtr< ossimImageHandlergetImageHandler ()
 
void prettyPrint (const ossimFilename &file) const
 Dumps the image information from ossimInfoFactoryRegistry. More...
 
void dumpImage (const ossimFilename &file, bool dnoFlag, ossimKeywordlist &kwl) const
 Dumps the image information from ossimInfoFactoryRegistry to keyword list. More...
 
void printFactories (bool keywordListFlag) const
 Prints factories. More...
 
void getImageMetadata (ossimKeywordlist &kwl) const
 Populates keyword list with metadata. More...
 
void getImagePalette (ossimKeywordlist &kwl)
 Populates keyword list with palette data. More...
 
void getImageInfo (ossimKeywordlist &kwl, bool dnoFlag)
 Populates keyword list with general image information. More...
 
bool getImageInfo (ossim_uint32 entry, ossimKeywordlist &kwl, bool dnoFlag)
 Populates keyword list with general image information. More...
 
void getImageGeometryInfo (ossimKeywordlist &kwl, bool dnoFlag)
 Populates keyword list with image geometry/projection information. More...
 
bool getImageGeometryInfo (ossim_uint32 entry, ossimKeywordlist &kwl, bool dnoFlag)
 Populates keyword list with image geometry/projection information. More...
 
void getCenterImage (ossimKeywordlist &kwl)
 Populates keyword list with image center point. More...
 
void getImageBounds (ossimKeywordlist &kwl)
 Populates keyword list with edge to edge image bounds. More...
 
void getCenterGround (ossimKeywordlist &kwl)
 Populates keyword list with image center ground point. More...
 
void getImg2grd (ossimKeywordlist &kwl)
 Populates keyword list with ground point for image point. More...
 
void getGrd2img (ossimKeywordlist &kwl)
 Populates keyword list with image point for grund point. More...
 
void getUpIsUpAngle (ossimKeywordlist &kwl)
 Populates keyword list with up_is_up_angle. More...
 
void getUpIsUpAngle (ossim_uint32 entry, ossimKeywordlist &kwl)
 Populates keyword list with up_is_up_angle. More...
 
void getImageToGround (ossimKeywordlist &kwl)
 Populates keyword list with image_to_ground. More...
 
void getImageToGround (ossim_uint32 entry, ossimKeywordlist &kwl)
 Populates keyword list with image_to_ground. More...
 
void getNorthUpAngle (ossimKeywordlist &kwl)
 Populates keyword list with north_up_angle. More...
 
void getNorthUpAngle (ossim_uint32 entry, ossimKeywordlist &kwl)
 Populates keyword list with north_up_angle. More...
 
void getImageRect (ossimKeywordlist &kwl)
 Populates keyword list with image rectangle. More...
 
void getImageRect (ossim_uint32 entry, ossimKeywordlist &kwl)
 Populates keyword list with image rectangle. More...
 
bool isImageEntryOverview () const
 
void printConfiguration () const
 Dumps ossim preferences/configuration data. More...
 
std::ostream & printConfiguration (std::ostream &out) const
 Dumps ossim preferences/configuration data. More...
 
void printDatums () const
 Dumps datum list to stdout. More...
 
std::ostream & printDatums (std::ostream &out) const
 Dumps datum list to stream. More...
 
void printFonts () const
 Prints fonts list to stdout. More...
 
std::ostream & printFonts (std::ostream &out) const
 Prints fonts list to stream. More...
 
void deg2rad (const ossim_float64 &degrees) const
 Converts degrees to radians and outputs to stdout. More...
 
std::ostream & deg2rad (const ossim_float64 &degrees, std::ostream &out) const
 Converts degrees to radians and outputs to stream. More...
 
std::ostream & ecef2llh (const ossimEcefPoint &ecefPoint, std::ostream &out) const
 Converts ecef point to lat lon height. More...
 
void rad2deg (const ossim_float64 &radians) const
 Converts radians to degrees and outputs to stdout. More...
 
std::ostream & rad2deg (const ossim_float64 &radians, std::ostream &out) const
 Converts radians to degrees and outputs to stream. More...
 
void ft2mtrs (const ossim_float64 &feet, bool us_survey) const
 Converts feet to meters and outputs to stdout. More...
 
std::ostream & ft2mtrs (const ossim_float64 &feet, bool us_survey, std::ostream &out) const
 Converts feet to meters and outputs to stream. More...
 
void mtrs2ft (const ossim_float64 &meters, bool us_survey) const
 Converts meters to feet and outputs to stdout. More...
 
std::ostream & mtrs2ft (const ossim_float64 &meters, bool us_survey, std::ostream &out) const
 Converts meters to feet and outputs to stream. More...
 
void mtrsPerDeg (const ossim_float64 &latitude) const
 Get meters per degree for a given latitude and outputs to stdout. More...
 
std::ostream & mtrsPerDeg (const ossim_float64 &latitude, std::ostream &out) const
 Get meters per degree for a given latitude and outputs to stream. More...
 
void outputHeight (const ossimGpt &gpt) const
 Gets the height for ground point (latitude, longitude). More...
 
std::ostream & outputHeight (const ossimGpt &gpt, std::ostream &out) const
 Gets the height for ground point (latitude, longitude). More...
 
void printExtensions () const
 Prints supported image file extensions to stdout. More...
 
std::ostream & printExtensions (std::ostream &out) const
 Prints supported image file extensions to stream. More...
 
void printPlugins () const
 Prints loaded plugins to stdout. More...
 
std::ostream & printPlugins (std::ostream &out) const
 Prints loaded plugins to stream. More...
 
void testPlugin (const ossimFilename &plugin) const
 Test a plugin load and outputs to stdout. More...
 
std::ostream & testPlugin (const ossimFilename &plugin, std::ostream &out) const
 Test a plugin load outputs to stream. More...
 
void printOverviewTypes () const
 Prints overview types to stdout. More...
 
std::ostream & printOverviewTypes (std::ostream &out) const
 Prints overview types to stream. More...
 
void printProjections () const
 Prints projections to stdout. More...
 
std::ostream & printProjections (std::ostream &out) const
 Prints projections to stream. More...
 
void printReaderProps () const
 Prints reader properties to stdout. More...
 
std::ostream & printReaderProps (std::ostream &out) const
 Prints reader properties to stream. More...
 
void printResamplerFilters () const
 Prints resampler filters to stdout. More...
 
std::ostream & printResamplerFilters (std::ostream &out) const
 Prints resampler filters to stream. More...
 
void printWriters () const
 Prints list of available writers to stdout. More...
 
std::ostream & printWriters (std::ostream &out) const
 Prints list of available writers to stream. More...
 
void printWriterProps () const
 Prints writer properties to stdout. More...
 
std::ostream & printWriterProps (std::ostream &out) const
 Prints writer properties to stream. More...
 
void printZoomLevelGsds () const
 Prints zoom levels to stdout. More...
 
std::ostream & printZoomLevelGsds (std::ostream &out) const
 Prints zoom levels to stream. More...
 
void getRadiometry (ossimScalarType scalar, std::string &s) const
 Gets the radiometry string, i.e. More...
 
void getBuildDate (std::string &s) const
 Gets build date. More...
 
void getRevisionNumber (std::string &s) const
 Gets revision number. More...
 
void getVersion (std::string &s) const
 Gets version. More...
 
- Public Member Functions inherited from ossimTool
 ossimTool ()
 
virtual ~ossimTool ()
 
virtual void initialize (const ossimKeywordlist &kwl)
 Reads processing params from KWL and prepares for execute. More...
 
virtual void loadJSON (const Json::Value &json_request)
 Reads processing params from JSON object provided. More...
 
virtual void saveJSON (Json::Value &json) const
 Fetch product as JSON object when applicable Always returns true since using exception on error. More...
 
virtual const std::string & getResponse () const
 Fetch product as string (typically JSON) when applicable, otherwise passes back empty string. More...
 
virtual void clear ()
 Disconnects and clears the DEM and image layers. More...
 
virtual void abort ()
 Kills current (asynchronous) process. More...
 
virtual void getKwlTemplate (ossimKeywordlist &kwl)
 Assigns a template keywordlist to string for initializing derived classes. More...
 
void getAPI (std::string &out) const
 Outputs a JSON representation of the Utility's API. More...
 
std::string getAPI () const
 
void getBuildDate (std::string &s) const
 Gets build date. More...
 
void getRevision (std::string &s) const
 Gets revision. More...
 
void getVersion (std::string &s) const
 Gets version. More...
 
virtual bool isChipProcessor () const
 Overrides base class implementation to indicate this class supports getChip() calls. More...
 
void setOutputStream (std::ostream *os)
 Redirects any console output to the supplied stream for logging or JNI application. More...
 
bool helpRequested () const
 Returns true when the initialization detects a "--help" option, so caller can avoid subsequent execute() call. 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 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 ossim::JsonInterface
 JsonInterface ()
 
virtual ~JsonInterface ()
 

Static Public Attributes

static const char * DESCRIPTION
 Used by ossimUtilityFactory. More...
 

Private Member Functions

void getImageMetadata (const ossimImageHandler *ih, ossimKeywordlist &kwl) const
 Populates keyword list with metadata. More...
 
void getImagePalette (ossimImageHandler *ih, ossimKeywordlist &kwl) const
 Populates keyword list with palette data. More...
 
void getImageInfo (ossimImageHandler *ih, ossimKeywordlist &kwl, bool dnoFlag) const
 Populates keyword list with general image information. More...
 
bool getImageInfo (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl, bool dnoFlag) const
 Populates keyword list with general image information. More...
 
void getImageGeometryInfo (ossimImageHandler *ih, ossimKeywordlist &kwl, bool dnoFlag) const
 Populates keyword list with image geometry/projection information. More...
 
bool getImageGeometryInfo (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl, bool dnoFlag) const
 Populates keyword list with image geometry/projection information. More...
 
void getCenterImage (ossimImageHandler *ih, ossimKeywordlist &kwl) const
 
void getCenterImage (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
 
void getImageBounds (ossimImageHandler *ih, ossimKeywordlist &kwl) const
 
void getImageBounds (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
 
void getCenterGround (ossimImageHandler *ih, ossimKeywordlist &kwl) const
 
void getCenterGround (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
 
void getImg2grd (ossimImageHandler *ih, ossimKeywordlist &kwl) const
 Gets gound point from image point. More...
 
void getImg2grd (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
 Gets gound point from image point. More...
 
void getGrd2img (ossimImageHandler *ih, ossimKeywordlist &kwl) const
 Gets gound point from image point. More...
 
void getGrd2img (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
 Gets gound point from image point. More...
 
void getUpIsUpAngle (ossimImageHandler *ih, ossimKeywordlist &kwl) const
 Populates keyword list with up_is_up_angle. More...
 
void getUpIsUpAngle (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
 Populates keyword list with up_is_up_angle. More...
 
void getNorthUpAngle (ossimImageHandler *ih, ossimKeywordlist &kwl) const
 Populates keyword list with north_up_angle. More...
 
void getNorthUpAngle (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
 Populates keyword list with north_up_angle. More...
 
void getImageRect (ossimImageHandler *ih, ossimKeywordlist &kwl) const
 Populates keyword list with image rectangle. More...
 
void getImageRect (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
 Populates keyword list with image rectangle. More...
 
bool getRgbBands (ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
 Populates keyword list with rgb bands if available. More...
 
bool isImageEntryOverview (const ossimImageHandler *ih) const
 
void outputXml (const ossimKeywordlist &kwl) const
 Convert keyword list to xml then outputs to standard out. More...
 
void outputXml (const ossimKeywordlist &kwl, const ossimFilename &file) const
 Convert keyword list to xml then outputs to file. More...
 
ossimRefPtr< ossimImageHandleropenImageHandler (const ossimFilename &file) const
 Opens image. More...
 
bool keyIsTrue (const std::string &key) const
 

Private Attributes

ossimRefPtr< ossimImageHandlerm_img
 Holds the open image. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimTool
ossimKeywordlist m_kwl
 
std::ostream * m_consoleStream
 
bool m_helpRequested
 
std::string m_response
 

Detailed Description

ossimInfo class.

This is a utility class for getting information from the ossim library. This includes information from an image, general library queries, like loaded plugins, and just general stuff like height for point, conversions and so on that are easily obtained through the library.

Definition at line 36 of file ossimInfo.h.

Constructor & Destructor Documentation

◆ ossimInfo()

ossimInfo::ossimInfo ( )

default constructor

Definition at line 117 of file ossimInfo.cpp.

117  :
118  m_img(0)
119 {
120 }
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805

◆ ~ossimInfo()

ossimInfo::~ossimInfo ( )
virtual

virtual destructor

Definition at line 122 of file ossimInfo.cpp.

123 {
124 }

Member Function Documentation

◆ closeImage()

void ossimInfo::closeImage ( )

Closes image if open.

Definition at line 1664 of file ossimInfo.cpp.

References m_img.

1665 {
1666  m_img = 0;
1667 }
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805

◆ deg2rad() [1/2]

void ossimInfo::deg2rad ( const ossim_float64 degrees) const

Converts degrees to radians and outputs to stdout.

Definition at line 2818 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

2819 {
2821 }
void deg2rad(const ossim_float64 &degrees) const
Converts degrees to radians and outputs to stdout.
Definition: ossimInfo.cpp:2818
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ deg2rad() [2/2]

std::ostream & ossimInfo::deg2rad ( const ossim_float64 degrees,
std::ostream &  out 
) const

Converts degrees to radians and outputs to stream.

Parameters
outOutput to write to.
Returns
stream

Definition at line 2823 of file ossimInfo.cpp.

References RAD_PER_DEG.

2824 {
2825  double radians = degrees * RAD_PER_DEG;
2826 
2827  // Capture the original flags.
2828  std::ios_base::fmtflags f = out.flags();
2829 
2830  out << std::setiosflags(std::ios::fixed) << std::setprecision(15)
2831  << "\n" << degrees << " degrees = "
2832  << radians << " radians.\n" << std::endl;
2833 
2834  // Reset flags.
2835  out.setf(f);
2836 
2837  return out;
2838 }
#define RAD_PER_DEG

◆ dumpImage()

void ossimInfo::dumpImage ( const ossimFilename file,
bool  dnoFlag,
ossimKeywordlist kwl 
) const

Dumps the image information from ossimInfoFactoryRegistry to keyword list.

Parameters
fileImage to dump.
dnoFlagDump no overviews. If true do not dump overviews.
kwlInitialized by this method.

Definition at line 1702 of file ossimInfo.cpp.

References ossimString::c_str(), ossimInfoFactoryRegistry::create(), ossimInfoFactoryRegistry::instance(), ossimNotify(), and ossimNotifyLevel_INFO.

Referenced by getImageInfo().

1705 {
1706  std::shared_ptr<ossimInfoBase> info = ossimInfoFactoryRegistry::instance()->create(file);
1707  if (info)
1708  {
1709  if (dnoFlag) // Default info processes overviews.
1710  {
1711  info->setProcessOverviewFlag(false);
1712  }
1713  info->getKeywordlist(kwl);
1714  info.reset();
1715  }
1716  else
1717  {
1719  << "No dump available for: " << file.c_str() << std::endl;
1720  }
1721 }
std::shared_ptr< ossimInfoBase > create(const ossimFilename &file) const
Create method.
static ossimInfoFactoryRegistry * instance()
instance method
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
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ecef2llh()

std::ostream & ossimInfo::ecef2llh ( const ossimEcefPoint ecefPoint,
std::ostream &  out 
) const

Converts ecef point to lat lon height.

Parameters
outOutput to write to.
Returns
stream

Definition at line 2840 of file ossimInfo.cpp.

References ossimEcefPoint::toString(), and ossimGpt::toString().

2841 {
2842  out << "ECEF: " << ecefPoint.toString() << "\n"
2843  << "lat_lon_height: " << ossimGpt(ecefPoint).toString() << "\n";
2844 
2845  return out;
2846 }
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimGpt.cpp:78
ossimString toString(ossim_uint32 precision=15) const
To string method.

◆ execute()

bool ossimInfo::execute ( )
virtual

execute method.

Performs the actual dump of information. This executes any options set including image operations, i.e. -i -p –dno and so on.

Note
Throws ossimException on error.

Implements ossimTool.

Definition at line 827 of file ossimInfo.cpp.

References ossimKeywordlist::getSize(), and ossimTool::m_kwl.

828 {
829  static const char M[] = "ossimInfo::execute()";
830 
831  const ossim_uint32 KEY_COUNT = m_kwl.getSize();
832 
833  if ( traceDebug() )
834  {
836  << M << " entered..."
837  << "\nMap size: " << KEY_COUNT << "\n";
838  }
839 
840  if ( KEY_COUNT )
841  {
842  ossim_uint32 consumedKeys = 0;
843 
844  const char* lookup;
845 
846  lookup = m_kwl.find(IMAGE_FILE_KW);
847  if ( lookup )
848  {
849  ++consumedKeys;
850  ossimFilename image = lookup;
851 
852  consumedKeys += executeImageOptions(image);
853  }
854 
855  if ( consumedKeys < KEY_COUNT )
856  {
857  ossimString value;
858 
859  if ( keyIsTrue( std::string(BUILD_DATE_KW)) )
860  {
861  getBuildDate( value.string() );
863  << BUILD_DATE_KW << ": " << value << "\n";
864  }
865 
866  lookup = m_kwl.find(CONFIGURATION_KW);
867  if ( lookup )
868  {
869  ++consumedKeys;
870  value = lookup;
871  if ( value.toBool() )
872  {
874  }
875  }
876 
877  lookup = m_kwl.find(DATUMS_KW);
878  if ( lookup )
879  {
880  ++consumedKeys;
881  value = lookup;
882  if ( value.toBool() )
883  {
884  printDatums();
885  }
886  }
887 
888  lookup = m_kwl.find(DEG2RAD_KW);
889  if ( lookup )
890  {
891  ++consumedKeys;
892  value = lookup;
893  deg2rad( value.toFloat64() );
894  }
895 
896  lookup = m_kwl.find(ECEF2LLH_KW);
897  if(lookup)
898  {
899  ++consumedKeys;
900  ossimEcefPoint ecefPoint;
901  ecefPoint.toPoint(lookup);
902 
904  }
905 
906  lookup = m_kwl.find(EXTENSIONS_KW);
907  if ( lookup )
908  {
909  ++consumedKeys;
910  value = lookup;
911  if ( value.toBool() )
912  {
913  printExtensions();
914  }
915  }
916 
917  lookup = m_kwl.find(FACTORIES_KW);
918  if ( lookup )
919  {
920  ++consumedKeys;
921  ossimString factories = lookup;
922  bool keywordListFlag = false;
923  lookup = m_kwl.find(FACTORY_KEYWORD_LIST_KW);
924  if ( lookup )
925  {
926  ++consumedKeys;
927  keywordListFlag = ossimString(lookup).toBool();
928  }
929  printFactories(keywordListFlag);
930  }
931 
932  lookup = m_kwl.find(FONTS_KW);
933  if ( lookup )
934  {
935  ++consumedKeys;
936  value = lookup;
937  if ( value.toBool() )
938  {
939  printFonts();
940  }
941  }
942 
943  lookup = m_kwl.find(FT2MTRS_KW);
944  if ( lookup )
945  {
946  ++consumedKeys;
947  value = lookup;
948  bool us_survey = false;
949  lookup = m_kwl.find(FT2MTRS_US_SURVEY_KW);
950  if ( lookup )
951  {
952  ++consumedKeys;
953  us_survey = ossimString(lookup).toBool();
954  }
955  ft2mtrs( value.toFloat64(), us_survey);
956  }
957 
958  lookup = m_kwl.find(HEIGHT_KW);
959  if ( lookup )
960  {
961  ++consumedKeys;
962  value = lookup;
963  ossimGpt gpt;
964  gpt.toPoint(value);
965  outputHeight(gpt);
966  }
967 
968  lookup = m_kwl.find(MTRS2FT_KW);
969  if ( lookup )
970  {
971  ++consumedKeys;
972  value = lookup;
973  bool us_survey = false;
974  lookup = m_kwl.find(MTRS2FT_US_SURVEY_KW);
975  if ( lookup )
976  {
977  ++consumedKeys;
978  us_survey = ossimString(lookup).toBool();
979  }
980  mtrs2ft( value.toFloat64(), us_survey);
981  }
982 
983  lookup = m_kwl.find(MTRSPERDEG_KW);
984  if ( lookup )
985  {
986  ++consumedKeys;
987  value = lookup;
988  mtrsPerDeg( value.toFloat64() );
989  }
990 
991  lookup = m_kwl.find(OVERVIEW_TYPES_KW);
992  if ( lookup )
993  {
994  ++consumedKeys;
995  value = lookup;
996  if ( value.toBool() )
997  {
999  }
1000  }
1001 
1002  lookup = m_kwl.find(PLUGINS_KW);
1003  if ( lookup )
1004  {
1005  ++consumedKeys;
1006  value = lookup;
1007  if ( value.toBool() )
1008  {
1009  printPlugins();
1010  }
1011  }
1012 
1013  lookup = m_kwl.find(PLUGIN_TEST_KW);
1014  if ( lookup )
1015  {
1016  ++consumedKeys;
1017  value = lookup;
1018  testPlugin(value);
1019  }
1020 
1021  lookup = m_kwl.find(PROJECTIONS_KW);
1022  if ( lookup )
1023  {
1024  ++consumedKeys;
1025  value = lookup;
1026  if ( value.toBool() )
1027  {
1028  printProjections();
1029  }
1030  }
1031 
1032  lookup = m_kwl.find(RAD2DEG_KW);
1033  if ( lookup )
1034  {
1035  ++consumedKeys;
1036  value = lookup;
1037  rad2deg( value.toFloat64() );
1038  }
1039 
1040  lookup = m_kwl.find(READER_PROPS_KW);
1041  if ( lookup )
1042  {
1043  ++consumedKeys;
1044  value = lookup;
1045  if ( value.toBool() )
1046  {
1047  printReaderProps();
1048  }
1049  }
1050 
1051  lookup = m_kwl.find(RESAMPLER_FILTERS_KW);
1052  if ( lookup )
1053  {
1054  ++consumedKeys;
1055  value = lookup;
1056  if ( value.toBool() )
1057  {
1059  }
1060  }
1061 
1062  if ( keyIsTrue( std::string(REVISION_NUMBER_KW) ) )
1063  {
1064  getRevisionNumber( value.string() );
1066  << REVISION_NUMBER_KW << ": " << value << "\n";
1067  }
1068 
1069  if ( keyIsTrue( std::string(VERSION_KW) ) )
1070  {
1071  getVersion( value.string() );
1073  << VERSION_KW << ": " << value << "\n";
1074  }
1075 
1076  lookup = m_kwl.find(WRITERS_KW);
1077  if ( lookup )
1078  {
1079  ++consumedKeys;
1080  value = lookup;
1081  if ( value.toBool() )
1082  {
1083  printWriters();
1084  }
1085  }
1086 
1087  lookup = m_kwl.find(WRITER_PROPS_KW);
1088  if ( lookup )
1089  {
1090  ++consumedKeys;
1091  value = lookup;
1092  if ( value.toBool() )
1093  {
1094  printWriterProps();
1095  }
1096  }
1097 
1098  lookup = m_kwl.find(ZOOM_LEVEL_GSDS_KW);
1099  if ( lookup )
1100  {
1101  ++consumedKeys;
1102  value = lookup;
1103  if ( value.toBool() )
1104  {
1106  }
1107  }
1108 
1109  } // if ( consumedKeys < KEY_COUNT )
1110 
1111  if ( traceDebug() )
1112  {
1114  << "KEY_COUNT: " << KEY_COUNT
1115  << "\nconsumedKeys: " << consumedKeys << "\n";
1116  }
1117 
1118  } // if ( KEY_COUNT )
1119 
1120  if ( traceDebug() )
1121  {
1122  ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
1123  }
1124  return true;
1125 }
void mtrs2ft(const ossim_float64 &meters, bool us_survey) const
Converts meters to feet and outputs to stdout.
Definition: ossimInfo.cpp:2905
void printResamplerFilters() const
Prints resampler filters to stdout.
Definition: ossimInfo.cpp:3167
void printReaderProps() const
Prints reader properties to stdout.
Definition: ossimInfo.cpp:3157
void printConfiguration() const
Dumps ossim preferences/configuration data.
Definition: ossimInfo.cpp:2695
const char * find(const char *key) const
void rad2deg(const ossim_float64 &radians) const
Converts radians to degrees and outputs to stdout.
Definition: ossimInfo.cpp:2848
bool keyIsTrue(const std::string &key) const
Definition: ossimInfo.cpp:3414
void mtrsPerDeg(const ossim_float64 &latitude) const
Get meters per degree for a given latitude and outputs to stdout.
Definition: ossimInfo.cpp:2941
void printOverviewTypes() const
Prints overview types to stdout.
Definition: ossimInfo.cpp:3115
ossimKeywordlist m_kwl
Definition: ossimTool.h:148
void testPlugin(const ossimFilename &plugin) const
Test a plugin load and outputs to stdout.
Definition: ossimInfo.cpp:3097
std::ostream & ecef2llh(const ossimEcefPoint &ecefPoint, std::ostream &out) const
Converts ecef point to lat lon height.
Definition: ossimInfo.cpp:2840
void toPoint(const std::string &s)
Initializes this point from string.
void ft2mtrs(const ossim_float64 &feet, bool us_survey) const
Converts feet to meters and outputs to stdout.
Definition: ossimInfo.cpp:2870
void printDatums() const
Dumps datum list to stdout.
Definition: ossimInfo.cpp:2737
void printFonts() const
Prints fonts list to stdout.
Definition: ossimInfo.cpp:2790
void outputHeight(const ossimGpt &gpt) const
Gets the height for ground point (latitude, longitude).
Definition: ossimInfo.cpp:2969
void toPoint(const std::string &s)
Initializes this point from string.
Definition: ossimGpt.cpp:116
void getRevisionNumber(std::string &s) const
Gets revision number.
Definition: ossimInfo.cpp:3382
bool toBool() const
String to numeric methods.
void deg2rad(const ossim_float64 &degrees) const
Converts degrees to radians and outputs to stdout.
Definition: ossimInfo.cpp:2818
unsigned int ossim_uint32
ossim_float64 toFloat64() const
ossim_uint32 executeImageOptions(const ossimFilename &file)
handles image options.
Definition: ossimInfo.cpp:1127
void printExtensions() const
Prints supported image file extensions to stdout.
Definition: ossimInfo.cpp:3054
void printWriters() const
Prints list of available writers to stdout.
Definition: ossimInfo.cpp:3187
void printZoomLevelGsds() const
Prints zoom levels to stdout.
Definition: ossimInfo.cpp:3197
void getVersion(std::string &s) const
Gets version.
Definition: ossimInfo.cpp:3391
void printProjections() const
Prints projections to stdout.
Definition: ossimInfo.cpp:3133
void printFactories(bool keywordListFlag) const
Prints factories.
Definition: ossimInfo.cpp:2710
ossim_uint32 getSize() const
void printPlugins() const
Prints loaded plugins to stdout.
Definition: ossimInfo.cpp:3079
void printWriterProps() const
Prints writer properties to stdout.
Definition: ossimInfo.cpp:3280
void getBuildDate(std::string &s) const
Gets build date.
Definition: ossimInfo.cpp:3373
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
const std::string & string() const
Definition: ossimString.h:414

◆ executeImageOptions()

ossim_uint32 ossimInfo::executeImageOptions ( const ossimFilename file)

handles image options.

Handles image type info opions, i.e. -i -p –dno and so on.

Returns
Number of consumed options.

Definition at line 1127 of file ossimInfo.cpp.

1128 {
1129  static const char M[] = "ossimInfo::executeImageOptions()";
1130  if ( traceDebug() )
1131  {
1132  ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\nfile: " << file << "\n";
1133  }
1134 
1135  // Output keyword list.
1136  ossimKeywordlist okwl;
1137 
1138  ossim_uint32 consumedKeys = 0;
1139  const char* lookup = 0;
1140  ossimString value = "";
1141 
1142  bool dnoFlag = false;
1143  bool overwriteFlag = false;
1144  bool xmlOutFlag = false;
1145 
1146  lookup = m_kwl.find( OVERWRITE_KW );
1147  if ( lookup )
1148  {
1149  ++consumedKeys;
1150  value = lookup;
1151  overwriteFlag = value.toBool();
1152  }
1153 
1154  // Check for xml format option.
1155  lookup = m_kwl.find( FORMAT_KW );
1156  if ( lookup )
1157  {
1158  ++consumedKeys;
1159  ossimString format = lookup;
1160  if ( format.upcase() == "XML" )
1161  {
1162  xmlOutFlag = true;
1163  }
1164  }
1165 
1166  lookup = m_kwl.find( OUTPUT_FILE_KW );
1167  ossimFilename outputFile;
1168  if ( lookup )
1169  {
1170  ++consumedKeys;
1171  outputFile = lookup;
1172  }
1173 
1174  lookup = m_kwl.find( PRETTY_PRINT_KW );
1175  if ( lookup )
1176  {
1177  ++consumedKeys;
1178  prettyPrint(file);
1179  }
1180 
1181  // Check for dump. Does not require image to be opened.
1182  lookup = m_kwl.find( DUMP_KW );
1183  if ( lookup )
1184  {
1185  ++consumedKeys;
1186  lookup = m_kwl.find( DUMP_NO_OVERVIEWS_KW );
1187  if ( lookup )
1188  {
1189  ++consumedKeys;
1190  value = lookup;
1191  dnoFlag = value.toBool();
1192  }
1193 
1194  if ( !xmlOutFlag && ( outputFile == ossimFilename::NIL ) )
1195  {
1196  //---
1197  // Write to standard out:
1198  // This dump will come out in order so is preferred over going to
1199  // okwl(output keyword list) which will come out alphabetical.
1200  //---
1201  ossimKeywordlist kwl;
1202  dumpImage(file, dnoFlag, kwl);
1204  }
1205  else
1206  {
1207  // Save to output keyword list. Will be output later.
1208  dumpImage(file, dnoFlag, okwl);
1209  }
1210  }
1211 
1212  bool centerGroundFlag = false;
1213  bool centerImageFlag = false;
1214  bool imageBoundsFlag = false;
1215  bool imageCenterFlag = false;
1216  bool imageGeomFlag = false;
1217  bool imageInfoFlag = false;
1218  bool imageRectFlag = false;
1219  bool img2grdFlag = false;
1220  bool grd2imgFlag = false;
1221  bool metaDataFlag = false;
1222  bool northUpFlag = false;
1223  bool paletteFlag = false;
1224  bool upIsUpFlag = false;
1225  bool imageToGroundFlag = false;
1226  bool groundToImageFlag = false;
1227  bool dumpState = false;
1228  bool canOpenFlag = false;
1229 
1230  lookup = m_kwl.find( DUMP_STATE_KW );
1231  if ( lookup )
1232  {
1233  ++consumedKeys;
1234  value = lookup;
1235  dumpState = value.toBool();
1236  }
1237 
1238  // Center Ground:
1239  lookup = m_kwl.find( CENTER_GROUND_KW );
1240  if ( lookup )
1241  {
1242  ++consumedKeys;
1243  value = lookup;
1244  centerGroundFlag = value.toBool();
1245  }
1246 
1247  // Center Image:
1248  lookup = m_kwl.find( CENTER_IMAGE_KW );
1249  if ( lookup )
1250  {
1251  ++consumedKeys;
1252  value = lookup;
1253  centerImageFlag = value.toBool();
1254  }
1255 
1256  // Metadata:
1257  lookup = m_kwl.find( METADATA_KW );
1258  if ( lookup )
1259  {
1260  ++consumedKeys;
1261  value = lookup;
1262  metaDataFlag = value.toBool();
1263  }
1264 
1265  // Palette:
1266  lookup = m_kwl.find( PALETTE_KW );
1267  if ( lookup )
1268  {
1269  ++consumedKeys;
1270  value = lookup;
1271  paletteFlag = value.toBool();
1272  }
1273 
1274  // Image bounds:
1275  lookup = m_kwl.find( IMAGE_BOUNDS_KW );
1276  if ( lookup )
1277  {
1278  ++consumedKeys;
1279  value = lookup;
1280  imageBoundsFlag = value.toBool();
1281  }
1282 
1283  // Image center:
1284  lookup = m_kwl.find( IMAGE_CENTER_KW );
1285  if ( lookup )
1286  {
1287  ++consumedKeys;
1288  value = lookup;
1289  imageCenterFlag = value.toBool();
1290  }
1291 
1292  // Image rect:
1293  lookup = m_kwl.find( IMAGE_RECT_KW );
1294  if ( lookup )
1295  {
1296  ++consumedKeys;
1297  value = lookup;
1298  imageRectFlag = value.toBool();
1299  }
1300 
1301  //---
1302  // General image info:
1303  // Defaulted ON if no image options set.
1304  //---
1305  lookup = m_kwl.find( IMAGE_INFO_KW );
1306  if ( lookup )
1307  {
1308  ++consumedKeys;
1309  value = lookup;
1310  imageInfoFlag = value.toBool();
1311  }
1312 
1313  lookup = m_kwl.find( IMG2GRD_KW );
1314  if ( lookup )
1315  {
1316  ++consumedKeys;
1317  img2grdFlag = true;
1318  }
1319 
1320  lookup = m_kwl.find( GRD2IMG_KW );
1321  if ( lookup )
1322  {
1323  ++consumedKeys;
1324  grd2imgFlag = true;
1325  }
1326 
1327  //---
1328  // Image geometry info:
1329  // Defaulted on if no image options set.
1330  //---
1331  lookup = m_kwl.find( GEOM_INFO_KW );
1332  if ( lookup )
1333  {
1334  ++consumedKeys;
1335  value = lookup;
1336  imageGeomFlag = value.toBool();
1337  }
1338 
1339  // North up:
1340  lookup = m_kwl.find( NORTH_UP_KW );
1341  if ( lookup )
1342  {
1343  ++consumedKeys;
1344  value = lookup;
1345  northUpFlag = value.toBool();
1346  }
1347 
1348  // Up is up:
1349  lookup = m_kwl.find( UP_IS_UP_KW );
1350  if ( lookup )
1351  {
1352  ++consumedKeys;
1353  value = lookup;
1354  upIsUpFlag = value.toBool();
1355  }
1356 
1357  // Up is up:
1358  lookup = m_kwl.find( CAN_OPEN_KW );
1359  if ( lookup )
1360  {
1361  ++consumedKeys;
1362  value = lookup;
1363  canOpenFlag = value.toBool();
1364  }
1365 
1366  // If no options consumed default is image info and geom info:
1367  if ( consumedKeys == 0 )
1368  {
1369  imageInfoFlag = true;
1370  imageGeomFlag = true;
1371  }
1372 
1373  if ( centerGroundFlag || centerImageFlag || imageBoundsFlag || imageCenterFlag ||
1374  imageRectFlag || img2grdFlag || grd2imgFlag || metaDataFlag || paletteFlag ||
1375  imageInfoFlag || imageGeomFlag || northUpFlag || upIsUpFlag || dumpState ||
1376  imageToGroundFlag || groundToImageFlag || canOpenFlag)
1377  {
1378  // Requires open image.
1379  if ( ! m_img )
1380  {
1381  openImage(file);
1382  }
1383 
1384  if( canOpenFlag )
1385  {
1386  if(m_img)
1387  {
1388  okwl.add("can_open", "true", true);
1389  }
1390  else
1391  {
1392  okwl.add("can_open", "false", true);
1393  }
1394  }
1395 
1396  if ( centerGroundFlag )
1397  {
1398  getCenterGround(okwl);
1399  }
1400 
1401  if ( centerImageFlag )
1402  {
1403  getCenterImage(okwl);
1404  }
1405 
1406  if ( imageCenterFlag )
1407  {
1408  // -c option prints both ground and image point of center.
1409  getCenterGround(okwl);
1410  getCenterImage(okwl);
1411  }
1412 
1413  if ( imageBoundsFlag )
1414  {
1415  getImageBounds(okwl);
1416  }
1417 
1418  if ( imageRectFlag )
1419  {
1420  getImageRect(okwl);
1421  }
1422 
1423  if ( img2grdFlag )
1424  {
1425  getImg2grd(okwl);
1426  }
1427  if ( grd2imgFlag )
1428  {
1429  getGrd2img(okwl);
1430  }
1431 
1432  if ( metaDataFlag )
1433  {
1434  getImageMetadata(okwl);
1435  }
1436 
1437  if ( paletteFlag )
1438  {
1439  getImagePalette(okwl);
1440  }
1441 
1442  if ( imageInfoFlag )
1443  {
1444  getImageInfo(okwl, dnoFlag);
1445  }
1446 
1447  if ( imageGeomFlag )
1448  {
1449  getImageGeometryInfo(okwl, dnoFlag);
1450  }
1451 
1452  if ( imageRectFlag )
1453  {
1454  getImageRect(okwl);
1455  }
1456 
1457  if ( northUpFlag )
1458  {
1459  getNorthUpAngle( okwl );
1460  }
1461 
1462  if ( upIsUpFlag )
1463  {
1464  getUpIsUpAngle( okwl );
1465  }
1466 
1467  if(dumpState)
1468  {
1469  if(m_img)
1470  {
1471  if(m_img->getState())
1472  {
1473  m_img->getState()->save(okwl);
1474  }
1475  }
1476  }
1477 
1478  } // if ( metaDataFlag || paletteFlag || imageInfoFlag || imageGeomFlag )
1479 
1480  if ( okwl.getSize() ) // Output section:
1481  {
1482  if ( outputFile == ossimFilename::NIL )
1483  {
1484  // Write to standard out:
1485  if ( !xmlOutFlag )
1486  {
1487  ossimNotify(ossimNotifyLevel_INFO) << okwl << std::endl;
1488  }
1489  else
1490  {
1491  outputXml( okwl );
1492  }
1493  }
1494  else
1495  {
1496  // Write to file:
1497 
1498  if ( !overwriteFlag && outputFile.exists() )
1499  {
1501  << "ERROR: File already exists: " << outputFile
1502  << "\nUse -v option to overwrite."
1503  << std::endl;
1504  }
1505  else
1506  {
1507  if ( !xmlOutFlag )
1508  {
1509  okwl.write( outputFile );
1510  }
1511  else
1512  {
1513  outputXml( okwl, outputFile );
1514  }
1515  }
1516  }
1517 
1518  } // if ( okwl )
1519 
1520 
1521  if ( traceDebug() )
1522  {
1524  << "consumedKeys: " << consumedKeys << "\n"
1525  << M << " exited...\n";
1526  }
1527 
1528  return consumedKeys;
1529 
1530 } // ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
virtual std::ostream & print(std::ostream &os) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
void getUpIsUpAngle(ossimKeywordlist &kwl)
Populates keyword list with up_is_up_angle.
Definition: ossimInfo.cpp:2427
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
static const ossimFilename NIL
This was taken from Wx widgets for performing touch and access date stamps.
Definition: ossimFilename.h:40
void getCenterGround(ossimKeywordlist &kwl)
Populates keyword list with image center ground point.
Definition: ossimInfo.cpp:2156
Represents serializable keyword/value map.
void getNorthUpAngle(ossimKeywordlist &kwl)
Populates keyword list with north_up_angle.
Definition: ossimInfo.cpp:2519
const char * find(const char *key) const
void openImage(const ossimFilename &file)
Opens image handler and stores in m_img data member.
Definition: ossimInfo.cpp:1602
std::shared_ptr< ossim::ImageHandlerState > getState()
ossimKeywordlist m_kwl
Definition: ossimTool.h:148
void outputXml(const ossimKeywordlist &kwl) const
Convert keyword list to xml then outputs to standard out.
Definition: ossimInfo.cpp:3400
virtual bool write(const char *file, const char *comment=0) const
Methods to dump the ossimKeywordlist to a file on disk.
void getImg2grd(ossimKeywordlist &kwl)
Populates keyword list with ground point for image point.
Definition: ossimInfo.cpp:2288
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImageInfo(const ossimFilename &file, bool dumpFlag, bool dnoFlag, bool imageGeomFlag, bool imageInfoFlag, bool metaDataFlag, bool paletteFlag, ossimKeywordlist &kwl) const
getImageInfo Method to open image "file" and get image info in the form of a ossimKeywordlist.
Definition: ossimInfo.cpp:1532
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
void getImageMetadata(ossimKeywordlist &kwl) const
Populates keyword list with metadata.
Definition: ossimInfo.cpp:1722
bool exists() const
bool toBool() const
String to numeric methods.
unsigned int ossim_uint32
void prettyPrint(const ossimFilename &file) const
Dumps the image information from ossimInfoFactoryRegistry.
Definition: ossimInfo.cpp:1674
void getGrd2img(ossimKeywordlist &kwl)
Populates keyword list with image point for grund point.
Definition: ossimInfo.cpp:2367
void dumpImage(const ossimFilename &file, bool dnoFlag, ossimKeywordlist &kwl) const
Dumps the image information from ossimInfoFactoryRegistry to keyword list.
Definition: ossimInfo.cpp:1702
void getImageBounds(ossimKeywordlist &kwl)
Populates keyword list with edge to edge image bounds.
Definition: ossimInfo.cpp:2216
ossim_uint32 getSize() const
void getCenterImage(ossimKeywordlist &kwl)
Populates keyword list with image center point.
Definition: ossimInfo.cpp:2104
void getImagePalette(ossimKeywordlist &kwl)
Populates keyword list with palette data.
Definition: ossimInfo.cpp:1777
void getImageGeometryInfo(ossimKeywordlist &kwl, bool dnoFlag)
Populates keyword list with image geometry/projection information.
Definition: ossimInfo.cpp:1949
void getImageRect(ossimKeywordlist &kwl)
Populates keyword list with image rectangle.
Definition: ossimInfo.cpp:2584
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ft2mtrs() [1/2]

void ossimInfo::ft2mtrs ( const ossim_float64 feet,
bool  us_survey 
) const

Converts feet to meters and outputs to stdout.

Definition at line 2870 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

2871 {
2872  ft2mtrs( feet, us_survey, ossimNotify(ossimNotifyLevel_INFO) );
2873 }
void ft2mtrs(const ossim_float64 &feet, bool us_survey) const
Converts feet to meters and outputs to stdout.
Definition: ossimInfo.cpp:2870
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ft2mtrs() [2/2]

std::ostream & ossimInfo::ft2mtrs ( const ossim_float64 feet,
bool  us_survey,
std::ostream &  out 
) const

Converts feet to meters and outputs to stream.

Parameters
outOutput to write to out.
Returns
stream

Definition at line 2875 of file ossimInfo.cpp.

References MTRS_PER_FT, and US_METERS_PER_FT.

2878 {
2879  ossim_float64 meters = 0.0;
2880  std::string conversionString;
2881  if (us_survey)
2882  {
2883  meters = feet * US_METERS_PER_FT;
2884  conversionString = "0.3048006096";
2885  }
2886  else
2887  {
2888  meters = feet * MTRS_PER_FT;
2889  conversionString = "0.3048";
2890  }
2891 
2892  // Capture the original flags.
2893  std::ios_base::fmtflags f = out.flags();
2894 
2895  out << setiosflags(ios::fixed) << setprecision(15)
2896  << feet << " * " << conversionString << " = "
2897  << meters << " meters." << std::endl;
2898 
2899  // Reset flags.
2900  out.setf(f);
2901 
2902  return out;
2903 }
double ossim_float64
#define US_METERS_PER_FT
#define MTRS_PER_FT

◆ getBuildDate()

void ossimInfo::getBuildDate ( std::string &  s) const

Gets build date.

Parameters
sString to initialize.

Definition at line 3373 of file ossimInfo.cpp.

References OSSIM_BUILD_DATE.

3374 {
3375 #ifdef OSSIM_BUILD_DATE
3376  s = OSSIM_BUILD_DATE;
3377 #else
3378  s = "unknown";
3379 #endif
3380 }
#define OSSIM_BUILD_DATE
Definition: ossimVersion.h:12

◆ getCenterGround() [1/3]

void ossimInfo::getCenterGround ( ossimKeywordlist kwl)

Populates keyword list with image center ground point.

Parameters
kwlKeyword list to populate.

Definition at line 2156 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getCenterGround().

2157 {
2158  if ( m_img.valid() )
2159  {
2160  getCenterGround( m_img.get(), kwl );
2161  }
2162 }
void getCenterGround(ossimKeywordlist &kwl)
Populates keyword list with image center ground point.
Definition: ossimInfo.cpp:2156
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805

◆ getCenterGround() [2/3]

void ossimInfo::getCenterGround ( ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Definition at line 2164 of file ossimInfo.cpp.

References getCenterGround(), and ossimImageHandler::getEntryList().

2165 {
2166  if ( ih )
2167  {
2168  std::vector<ossim_uint32> entryList;
2169  ih->getEntryList(entryList);
2170 
2171  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2172  while ( i != entryList.end() )
2173  {
2174  getCenterGround( ih, (*i), kwl );
2175  ++i;
2176  }
2177  }
2178 }
void getCenterGround(ossimKeywordlist &kwl)
Populates keyword list with image center ground point.
Definition: ossimInfo.cpp:2156
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const

◆ getCenterGround() [3/3]

void ossimInfo::getCenterGround ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const
private

Definition at line 2180 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimImageGeometry::getBoundingRect(), ossimImageHandler::getFilename(), ossimImageHandler::getImageGeometry(), ossimDrect::hasNans(), ossimImageGeometry::localToWorld(), ossimDrect::midPoint(), ossimNotify(), ossimNotifyLevel_WARN, ossimImageHandler::setCurrentEntry(), ossimGpt::toString(), ossimString::toString(), and ossimRefPtr< T >::valid().

2183 {
2184  if ( ih )
2185  {
2186  if ( ih->setCurrentEntry(entry) )
2187  {
2188  ossimString prefix = "image";
2189  prefix = prefix + ossimString::toString(entry) + ".";
2190 
2192  if(geom.valid())
2193  {
2194  ossimDrect bounds;
2195  geom->getBoundingRect( bounds );
2196 
2197  if( !bounds.hasNans() )
2198  {
2199  ossimDpt iPt = bounds.midPoint();
2200  ossimGpt gPt;
2201  geom->localToWorld(iPt, gPt);
2202  kwl.add(prefix, "center_ground", gPt.toString().c_str(), true);
2203  }
2204  }
2205 
2206  } // if ( ih->setCurrentEntry(entry) )
2207  else
2208  {
2210  << "Could not get ground center for: " << ih->getFilename() << std::endl;
2211  }
2212 
2213  } // if ( ih )
2214 }
bool valid() const
Definition: ossimRefPtr.h:75
void getBoundingRect(ossimIrect &bounding_rect) const
Get the bounding rect of (0, 0) to (imageSize.x-1, imageSize.y-1).
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual const ossimFilename & getFilename() const
Returns the filename.
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
bool hasNans() const
Definition: ossimDrect.h:396
ossimDpt midPoint() const
Definition: ossimDrect.h:817
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
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimGpt.cpp:78
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getCenterImage() [1/3]

void ossimInfo::getCenterImage ( ossimKeywordlist kwl)

Populates keyword list with image center point.

Parameters
kwlKeyword list to populate.

Definition at line 2104 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getCenterImage().

2105 {
2106  if ( m_img.valid() )
2107  {
2108  getCenterImage( m_img.get(), kwl );
2109  }
2110 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getCenterImage(ossimKeywordlist &kwl)
Populates keyword list with image center point.
Definition: ossimInfo.cpp:2104

◆ getCenterImage() [2/3]

void ossimInfo::getCenterImage ( ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Definition at line 2112 of file ossimInfo.cpp.

References getCenterImage(), and ossimImageHandler::getEntryList().

2113 {
2114  if ( ih )
2115  {
2116  std::vector<ossim_uint32> entryList;
2117  ih->getEntryList(entryList);
2118 
2119  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2120  while ( i != entryList.end() )
2121  {
2122  getCenterImage( ih, (*i), kwl );
2123  ++i;
2124  }
2125  }
2126 }
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
void getCenterImage(ossimKeywordlist &kwl)
Populates keyword list with image center point.
Definition: ossimInfo.cpp:2104

◆ getCenterImage() [3/3]

void ossimInfo::getCenterImage ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const
private

Definition at line 2128 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimImageHandler::getBoundingRect(), ossimImageHandler::getFilename(), ossimDrect::hasNans(), ossimDrect::midPoint(), ossimNotify(), ossimNotifyLevel_WARN, ossimImageHandler::setCurrentEntry(), ossimDpt::toString(), and ossimString::toString().

2131 {
2132  if ( ih )
2133  {
2134  if ( ih->setCurrentEntry(entry) )
2135  {
2136  ossimString prefix = "image";
2137  prefix = prefix + ossimString::toString(entry) + ".";
2138  ossimDrect bounds = ih->getBoundingRect();
2139 
2140  if( !bounds.hasNans() )
2141  {
2142  ossimDpt iPt = bounds.midPoint();
2143  kwl.add(prefix, "center_image", iPt.toString().c_str(), true);
2144  }
2145 
2146  } // if ( ih->setCurrentEntry(entry) )
2147  else
2148  {
2150  << "Could not get image center for: " << ih->getFilename() << std::endl;
2151  }
2152 
2153  } // if ( ih )
2154 }
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual const ossimFilename & getFilename() const
Returns the filename.
bool hasNans() const
Definition: ossimDrect.h:396
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimDpt.cpp:160
ossimDpt midPoint() const
Definition: ossimDrect.h:817
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
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getClassName()

virtual ossimString ossimInfo::getClassName ( ) const
inlinevirtual

Reimplemented from ossimTool.

Definition at line 76 of file ossimInfo.h.

76 { return "ossimInfo"; }

◆ getGrd2img() [1/3]

void ossimInfo::getGrd2img ( ossimKeywordlist kwl)

Populates keyword list with image point for grund point.

Associated input key values: "grd2img: (lat,lon,hgt,datum)" Output key: image0.image_point: (x, y)

Parameters
kwlKeyword list to populate.

Definition at line 2367 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getGrd2img().

2368 {
2369  if ( m_img.valid() )
2370  {
2371  getGrd2img( m_img.get(), kwl );
2372  }
2373 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getGrd2img(ossimKeywordlist &kwl)
Populates keyword list with image point for grund point.
Definition: ossimInfo.cpp:2367

◆ getGrd2img() [2/3]

void ossimInfo::getGrd2img ( ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Gets gound point from image point.

Input key:value "img2grd: <x> <y>"

Parameters
Pointerto an image handler.
kwlKeyword list to populate.

Definition at line 2375 of file ossimInfo.cpp.

References ossimImageHandler::getEntryList(), and getGrd2img().

2376 {
2377  if ( ih )
2378  {
2379  std::vector<ossim_uint32> entryList;
2380  ih->getEntryList(entryList);
2381 
2382  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2383  while ( i != entryList.end() )
2384  {
2385  getGrd2img( ih, (*i), kwl );
2386  ++i;
2387  }
2388  }
2389 }
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
void getGrd2img(ossimKeywordlist &kwl)
Populates keyword list with image point for grund point.
Definition: ossimInfo.cpp:2367

◆ getGrd2img() [3/3]

void ossimInfo::getGrd2img ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const
private

Gets gound point from image point.

Input key:value "img2grd: <x> <y>"

Parameters
Pointerto an image handler.
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.

Definition at line 2391 of file ossimInfo.cpp.

References ossimKeywordlist::findKey(), ossimImageHandler::getImageGeometry(), ossimTool::m_kwl, ossimImageHandler::setCurrentEntry(), ossimString::toString(), and ossimRefPtr< T >::valid().

2394 {
2395  if ( ih )
2396  {
2397  if ( ih->setCurrentEntry(entry) )
2398  {
2399  ossimString prefix = "image";
2400  prefix = prefix + ossimString::toString(entry) + ".";
2401 
2403  if(geom.valid())
2404  {
2405  std::string value = m_kwl.findKey( GRD2IMG_KW );
2406  if ( value.size() )
2407  {
2408  ossimGpt gpt;
2409  ossimDpt dpt;
2410  gpt.toPoint( value );
2411  dpt.makeNan();
2412  geom->worldToLocal(gpt, dpt);
2413  kwl.add(prefix, "image_point", dpt.toString().c_str(), true);
2414  }
2415  }
2416 
2417  } // if ( ih->setCurrentEntry(entry) )
2418  else
2419  {
2421  << "Could not get ground center for: " << ih->getFilename() << std::endl;
2422  }
2423 
2424  } // if ( ih )
2425 }
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
bool valid() const
Definition: ossimRefPtr.h:75
static ossimString toString(bool aValue)
Numeric to string methods.
ossimKeywordlist m_kwl
Definition: ossimTool.h:148
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
void toPoint(const std::string &s)
Initializes this point from string.
Definition: ossimGpt.cpp:116
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual const ossimFilename & getFilename() const
Returns the filename.
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
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void makeNan()
Definition: ossimDpt.h:65

◆ getImageBounds() [1/3]

void ossimInfo::getImageBounds ( ossimKeywordlist kwl)

Populates keyword list with edge to edge image bounds.

Parameters
kwlKeyword list to populate.

Definition at line 2216 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getImageBounds().

2217 {
2218  if ( m_img.valid() )
2219  {
2220  getImageBounds( m_img.get(), kwl );
2221  }
2222 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImageBounds(ossimKeywordlist &kwl)
Populates keyword list with edge to edge image bounds.
Definition: ossimInfo.cpp:2216

◆ getImageBounds() [2/3]

void ossimInfo::getImageBounds ( ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Definition at line 2224 of file ossimInfo.cpp.

References ossimImageHandler::getEntryList(), and getImageBounds().

2225 {
2226  if ( ih )
2227  {
2228  std::vector<ossim_uint32> entryList;
2229  ih->getEntryList(entryList);
2230 
2231  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2232  while ( i != entryList.end() )
2233  {
2234  getImageBounds( ih, (*i), kwl );
2235  ++i;
2236  }
2237  }
2238 }
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
void getImageBounds(ossimKeywordlist &kwl)
Populates keyword list with edge to edge image bounds.
Definition: ossimInfo.cpp:2216

◆ getImageBounds() [3/3]

void ossimInfo::getImageBounds ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const
private

Definition at line 2240 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimDrect::expand(), ossimImageGeometry::getBoundingRect(), ossimImageHandler::getFilename(), ossimImageHandler::getImageGeometry(), ossimDrect::hasNans(), ossimDrect::ll(), ossimImageGeometry::localToWorld(), ossimDrect::lr(), ossimNotify(), ossimNotifyLevel_WARN, ossimImageHandler::setCurrentEntry(), ossimGpt::toString(), ossimString::toString(), ossimDrect::ul(), ossimDrect::ur(), and ossimRefPtr< T >::valid().

2243 {
2244  if ( ih )
2245  {
2246  if ( ih->setCurrentEntry(entry) )
2247  {
2248  ossimString prefix = "image";
2249  prefix = prefix + ossimString::toString(entry) + ".bounds.";
2250 
2252  if(geom.valid())
2253  {
2254  ossimDrect bounds;
2255  geom->getBoundingRect( bounds );
2256 
2257  // Make edge to edge.
2258  bounds.expand( ossimDpt(0.5, 0.5) );
2259 
2260  if( !bounds.hasNans() )
2261  {
2262  ossimGpt gPt;
2263 
2264  geom->localToWorld(bounds.ul(), gPt);
2265  kwl.add(prefix, "ul", gPt.toString().c_str(), true);
2266 
2267  geom->localToWorld(bounds.ur(), gPt);
2268  kwl.add(prefix, "ur", gPt.toString().c_str(), true);
2269 
2270  geom->localToWorld(bounds.lr(), gPt);
2271  kwl.add(prefix, "lr", gPt.toString().c_str(), true);
2272 
2273  geom->localToWorld(bounds.ll(), gPt);
2274  kwl.add(prefix, "ll", gPt.toString().c_str(), true);
2275  }
2276  }
2277 
2278  } // if ( ih->setCurrentEntry(entry) )
2279  else
2280  {
2282  << "Could not get image bounds for: " << ih->getFilename() << std::endl;
2283  }
2284 
2285  } // if ( ih )
2286 }
bool valid() const
Definition: ossimRefPtr.h:75
void getBoundingRect(ossimIrect &bounding_rect) const
Get the bounding rect of (0, 0) to (imageSize.x-1, imageSize.y-1).
const ossimDpt & ul() const
Definition: ossimDrect.h:339
static ossimString toString(bool aValue)
Numeric to string methods.
const ossimDrect & expand(const ossimDpt &padding)
Definition: ossimDrect.cpp:493
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual const ossimFilename & getFilename() const
Returns the filename.
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
bool hasNans() const
Definition: ossimDrect.h:396
const ossimDpt & ur() const
Definition: ossimDrect.h:340
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
const ossimDpt & ll() const
Definition: ossimDrect.h:342
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimGpt.cpp:78
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
const ossimDpt & lr() const
Definition: ossimDrect.h:341
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getImageGeometryInfo() [1/4]

void ossimInfo::getImageGeometryInfo ( ossimKeywordlist kwl,
bool  dnoFlag 
)

Populates keyword list with image geometry/projection information.

This requires open image.

Parameters
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.

Definition at line 1949 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getImageGeometryInfo(), and getImageInfo().

1950 {
1951  if ( m_img.valid() )
1952  {
1953  getImageGeometryInfo( m_img.get(), kwl, dnoFlag );
1954  }
1955 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImageGeometryInfo(ossimKeywordlist &kwl, bool dnoFlag)
Populates keyword list with image geometry/projection information.
Definition: ossimInfo.cpp:1949

◆ getImageGeometryInfo() [2/4]

bool ossimInfo::getImageGeometryInfo ( ossim_uint32  entry,
ossimKeywordlist kwl,
bool  dnoFlag 
)

Populates keyword list with image geometry/projection information.

Parameters
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.

This requires open image.

Returns
true if entry info was saved to keyword list false if not.

Definition at line 1980 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), getImageGeometryInfo(), m_img, and ossimRefPtr< T >::valid().

1981 {
1982  bool result = false;
1983  if ( m_img.valid() )
1984  {
1985  getImageGeometryInfo( m_img.get(), entry, kwl, dnoFlag );
1986  }
1987  return result;
1988 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImageGeometryInfo(ossimKeywordlist &kwl, bool dnoFlag)
Populates keyword list with image geometry/projection information.
Definition: ossimInfo.cpp:1949

◆ getImageGeometryInfo() [3/4]

void ossimInfo::getImageGeometryInfo ( ossimImageHandler ih,
ossimKeywordlist kwl,
bool  dnoFlag 
) const
private

Populates keyword list with image geometry/projection information.

Parameters
ihPointer to an image handler.
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.

Definition at line 1957 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimImageHandler::getEntryList(), getImageGeometryInfo(), and ossimKeywordNames::NUMBER_ENTRIES_KW.

1958 {
1959  if ( ih )
1960  { ossim_uint32 numEntries = 0;
1961 
1962  std::vector<ossim_uint32> entryList;
1963  ih->getEntryList(entryList);
1964 
1965  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
1966  while ( i != entryList.end() )
1967  {
1968  if ( getImageGeometryInfo( ih, (*i), kwl, dnoFlag ) )
1969  {
1970  ++numEntries;
1971  }
1972  ++i;
1973  }
1974 
1975  kwl.add(ossimKeywordNames::NUMBER_ENTRIES_KW, numEntries, true);
1976 
1977  } // if ( ih )
1978 }
static const char * NUMBER_ENTRIES_KW
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
unsigned int ossim_uint32
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
void getImageGeometryInfo(ossimKeywordlist &kwl, bool dnoFlag)
Populates keyword list with image geometry/projection information.
Definition: ossimInfo.cpp:1949

◆ getImageGeometryInfo() [4/4]

bool ossimInfo::getImageGeometryInfo ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl,
bool  dnoFlag 
) const
private

Populates keyword list with image geometry/projection information.

Parameters
ihPointer to an image handler.
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.
Returns
true if entry info was saved to keyword list false if not.

Definition at line 1990 of file ossimInfo.cpp.

References ossimKeywordlist::add(), DBL_EPSILON, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, ossimKeywordlist::find(), ossimImageHandler::getBoundingRect(), ossimImageHandler::getFilename(), ossimImageHandler::getImageGeometry(), ossimImageGeometry::getMetersPerPixel(), ossimDrect::height(), ossimSupportFilesList::instance(), isImageEntryOverview(), ossimGpt::latd(), ossimDrect::ll(), ossimImageGeometry::localToWorld(), ossimGpt::lon, ossimGpt::lond(), ossimDrect::lr(), ossimKeywordNames::METERS_PER_PIXEL_X_KW, ossimKeywordNames::METERS_PER_PIXEL_Y_KW, ossimNotify(), ossimNotifyLevel_WARN, ossimSupportFilesList::save(), ossimImageGeometry::saveState(), ossimImageHandler::setCurrentEntry(), ossimKeywordNames::TIE_POINT_LAT_KW, ossimKeywordNames::TIE_POINT_LON_KW, ossimString::toString(), ossimDrect::ul(), ossimDrect::ur(), ossimRefPtr< T >::valid(), ossimDrect::width(), ossimDpt::x, and ossimDpt::y.

1994 {
1995  bool result = false;
1996 
1997  if ( ih )
1998  {
1999  if ( ih->setCurrentEntry(entry) )
2000  {
2001  bool outputEntry = true;
2002  if ( dnoFlag )
2003  {
2004  if ( isImageEntryOverview() )
2005  {
2006  outputEntry = false;
2007  }
2008  }
2009 
2010  if ( outputEntry )
2011  {
2013  if(geom.valid())
2014  {
2015  result = true;
2016 
2017  ossimString prefix = "image";
2018  prefix = prefix + ossimString::toString(entry) + ossimString(".geometry.");
2019 
2020  geom->saveState(kwl, prefix);
2021 
2022  // Output support files list:
2023  ossimSupportFilesList::instance()->save(kwl, prefix);
2024 
2025  ossimGpt ulg;
2026  ossimGpt llg;
2027  ossimGpt lrg;
2028  ossimGpt urg;
2029 
2030  ossimDrect outputRect = ih->getBoundingRect();
2031 
2032  geom->localToWorld(outputRect.ul(), ulg);
2033  geom->localToWorld(outputRect.ll(), llg);
2034  geom->localToWorld(outputRect.lr(), lrg);
2035  geom->localToWorld(outputRect.ur(), urg);
2036 
2037  //---
2038  // *** HACK ***
2039  // Encountered CADRG RPF imagery where the left edge was longitude -180 and
2040  // right edge +180. The projection code above reasonably maps all -180 to +180.
2041  // This however breaks the image footprint since it would appear that the left
2042  // and right edges were coincident instead of 360 degrees apart, i.e., a line
2043  // segment instead of a rect. So added check here for coincident left and right
2044  // edges and remapping left edge to -180.
2045  //---
2046  if ((ulg.lon == 180.0) && (urg.lon == 180.0))
2047  {
2048  ulg.lon = -180.0;
2049  }
2050  if ((llg.lon == 180.0) && (lrg.lon == 180.0))
2051  {
2052  llg.lon = -180.0;
2053  }
2054 
2055  kwl.add(prefix, "ul_lat", ulg.latd(), true);
2056  kwl.add(prefix, "ul_lon", ulg.lond(), true);
2057  kwl.add(prefix, "ll_lat", llg.latd(), true);
2058  kwl.add(prefix, "ll_lon", llg.lond(), true);
2059  kwl.add(prefix, "lr_lat", lrg.latd(), true);
2060  kwl.add(prefix, "lr_lon", lrg.lond(), true);
2061  kwl.add(prefix, "ur_lat", urg.latd(), true);
2062  kwl.add(prefix, "ur_lon", urg.lond(), true);
2063 
2065  {
2066  kwl.add(prefix, ossimKeywordNames::TIE_POINT_LAT_KW, ulg.latd(), true);
2067  kwl.add(prefix, ossimKeywordNames::TIE_POINT_LON_KW, ulg.lond(), true);
2068 
2069  if ( outputRect.height()-1.0 > DBL_EPSILON )
2070  {
2072  fabs(ulg.latd()-llg.latd())/(outputRect.height()-1.0), true);
2073  }
2074 
2075  if ( outputRect.width()-1.0 > DBL_EPSILON )
2076  {
2078  fabs(ulg.lond()-urg.lond())/(outputRect.width()-1.0), true);
2079  }
2080  }
2081 
2082  ossimDpt gsd = geom->getMetersPerPixel();
2083  kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_X_KW, gsd.x, true);
2084  kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW, gsd.y, true);
2085 
2086  } // if(geom.valid())
2087 
2088  } // if ( outputEntry )
2089 
2090  } // if ( ih->setCurrentEntry(entry) )
2091 
2092  if ( !result )
2093  {
2095  << "No geometry for file " << ih->getFilename() << std::endl;
2096  }
2097 
2098  } // if ( ih )
2099 
2100  return result;
2101 
2102 } // End: ossimInfo::getImageGeometryInfo( ih, entry...
static const char * DECIMAL_DEGREES_PER_PIXEL_LAT
ossim_float64 width() const
Definition: ossimDrect.h:522
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
static ossimString toString(bool aValue)
Numeric to string methods.
static const char * TIE_POINT_LON_KW
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
static const char * METERS_PER_PIXEL_Y_KW
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossim_float64 lon
Definition: ossimGpt.h:266
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual const ossimFilename & getFilename() const
Returns the filename.
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
ossimDpt getMetersPerPixel() const
Returns the GSD associated with this image in the active projection.
static const char * DECIMAL_DEGREES_PER_PIXEL_LON
#define DBL_EPSILON
ossim_float64 height() const
Definition: ossimDrect.h:517
void save(ossimKeywordlist &kwl, const char *prefix) const
Output list to the kwl.
bool isImageEntryOverview() const
Definition: ossimInfo.cpp:2665
const ossimDpt & ur() const
Definition: ossimDrect.h:340
double x
Definition: ossimDpt.h:164
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the transform (if any) and projection (if any) states to the KWL.
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
const ossimDpt & ll() const
Definition: ossimDrect.h:342
static const char * TIE_POINT_LAT_KW
static ossimSupportFilesList * instance()
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
const ossimDpt & lr() const
Definition: ossimDrect.h:341
static const char * METERS_PER_PIXEL_X_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getImageHandler()

ossimRefPtr< ossimImageHandler > ossimInfo::getImageHandler ( )
Returns
Ref pointer to the image handler. Can be null if an image is not open.

Definition at line 1669 of file ossimInfo.cpp.

References m_img.

1670 {
1671  return m_img;
1672 }
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805

◆ getImageInfo() [1/6]

void ossimInfo::getImageInfo ( const ossimFilename file,
bool  dumpFlag,
bool  dnoFlag,
bool  imageGeomFlag,
bool  imageInfoFlag,
bool  metaDataFlag,
bool  paletteFlag,
ossimKeywordlist kwl 
) const

getImageInfo Method to open image "file" and get image info in the form of a ossimKeywordlist.

Flags turn on various pieces of info. These equate to options in ossim-info for image information.

Parameters
fileImage file to get information for.
dumpFlagossim-info -d
dnoFlagossim-info –dno
imageGeomFlagossim-info -p
imageInfoFlagossim-info -i
metaDataFlagossim-info -m
paletteFlagossim-info –palette
kwlInitialized by this method.

Definition at line 1532 of file ossimInfo.cpp.

References dumpImage(), ossimRefPtr< T >::get(), getImageGeometryInfo(), getImageMetadata(), getImagePalette(), openImageHandler(), and ossimRefPtr< T >::valid().

Referenced by getImageInfo().

1540 {
1541  if ( dumpFlag || dnoFlag )
1542  {
1543  dumpImage(file, dnoFlag, kwl);
1544  }
1545 
1546  // These flags requires open image.
1547  if ( imageGeomFlag || imageInfoFlag || metaDataFlag || paletteFlag )
1548  {
1549  // Note: openImageHandler throws ossimException if it can't open.
1551  if ( ih.valid() )
1552  {
1553  if ( metaDataFlag )
1554  {
1555  getImageMetadata( ih.get(), kwl );
1556  }
1557  if ( paletteFlag )
1558  {
1559  getImagePalette( ih.get(), kwl );
1560  }
1561  if ( imageInfoFlag )
1562  {
1563  getImageInfo( ih.get(), kwl, dnoFlag );
1564  }
1565  if ( imageGeomFlag )
1566  {
1567  getImageGeometryInfo( ih.get(), kwl, dnoFlag) ;
1568  }
1569  }
1570  }
1571 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > openImageHandler(const ossimFilename &file) const
Opens image.
Definition: ossimInfo.cpp:1629
void getImageInfo(const ossimFilename &file, bool dumpFlag, bool dnoFlag, bool imageGeomFlag, bool imageInfoFlag, bool metaDataFlag, bool paletteFlag, ossimKeywordlist &kwl) const
getImageInfo Method to open image "file" and get image info in the form of a ossimKeywordlist.
Definition: ossimInfo.cpp:1532
void getImageMetadata(ossimKeywordlist &kwl) const
Populates keyword list with metadata.
Definition: ossimInfo.cpp:1722
void dumpImage(const ossimFilename &file, bool dnoFlag, ossimKeywordlist &kwl) const
Dumps the image information from ossimInfoFactoryRegistry to keyword list.
Definition: ossimInfo.cpp:1702
void getImagePalette(ossimKeywordlist &kwl)
Populates keyword list with palette data.
Definition: ossimInfo.cpp:1777
void getImageGeometryInfo(ossimKeywordlist &kwl, bool dnoFlag)
Populates keyword list with image geometry/projection information.
Definition: ossimInfo.cpp:1949

◆ getImageInfo() [2/6]

bool ossimInfo::getImageInfo ( const ossimFilename file,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const

getImageInfo Method to open image "file" and get image info for entry in the form of a ossimKeywordlist.

Equivalent of ossim-info -i -p <image> for entry.

Throws ossimException on error if file cannot be opened or entry is invalid.

Parameters
fileImage file to get information for.
entryEntry index to open.
Returns
true on success, false on error.

Definition at line 1573 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), getImageGeometryInfo(), getImageInfo(), openImageHandler(), ossimImageHandler::setCurrentEntry(), and ossimRefPtr< T >::valid().

1576 {
1577  bool result = false;
1578 
1579  // Note: openImageHandler throws ossimException if it can't open.
1581  if ( ih.valid() )
1582  {
1583  if ( ih->setCurrentEntry( entry ) )
1584  {
1585  if ( getImageInfo( ih.get(), entry, kwl, false ) )
1586  {
1587  result = getImageGeometryInfo( ih.get(), entry, kwl, false );
1588  }
1589  }
1590  else
1591  {
1592  std::ostringstream errMsg;
1593  errMsg << "ossimInfo::getImageInfo ERROR:\nInvalid entry: " << entry
1594  << "\n";
1595  throw ossimException( errMsg.str() );
1596  }
1597  }
1598 
1599  return result;
1600 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > openImageHandler(const ossimFilename &file) const
Opens image.
Definition: ossimInfo.cpp:1629
void getImageInfo(const ossimFilename &file, bool dumpFlag, bool dnoFlag, bool imageGeomFlag, bool imageInfoFlag, bool metaDataFlag, bool paletteFlag, ossimKeywordlist &kwl) const
getImageInfo Method to open image "file" and get image info in the form of a ossimKeywordlist.
Definition: ossimInfo.cpp:1532
void getImageGeometryInfo(ossimKeywordlist &kwl, bool dnoFlag)
Populates keyword list with image geometry/projection information.
Definition: ossimInfo.cpp:1949
virtual bool setCurrentEntry(ossim_uint32 entryIdx)

◆ getImageInfo() [3/6]

void ossimInfo::getImageInfo ( ossimKeywordlist kwl,
bool  dnoFlag 
)

Populates keyword list with general image information.

This requires open image.

Parameters
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.

Definition at line 1809 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), getImageInfo(), m_img, and ossimRefPtr< T >::valid().

1810 {
1811  if ( m_img.valid() )
1812  {
1813  getImageInfo( m_img.get(), kwl, dnoFlag );
1814  }
1815 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImageInfo(const ossimFilename &file, bool dumpFlag, bool dnoFlag, bool imageGeomFlag, bool imageInfoFlag, bool metaDataFlag, bool paletteFlag, ossimKeywordlist &kwl) const
getImageInfo Method to open image "file" and get image info in the form of a ossimKeywordlist.
Definition: ossimInfo.cpp:1532

◆ getImageInfo() [4/6]

bool ossimInfo::getImageInfo ( ossim_uint32  entry,
ossimKeywordlist kwl,
bool  dnoFlag 
)

Populates keyword list with general image information.

Parameters
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.

This requires open image.

Returns
true if entry info was saved to keyword list false if not.

Definition at line 1841 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), getImageInfo(), m_img, and ossimRefPtr< T >::valid().

1842 {
1843  bool result = false;
1844  if ( m_img.valid() )
1845  {
1846  result = getImageInfo( m_img.get(), entry, kwl, dnoFlag );
1847  }
1848  return result;
1849 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImageInfo(const ossimFilename &file, bool dumpFlag, bool dnoFlag, bool imageGeomFlag, bool imageInfoFlag, bool metaDataFlag, bool paletteFlag, ossimKeywordlist &kwl) const
getImageInfo Method to open image "file" and get image info in the form of a ossimKeywordlist.
Definition: ossimInfo.cpp:1532

◆ getImageInfo() [5/6]

void ossimInfo::getImageInfo ( ossimImageHandler ih,
ossimKeywordlist kwl,
bool  dnoFlag 
) const
private

Populates keyword list with general image information.

Parameters
ihPointer to an image handler.
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.

Definition at line 1817 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimImageHandler::getEntryList(), getImageInfo(), and ossimKeywordNames::NUMBER_ENTRIES_KW.

1818 {
1819  if ( ih )
1820  {
1821  ossim_uint32 numEntries = 0;
1822 
1823  std::vector<ossim_uint32> entryList;
1824  ih->getEntryList(entryList);
1825 
1826  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
1827  while ( i != entryList.end() )
1828  {
1829  if ( getImageInfo( ih, (*i), kwl, dnoFlag ) )
1830  {
1831  ++numEntries;
1832  }
1833  ++i;
1834  }
1835 
1836  kwl.add(ossimKeywordNames::NUMBER_ENTRIES_KW, numEntries, true);
1837 
1838  } // if ( ih )
1839 }
static const char * NUMBER_ENTRIES_KW
void getImageInfo(const ossimFilename &file, bool dumpFlag, bool dnoFlag, bool imageGeomFlag, bool imageInfoFlag, bool metaDataFlag, bool paletteFlag, ossimKeywordlist &kwl) const
getImageInfo Method to open image "file" and get image info in the form of a ossimKeywordlist.
Definition: ossimInfo.cpp:1532
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
unsigned int ossim_uint32
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const

◆ getImageInfo() [6/6]

bool ossimInfo::getImageInfo ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl,
bool  dnoFlag 
) const
private

Populates keyword list with general image information.

Parameters
ihPointer to an image handler.
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.
Returns
true if entry info was saved to keyword list false if not.

Definition at line 1851 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimKeywordNames::ENTRY_KW, ossimImageHandler::getBoundingRect(), ossimObject::getClassName(), ossimImageHandler::getEntryName(), ossimImageHandler::getMaxPixelValue(), ossimImageHandler::getMinPixelValue(), ossimImageHandler::getNullPixelValue(), ossimImageHandler::getNumberOfDecimationLevels(), ossimImageSource::getNumberOfInputBands(), ossimImageSource::getNumberOfOutputBands(), ossimImageSource::getOutputScalarType(), ossimImageHandler::getOverview(), getRadiometry(), getRgbBands(), ossimObject::getShortName(), ossimDrect::height(), isImageEntryOverview(), ossimDrect::lr(), ossimKeywordNames::LR_X_KW, ossimKeywordNames::LR_Y_KW, ossimKeywordNames::NUMBER_INPUT_BANDS_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimImageHandler::setCurrentEntry(), ossimString::toString(), ossimDrect::ul(), ossimKeywordNames::UL_X_KW, ossimKeywordNames::UL_Y_KW, ossimDrect::width(), ossimDpt::x, and ossimDpt::y.

1853 {
1854  bool result = false;
1855 
1856  if ( ih )
1857  {
1858  if ( ih->setCurrentEntry(entry) )
1859  {
1860  bool outputEntry = true;
1861  if ( dnoFlag )
1862  {
1863  if ( isImageEntryOverview() )
1864  {
1865  outputEntry = false;
1866  }
1867  }
1868 
1869  if ( outputEntry )
1870  {
1871  result = true;
1872 
1873  // Entry number:
1874  ossimString prefix = "image";
1875  prefix = prefix + ossimString::toString(entry) + ".";
1876  kwl.add(prefix.c_str(), ossimKeywordNames::ENTRY_KW, entry, true);
1877 
1878  // Get the entry_name (specialized multi-entry readers only):
1879  std::string entryName;
1880  ih->getEntryName( entry, entryName );
1881  if ( entryName.size() )
1882  {
1883  kwl.add(prefix.c_str(), "entry_name", entryName.c_str(), true);
1884  }
1885 
1886  // Type/class of reader:
1887  kwl.add(prefix, "type", ih->getClassName().c_str(), true);
1888 
1889  // Add RGB bands if available:
1890  getRgbBands( ih, entry, kwl );
1891 
1892  // Driver name if different from class name:
1893  if ( ih->getClassName() != ih->getShortName() )
1894  {
1895  kwl.add(prefix, "driver", ih->getShortName().c_str(), true);
1896  }
1897 
1898  // Type/class of overview reader:
1899  if (ih->getOverview())
1900  {
1901  kwl.add(prefix, "overview.type",
1902  ih->getOverview()->getClassName().c_str(), true);
1903  }
1904 
1905  ossimDrect boundingRect = ih->getBoundingRect();
1906  kwl.add(prefix,ossimKeywordNames::UL_X_KW, boundingRect.ul().x, true);
1907  kwl.add(prefix,ossimKeywordNames::UL_Y_KW, boundingRect.ul().y, true);
1908  kwl.add(prefix,ossimKeywordNames::LR_X_KW, boundingRect.lr().x, true);
1909  kwl.add(prefix,ossimKeywordNames::LR_Y_KW, boundingRect.lr().y, true);
1910 
1911  const ossim_uint32 BANDS = ih->getNumberOfInputBands();
1912  kwl.add(prefix,ossimKeywordNames::NUMBER_INPUT_BANDS_KW, BANDS, true);
1914  ih->getNumberOfOutputBands(), true);
1916  boundingRect.height(), true);
1918  boundingRect.width(), true);
1919 
1920  ossimScalarType scalar = ih->getOutputScalarType();
1921 
1922  for(ossim_uint32 i = 0; i < BANDS; ++i)
1923  {
1924  ossimString band = ossimString("band") + ossimString::toString(i) + ".";
1925 
1926  kwl.add(prefix, band+"null_value", ih->getNullPixelValue(i), true);
1927  kwl.add(prefix, band+"min_value", ih->getMinPixelValue(i), true);
1928  kwl.add(prefix, band+"max_value", ih->getMaxPixelValue(i), true);
1929  }
1930 
1931  // Output Radiometry.
1932  std::string rad;
1933  getRadiometry(scalar, rad);
1934  kwl.add(prefix, "radiometry", rad.c_str(), true);
1935  kwl.add(prefix,"number_decimation_levels", ih->getNumberOfDecimationLevels(), true);
1936 
1937 
1938 
1939  } // if ( outputEntry )
1940 
1941  } // if ( ih->setCurrentEntry(entry) )
1942 
1943  } // if ( ih )
1944 
1945  return result;
1946 
1947 } // End: ossimInfo::getImageInfo( ih, entry...
ossim_float64 width() const
Definition: ossimDrect.h:522
static const char * LR_X_KW
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
void getRadiometry(ossimScalarType scalar, std::string &s) const
Gets the radiometry string, i.e.
Definition: ossimInfo.cpp:3290
static ossimString toString(bool aValue)
Numeric to string methods.
static const char * NUMBER_LINES_KW
virtual const ossimImageHandler * getOverview() const
static const char * NUMBER_INPUT_BANDS_KW
virtual void getEntryName(ossim_uint32 entryIdx, std::string &name) const
Get the name of entry as a string.
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
virtual ossimString getShortName() const
Definition: ossimObject.cpp:48
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
virtual double getMinPixelValue(ossim_uint32 band=0) const
Retuns the min pixel value.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
bool getRgbBands(ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
Populates keyword list with rgb bands if available.
Definition: ossimInfo.cpp:2608
static const char * LR_Y_KW
static const char * UL_X_KW
unsigned int ossim_uint32
static const char * NUMBER_OUTPUT_BANDS_KW
static const char * UL_Y_KW
ossim_float64 height() const
Definition: ossimDrect.h:517
bool isImageEntryOverview() const
Definition: ossimInfo.cpp:2665
ossimScalarType
static const char * ENTRY_KW
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
double x
Definition: ossimDpt.h:164
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
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
virtual ossim_uint32 getNumberOfInputBands() const =0
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
const ossimDpt & lr() const
Definition: ossimDrect.h:341
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
static const char * NUMBER_SAMPLES_KW

◆ getImageMetadata() [1/2]

void ossimInfo::getImageMetadata ( ossimKeywordlist kwl) const

Populates keyword list with metadata.

This requires open image.

Parameters
kwlKeyword list to populate.

Definition at line 1722 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getImageInfo().

1723 {
1724  if ( m_img.valid() )
1725  {
1726  getImageMetadata( m_img.get(), kwl);
1727  }
1728 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImageMetadata(ossimKeywordlist &kwl) const
Populates keyword list with metadata.
Definition: ossimInfo.cpp:1722

◆ getImageMetadata() [2/2]

void ossimInfo::getImageMetadata ( const ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Populates keyword list with metadata.

Parameters
ihPointer to an image handler.
kwlKeyword list to populate.

Definition at line 1730 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimPropertyInterface::getPropertyList(), ossimContainerProperty::getPropertyList(), and PTR_CAST.

1731 {
1732  if ( ih )
1733  {
1734  std::vector< ossimRefPtr< ossimProperty > > list;
1735  ih->getPropertyList(list);
1736  std::vector< ossimRefPtr< ossimProperty > >::const_iterator i = list.begin();
1737  while (i != list.end())
1738  {
1739  if ( (*i).valid() )
1740  {
1741  ossimString key;
1742  ossimString value;
1743 
1744  // Check for one level of nested container.
1745  if ((*i)->getClassName() == "ossimContainerProperty")
1746  {
1748  if (ptr)
1749  {
1750  std::vector< ossimRefPtr< ossimProperty > > list2;
1751  ptr->getPropertyList(list2);
1752 
1753  std::vector< ossimRefPtr< ossimProperty > >::const_iterator i2 = list2.begin();
1754  while (i2 != list2.end())
1755  {
1756  key = (*i2)->getName();
1757  value = (*i2)->valueToString();
1758  kwl.add(key.c_str(), value.c_str(), true);
1759  ++i2;
1760  }
1761  }
1762  }
1763  else // Not a container.
1764  {
1765  key = (*i)->getName();
1766  value = (*i)->valueToString();
1767  kwl.add(key.c_str(), value.c_str(), true);
1768  }
1769  }
1770  ++i;
1771  }
1772 
1773  } // if ( ih )
1774 
1775 } // End: getImageMetadata(ossimImageHandler* ih, ossimKeywordlist& kwl)
void getPropertyList(std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
virtual void getPropertyList(std::vector< ossimRefPtr< ossimProperty > > &children) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
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

◆ getImagePalette() [1/2]

void ossimInfo::getImagePalette ( ossimKeywordlist kwl)

Populates keyword list with palette data.

This requires open image.

Parameters
kwlKeyword list to populate.

Definition at line 1777 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getImageInfo().

1778 {
1779  if ( m_img.valid() )
1780  {
1781  getImagePalette( m_img.get(), kwl );
1782  }
1783 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImagePalette(ossimKeywordlist &kwl)
Populates keyword list with palette data.
Definition: ossimInfo.cpp:1777

◆ getImagePalette() [2/2]

void ossimInfo::getImagePalette ( ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Populates keyword list with palette data.

Parameters
ihPointer to an image handler.
kwlKeyword list to populate.

Definition at line 1785 of file ossimInfo.cpp.

References ossimImageHandler::getEntryList(), ossimImageHandler::getLut(), ossimImageHandler::getNumberOfEntries(), ossimNBandLutDataObject::saveState(), ossimImageHandler::setCurrentEntry(), ossimString::toString(), and ossimRefPtr< T >::valid().

1786 {
1787  if ( ih )
1788  {
1789  if(ih->getLut().valid())
1790  {
1791  ossim_uint32 entryIdx = 0;
1792  std::vector<ossim_uint32> entryList;
1793  ih->getEntryList(entryList);
1794  for(entryIdx = 0; entryIdx < ih->getNumberOfEntries();++entryIdx)
1795  {
1796  ih->setCurrentEntry(entryList[entryIdx]);
1797  ossimString prefix = "image";
1798  prefix = prefix + ossimString::toString(entryList[entryIdx]) + ".lut.";
1799  if(ih->getLut().valid())
1800  {
1801  ih->getLut()->saveState(kwl, prefix);
1802  }
1803  }
1804  }
1805 
1806  } // if ( ih )
1807 }
virtual ossimRefPtr< ossimNBandLutDataObject > getLut() const
bool valid() const
Definition: ossimRefPtr.h:75
static ossimString toString(bool aValue)
Numeric to string methods.
unsigned int ossim_uint32
virtual ossim_uint32 getNumberOfEntries() const
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual bool setCurrentEntry(ossim_uint32 entryIdx)

◆ getImageRect() [1/4]

void ossimInfo::getImageRect ( ossimKeywordlist kwl)

Populates keyword list with image rectangle.

This requires open image.

Parameters
kwlKeyword list to populate.

Definition at line 2584 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getImageRect().

2585 {
2586  if ( m_img.valid() )
2587  {
2588  getImageRect( m_img.get(), kwl );
2589  }
2590 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImageRect(ossimKeywordlist &kwl)
Populates keyword list with image rectangle.
Definition: ossimInfo.cpp:2584

◆ getImageRect() [2/4]

void ossimInfo::getImageRect ( ossim_uint32  entry,
ossimKeywordlist kwl 
)

Populates keyword list with image rectangle.

Parameters
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.

This requires open image.

Definition at line 2632 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), getImageRect(), m_img, and ossimRefPtr< T >::valid().

2633 {
2634  if ( m_img.valid() )
2635  {
2636  getImageRect( m_img.get(), entry, kwl );
2637  }
2638 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
void getImageRect(ossimKeywordlist &kwl)
Populates keyword list with image rectangle.
Definition: ossimInfo.cpp:2584

◆ getImageRect() [3/4]

void ossimInfo::getImageRect ( ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Populates keyword list with image rectangle.

Parameters
kwlKeyword list to populate.

Definition at line 2592 of file ossimInfo.cpp.

References ossimImageHandler::getEntryList(), and getImageRect().

2593 {
2594  if ( ih )
2595  {
2596  std::vector<ossim_uint32> entryList;
2597  ih->getEntryList(entryList);
2598 
2599  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2600  while ( i != entryList.end() )
2601  {
2602  getImageRect( ih, (*i), kwl );
2603  ++i;
2604  }
2605  } // if ( ih )
2606 }
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
void getImageRect(ossimKeywordlist &kwl)
Populates keyword list with image rectangle.
Definition: ossimInfo.cpp:2584

◆ getImageRect() [4/4]

void ossimInfo::getImageRect ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const
private

Populates keyword list with image rectangle.

Parameters
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.

Definition at line 2640 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimImageHandler::getBoundingRect(), ossimImageHandler::getFilename(), ossimNotify(), ossimNotifyLevel_WARN, ossimImageHandler::setCurrentEntry(), ossimIrect::toString(), and ossimString::toString().

2643 {
2644  if ( ih )
2645  {
2646  if ( ih->setCurrentEntry(entry) )
2647  {
2648  ossimString prefix = "image";
2649  prefix = prefix + ossimString::toString(entry) + ".";
2650  ossimIrect outputRect = ih->getBoundingRect();
2651  kwl.add(prefix, "image_rectangle", outputRect.toString().c_str(), true);
2652 
2653  } // if ( ih->setCurrentEntry(entry) )
2654  else
2655  {
2657  << "Could not get image rectangle for: " << ih->getFilename() << std::endl;
2658  }
2659 
2660  } // if ( ih )
2661 
2662 } // End: getImageRect( ih, entry...
static ossimString toString(bool aValue)
Numeric to string methods.
ossimString toString() const
Definition: ossimIrect.cpp:332
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual const ossimFilename & getFilename() const
Returns the filename.
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
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getImageToGround() [1/2]

void ossimInfo::getImageToGround ( ossimKeywordlist kwl)

Populates keyword list with image_to_ground.

It will outoput image_point and ground_point

Parameters
kwlKeyword list to populate.

This requires open image.

◆ getImageToGround() [2/2]

void ossimInfo::getImageToGround ( ossim_uint32  entry,
ossimKeywordlist kwl 
)

Populates keyword list with image_to_ground.

It will outoput image_point and ground_point

Parameters
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.

This requires open image.

◆ getImg2grd() [1/3]

void ossimInfo::getImg2grd ( ossimKeywordlist kwl)

Populates keyword list with ground point for image point.

Associated input key values: "img2grd: <x> <y>" Output key: image0.ground_point: (lat,lon,hgt,datum)

Parameters
kwlKeyword list to populate.

Definition at line 2288 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getImg2grd().

2289 {
2290  if ( m_img.valid() )
2291  {
2292  getImg2grd( m_img.get(), kwl );
2293  }
2294 }
bool valid() const
Definition: ossimRefPtr.h:75
void getImg2grd(ossimKeywordlist &kwl)
Populates keyword list with ground point for image point.
Definition: ossimInfo.cpp:2288
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805

◆ getImg2grd() [2/3]

void ossimInfo::getImg2grd ( ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Gets gound point from image point.

Input key:value "img2grd: <x> <y>"

Parameters
Pointerto an image handler.
kwlKeyword list to populate.

Definition at line 2296 of file ossimInfo.cpp.

References ossimImageHandler::getEntryList(), and getImg2grd().

2297 {
2298  if ( ih )
2299  {
2300  std::vector<ossim_uint32> entryList;
2301  ih->getEntryList(entryList);
2302 
2303  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2304  while ( i != entryList.end() )
2305  {
2306  getImg2grd( ih, (*i), kwl );
2307  ++i;
2308  }
2309  }
2310 }
void getImg2grd(ossimKeywordlist &kwl)
Populates keyword list with ground point for image point.
Definition: ossimInfo.cpp:2288
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const

◆ getImg2grd() [3/3]

void ossimInfo::getImg2grd ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const
private

Gets gound point from image point.

Input key:value "img2grd: <x> <y>"

Parameters
Pointerto an image handler.
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.

Definition at line 2312 of file ossimInfo.cpp.

References ossimDrect::expand(), ossimKeywordlist::findKey(), ossimImageGeometry::getBoundingRect(), ossimImageHandler::getImageGeometry(), ossimDrect::hasNans(), ossimTool::m_kwl, ossimImageHandler::setCurrentEntry(), ossimString::toString(), and ossimRefPtr< T >::valid().

2315 {
2316  if ( ih )
2317  {
2318  if ( ih->setCurrentEntry(entry) )
2319  {
2320  ossimString prefix = "image";
2321  prefix = prefix + ossimString::toString(entry) + ".";
2322 
2324  if(geom.valid())
2325  {
2326 
2327  ossimDrect bounds;
2328  geom->getBoundingRect( bounds );
2329 
2330  if( !bounds.hasNans() )
2331  {
2332  //---
2333  // Expand the bounds out to edge of image so caller can do:
2334  // ossim-info --img2grd -0.5 -0.5 <image.tif>
2335  //---
2336  bounds.expand( ossimDpt(0.5, 0.5) );
2337  std::string value = m_kwl.findKey( IMG2GRD_KW );
2338  if ( value.size() )
2339  {
2340  ossimDpt ipt;
2341  ipt.toPoint( value );
2342  if ( bounds.pointWithin( ipt ) )
2343  {
2344  ossimGpt gpt;
2345  gpt.makeNan();
2346  geom->localToWorld(ipt, gpt);
2347  kwl.add(prefix, "ground_point", gpt.toString().c_str(), true);
2348  }
2349  else
2350  {
2351  kwl.add(prefix, "ground_point", "nan", true);
2352  }
2353  }
2354  }
2355  }
2356 
2357  } // if ( ih->setCurrentEntry(entry) )
2358  else
2359  {
2361  << "Could not get ground center for: " << ih->getFilename() << std::endl;
2362  }
2363 
2364  } // if ( ih )
2365 }
bool pointWithin(const ossimDpt &pt, double epsilon=0.0) const
Definition: ossimDrect.h:781
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
bool valid() const
Definition: ossimRefPtr.h:75
void getBoundingRect(ossimIrect &bounding_rect) const
Get the bounding rect of (0, 0) to (imageSize.x-1, imageSize.y-1).
void makeNan()
Definition: ossimGpt.h:130
static ossimString toString(bool aValue)
Numeric to string methods.
ossimKeywordlist m_kwl
Definition: ossimTool.h:148
const ossimDrect & expand(const ossimDpt &padding)
Definition: ossimDrect.cpp:493
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual const ossimFilename & getFilename() const
Returns the filename.
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
void toPoint(const std::string &s)
Initializes this point from string.
Definition: ossimDpt.cpp:192
bool hasNans() const
Definition: ossimDrect.h:396
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
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimGpt.cpp:78
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getNorthUpAngle() [1/4]

void ossimInfo::getNorthUpAngle ( ossimKeywordlist kwl)

Populates keyword list with north_up_angle.

Parameters
kwlKeyword list to populate.

This requires open image.

Definition at line 2519 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getNorthUpAngle().

2520 {
2521  if ( m_img.valid() )
2522  {
2523  getNorthUpAngle( m_img.get(), kwl );
2524  }
2525 }
void getNorthUpAngle(ossimKeywordlist &kwl)
Populates keyword list with north_up_angle.
Definition: ossimInfo.cpp:2519
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805

◆ getNorthUpAngle() [2/4]

void ossimInfo::getNorthUpAngle ( ossim_uint32  entry,
ossimKeywordlist kwl 
)

Populates keyword list with north_up_angle.

Parameters
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.

This requires open image.

Definition at line 2543 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), getNorthUpAngle(), m_img, and ossimRefPtr< T >::valid().

2544 {
2545  if ( m_img.valid() )
2546  {
2547  getNorthUpAngle( m_img.get(), entry, kwl );
2548  }
2549 }
void getNorthUpAngle(ossimKeywordlist &kwl)
Populates keyword list with north_up_angle.
Definition: ossimInfo.cpp:2519
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805

◆ getNorthUpAngle() [3/4]

void ossimInfo::getNorthUpAngle ( ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Populates keyword list with north_up_angle.

Parameters
kwlKeyword list to populate.

Definition at line 2527 of file ossimInfo.cpp.

References ossimImageHandler::getEntryList(), and getNorthUpAngle().

2528 {
2529  if ( ih )
2530  {
2531  std::vector<ossim_uint32> entryList;
2532  ih->getEntryList(entryList);
2533 
2534  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2535  while ( i != entryList.end() )
2536  {
2537  getNorthUpAngle( ih, (*i), kwl );
2538  ++i;
2539  }
2540  }
2541 }
void getNorthUpAngle(ossimKeywordlist &kwl)
Populates keyword list with north_up_angle.
Definition: ossimInfo.cpp:2519
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const

◆ getNorthUpAngle() [4/4]

void ossimInfo::getNorthUpAngle ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const
private

Populates keyword list with north_up_angle.

Parameters
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.

Definition at line 2551 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimImageHandler::getImageGeometry(), ossimImageGeometry::northUpAngle(), ossimImageHandler::setCurrentEntry(), ossimString::toString(), and ossimRefPtr< T >::valid().

2554 {
2555  if ( ih )
2556  {
2557  bool result = false;
2558 
2559  if ( ih->setCurrentEntry(entry) )
2560  {
2561  ossimString prefix = "image";
2562  prefix = prefix + ossimString::toString(entry) + ".";
2563 
2565  if(geom.valid())
2566  {
2567  ossim_float64 northUp = geom->northUpAngle();
2568  kwl.add(prefix, NORTH_UP_KW, northUp, true);
2569  }
2570 
2571  result = true;
2572 
2573  } // if ( ih->setCurrentEntry(entry) )
2574 
2575  if ( !result )
2576  {
2578  << "Could not get north up angle for: " << ih->getFilename() << std::endl;
2579  }
2580 
2581  } // if ( ih )
2582 }
bool valid() const
Definition: ossimRefPtr.h:75
static ossimString toString(bool aValue)
Numeric to string methods.
double ossim_float64
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual const ossimFilename & getFilename() const
Returns the filename.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
ossim_float64 northUpAngle() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getRadiometry()

void ossimInfo::getRadiometry ( ossimScalarType  scalar,
std::string &  s 
) const

Gets the radiometry string, i.e.

"8-bit" and so on, from scalar.

Parameters
scalarScalar type.
sString to initialize.

Definition at line 3290 of file ossimInfo.cpp.

References OSSIM_DOUBLE, OSSIM_FLOAT32, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SINT16, OSSIM_SINT32, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, and OSSIM_USHORT15.

Referenced by getImageInfo().

3291 {
3292  // Output Radiometry.
3293  switch(scalar)
3294  {
3295  case OSSIM_UINT8:
3296  {
3297  s = "8-bit";
3298  break;
3299  }
3300  case OSSIM_USHORT11:
3301  {
3302  s = "11-bit";
3303  break;
3304  }
3305  case OSSIM_USHORT12:
3306  {
3307  s = "12-bit";
3308  break;
3309  }
3310  case OSSIM_USHORT13:
3311  {
3312  s = "13-bit";
3313  break;
3314  }
3315  case OSSIM_USHORT14:
3316  {
3317  s = "14-bit";
3318  break;
3319  }
3320  case OSSIM_USHORT15:
3321  {
3322  s = "15-bit";
3323  break;
3324  }
3325  case OSSIM_UINT16:
3326  {
3327  s = "16-bit unsigned";
3328  break;
3329  }
3330  case OSSIM_SINT16:
3331  {
3332  s = "16-bit signed";
3333  break;
3334  }
3335  case OSSIM_UINT32:
3336  {
3337  s = "32-bit unsigned";
3338  break;
3339  }
3340  case OSSIM_SINT32:
3341  {
3342  s = "32-bit signed";
3343  break;
3344  }
3345  case OSSIM_FLOAT32:
3346  {
3347  s = "32-bit float";
3348  break;
3349  }
3350  case OSSIM_DOUBLE:
3351  {
3352  s = "64-bit double float";
3353  break;
3354  }
3356  {
3357  s = "normalized 32-bit float";
3358  break;
3359  }
3361  {
3362  s = "normalized 64-bit double float";
3363  break;
3364  }
3365  default:
3366  {
3367  s = "unknown";
3368  break;
3369  }
3370  }
3371 }
16 bit unsigned integer (15 bits used)
16 bit unsigned integer
16 bit signed integer
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
32 bit floating point
32 bit unsigned integer
32 bit signed integer
32 bit normalized floating point
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
8 bit unsigned integer
64 bit floating point
16 bit unsigned integer (12 bits used)

◆ getRevisionNumber()

void ossimInfo::getRevisionNumber ( std::string &  s) const

Gets revision number.

Parameters
sString to initialize.

Definition at line 3382 of file ossimInfo.cpp.

References OSSIM_REVISION.

3383 {
3384 #ifdef OSSIM_REVISION
3385  s = OSSIM_REVISION;
3386 #else
3387  s = "unknown";
3388 #endif
3389 }
#define OSSIM_REVISION
Definition: ossimVersion.h:9

◆ getRgbBands()

bool ossimInfo::getRgbBands ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const
private

Populates keyword list with rgb bands if available.

This is image handler specific and within image handler specific to internal metadata, e.g. NITF IREPBAND keys.

Example of key:value: rgb_bands:(2,1,0)

Parameters
ihPointer to image handler.
entryCurrent entry of image handler.
kwlKeyword list to populate.
Returns
true on success; false, on error.

Definition at line 2608 of file ossimInfo.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimImageHandler::getRgbBandList(), and ossimString::toString().

Referenced by getImageInfo().

2610 {
2611  bool result = false;
2612  if ( ih )
2613  {
2614  std::vector<ossim_uint32> bandList;
2615  result = ih->getRgbBandList( bandList );
2616  if ( result && ( bandList.size() == 3 ) )
2617  {
2618  ossimString os;
2619  ossim::toSimpleStringList<ossim_uint32>(os, bandList);
2620  if ( os.size() )
2621  {
2622  ossimString prefix = "image";
2623  prefix = prefix + ossimString::toString(entry) + ".";
2624  kwl.add(prefix, "rgb_bands", os.c_str(), true);
2625  }
2626  }
2627  }
2628  return result;
2629 
2630 } // End: ossimInfo::getRgbBands( ... )
static ossimString toString(bool aValue)
Numeric to string methods.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual bool getRgbBandList(std::vector< ossim_uint32 > &bandList) const
Convenience method to get the zero based rgb output band list.

◆ getUpIsUpAngle() [1/4]

void ossimInfo::getUpIsUpAngle ( ossimKeywordlist kwl)

Populates keyword list with up_is_up_angle.

Parameters
kwlKeyword list to populate.

This requires open image.

Definition at line 2427 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getUpIsUpAngle().

2428 {
2429  if ( m_img.valid() )
2430  {
2431  getUpIsUpAngle( m_img.get(), kwl );
2432  }
2433 }
void getUpIsUpAngle(ossimKeywordlist &kwl)
Populates keyword list with up_is_up_angle.
Definition: ossimInfo.cpp:2427
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805

◆ getUpIsUpAngle() [2/4]

void ossimInfo::getUpIsUpAngle ( ossim_uint32  entry,
ossimKeywordlist kwl 
)

Populates keyword list with up_is_up_angle.

Parameters
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.
dnoFlagIf true no entries flaged as overviews will be output.

This requires open image.

Definition at line 2451 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), getUpIsUpAngle(), m_img, and ossimRefPtr< T >::valid().

2452 {
2453  if ( m_img.valid() )
2454  {
2455  getUpIsUpAngle( m_img.get(), entry, kwl );
2456  }
2457 }
void getUpIsUpAngle(ossimKeywordlist &kwl)
Populates keyword list with up_is_up_angle.
Definition: ossimInfo.cpp:2427
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805

◆ getUpIsUpAngle() [3/4]

void ossimInfo::getUpIsUpAngle ( ossimImageHandler ih,
ossimKeywordlist kwl 
) const
private

Populates keyword list with up_is_up_angle.

Parameters
kwlKeyword list to populate.

Definition at line 2435 of file ossimInfo.cpp.

References ossimImageHandler::getEntryList(), and getUpIsUpAngle().

2436 {
2437  if ( ih )
2438  {
2439  std::vector<ossim_uint32> entryList;
2440  ih->getEntryList(entryList);
2441 
2442  std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2443  while ( i != entryList.end() )
2444  {
2445  getUpIsUpAngle( ih, (*i), kwl );
2446  ++i;
2447  }
2448  }
2449 }
void getUpIsUpAngle(ossimKeywordlist &kwl)
Populates keyword list with up_is_up_angle.
Definition: ossimInfo.cpp:2427
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const

◆ getUpIsUpAngle() [4/4]

void ossimInfo::getUpIsUpAngle ( ossimImageHandler ih,
ossim_uint32  entry,
ossimKeywordlist kwl 
) const
private

Populates keyword list with up_is_up_angle.

Parameters
entryEntry number to select. Note this is the entry number from the getEntryList call not a simple zero based entry index.
kwlKeyword list to populate.

Definition at line 2459 of file ossimInfo.cpp.

References ossimKeywordlist::find(), ossimImageHandler::getImageGeometry(), ossimImageGeometry::isAffectedByElevation(), ossimTool::m_kwl, ossimDpt::makeNan(), ossimImageHandler::setCurrentEntry(), ossimString::toString(), and ossimRefPtr< T >::valid().

2462 {
2463  if ( ih )
2464  {
2465  bool result = false;
2466 
2467  if ( ih->setCurrentEntry(entry) )
2468  {
2469  ossimString prefix = "image";
2470  prefix = prefix + ossimString::toString(entry) + ".";
2471 
2473  if(geom.valid())
2474  {
2475  ossim_float64 upIsUp = 0.0;
2476  if ( geom->isAffectedByElevation() )
2477  {
2478  ossimDpt imagePt;
2479  imagePt.makeNan();
2480  ossimString lookup = m_kwl.find(UP_IS_UP_GPT_KW);
2481  if(!lookup.empty())
2482  {
2483  std::istringstream in(lookup.c_str());
2484  ossim_float64 lat,lon;
2485  in>>lat>>lon;
2486  ossimGpt gpt(lat,lon);
2487  geom->worldToLocal(gpt, imagePt);
2488  }
2489  else
2490  {
2491  lookup = m_kwl.find(UP_IS_UP_IPT_KW);
2492  if(!lookup.empty())
2493  {
2494  std::istringstream in(lookup.c_str());
2495  ossim_float64 x,y;
2496  in>>x>>y;
2497  imagePt = ossimDpt(x,y);
2498  }
2499  }
2500  upIsUp = geom->upIsUpAngle(imagePt);
2501  kwl.add(prefix, UP_IS_UP_KW, upIsUp, true);
2502  }
2503  }
2504 
2505  result = true;
2506 
2507  } // if ( ih->setCurrentEntry(entry) )
2508 
2509  if ( !result )
2510  {
2512  << "Could not get up is up angle for: " << ih->getFilename() << std::endl;
2513  }
2514 
2515  } // if ( ih )
2516 }
ossim_uint32 x
bool isAffectedByElevation() const
Returns TRUE if this geometry is sensitive to elevation.
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
static ossimString toString(bool aValue)
Numeric to string methods.
ossimKeywordlist m_kwl
Definition: ossimTool.h:148
double ossim_float64
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual const ossimFilename & getFilename() const
Returns the filename.
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
bool empty() const
Definition: ossimString.h:411
ossim_float64 upIsUpAngle(const ossimDpt &) const
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void makeNan()
Definition: ossimDpt.h:65

◆ getVersion()

void ossimInfo::getVersion ( std::string &  s) const

Gets version.

Parameters
sString to initialize.

Definition at line 3391 of file ossimInfo.cpp.

References OSSIM_VERSION.

3392 {
3393 #ifdef OSSIM_VERSION
3394  s = OSSIM_VERSION;
3395 #else
3396  s = "unknown";
3397 #endif
3398 }
#define OSSIM_VERSION
Definition: ossimVersion.h:4

◆ initialize()

bool ossimInfo::initialize ( ossimArgumentParser ap)
virtual

Initial method.

Typically called from application prior to execute. This parses all options and put in keyword list m_kwl.

Parameters
apArg parser to initialize from.
Returns
true, indicating process should continue with execute.

Reimplemented from ossimTool.

Definition at line 269 of file ossimInfo.cpp.

270 {
271  static const char M[] = "ossimInfo::initialize(ossimArgumentParser&)";
272  if ( traceDebug() )
273  {
274  ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
275  }
276 
277  if (!ossimTool::initialize(ap))
278  return false;
279  if (m_helpRequested)
280  return true;
281 
282  bool result = true;
283 
284  //---
285  // Start with clean options keyword list.
286  //---
287  m_kwl.clear();
288 
289  bool requiresInputImage = false;
290 
291  while ( 1 ) // While forever loop...
292  {
293  // Used throughout below:
294  std::string ts1;
296  std::string ts2;
298  std::string ts3;
300  const char TRUE_KW[] = "true";
301 
302  if( ap.read("--bounds") )
303  {
304  m_kwl.add( IMAGE_BOUNDS_KW, TRUE_KW );
305  if ( ap.argc() < 2 )
306  {
307  break;
308  }
309  }
310 
311  if( ap.read("--build-date") )
312  {
313  m_kwl.add( BUILD_DATE_KW, TRUE_KW );
314  if ( ap.argc() < 2 )
315  {
316  break;
317  }
318  }
319 
320  if( ap.read("-c") )
321  {
322  m_kwl.add( IMAGE_CENTER_KW, TRUE_KW );
323  if ( ap.argc() < 2 )
324  {
325  break;
326  }
327  }
328 
329  if( ap.read("--can-open") )
330  {
331  m_kwl.add( CAN_OPEN_KW, TRUE_KW );
332  requiresInputImage = true;
333  if ( ap.argc() < 2 )
334  {
335  break;
336  }
337  }
338 
339 
340  if( ap.read("--cg") )
341  {
342  m_kwl.add( CENTER_GROUND_KW, TRUE_KW );
343  if ( ap.argc() < 2 )
344  {
345  break;
346  }
347  }
348 
349  if( ap.read("--ci") )
350  {
351  m_kwl.add( CENTER_IMAGE_KW, TRUE_KW );
352  if ( ap.argc() < 2 )
353  {
354  break;
355  }
356  }
357 
358  if( ap.read("--config") || ap.read("--configuration") )
359  {
360  m_kwl.add( CONFIGURATION_KW, TRUE_KW );
361  if ( ap.argc() < 2 )
362  {
363  break;
364  }
365  }
366 
367  if( ap.read("--datums") )
368  {
369  m_kwl.add( DATUMS_KW, TRUE_KW );
370  if ( ap.argc() < 2 )
371  {
372  break;
373  }
374  }
375 
376  if( ap.read("--deg2rad", sp1) )
377  {
378  m_kwl.add( DEG2RAD_KW, ts1.c_str() );
379  if ( ap.argc() < 2 )
380  {
381  break;
382  }
383  }
384 
385  if( ap.read("-D") )
386  {
387  m_kwl.add( PRETTY_PRINT_KW, TRUE_KW );
388  requiresInputImage = true;
389  if ( ap.argc() < 2 )
390  {
391  break;
392  }
393  }
394 
395  if( ap.read("-d") )
396  {
397  m_kwl.add( DUMP_KW, TRUE_KW );
398  requiresInputImage = true;
399  if ( ap.argc() < 2 )
400  {
401  break;
402  }
403  }
404 
405  if( ap.read("--dump-state") )
406  {
407  m_kwl.add( DUMP_STATE_KW, TRUE_KW );
408  requiresInputImage = true;
409  if ( ap.argc() < 2 )
410  {
411  break;
412  }
413  }
414 
415  if( ap.read("--dno") )
416  {
417  m_kwl.add( DUMP_KW, TRUE_KW );
418  m_kwl.add( DUMP_NO_OVERVIEWS_KW, TRUE_KW );
419  requiresInputImage = true;
420  if ( ap.argc() < 2 )
421  {
422  break;
423  }
424  }
425 
426  if( ap.read("--extensions") )
427  {
428  m_kwl.add( EXTENSIONS_KW, TRUE_KW );
429  if ( ap.argc() < 2 )
430  break;
431  }
432 
433  if( ap.read("-f", sp1) )
434  {
435  m_kwl.add( FORMAT_KW, ts1.c_str());
436  if ( ap.argc() < 2 )
437  {
438  break;
439  }
440  }
441 
442  if( ap.read("--factories", sp1) )
443  {
444  m_kwl.add( FACTORIES_KW, TRUE_KW);
445  m_kwl.add( FACTORY_KEYWORD_LIST_KW, ts1.c_str());
446  if ( ap.argc() < 2 )
447  {
448  break;
449  }
450  }
451 
452  if( ap.read("--fonts") )
453  {
454  m_kwl.add( FONTS_KW, TRUE_KW );
455  if ( ap.argc() < 2 )
456  {
457  break;
458  }
459  }
460 
461  if( ap.read("--ft2mtrs", sp1) )
462  {
463  m_kwl.add( FT2MTRS_KW, ts1.c_str());
464  if ( ap.argc() < 2 )
465  {
466  break;
467  }
468  }
469 
470  if( ap.read("--ft2mtrs-us-survey", sp1) )
471  {
472  m_kwl.add( FT2MTRS_KW, ts1.c_str());
473  m_kwl.add( FT2MTRS_US_SURVEY_KW, TRUE_KW);
474  if ( ap.argc() < 2 )
475  {
476  break;
477  }
478  }
479 
480  if( ap.read("--height", sp1, sp2) )
481  {
482  ossimString lat = ts1;
483  ossimString lon = ts2;
484  ossimGpt gpt;
485  gpt.lat = lat.toFloat64();
486  gpt.lon = lon.toFloat64();
487  m_kwl.add( HEIGHT_KW, gpt.toString().c_str() );
488  if ( ap.argc() < 2 )
489  {
490  break;
491  }
492  }
493  if( ap.read("--ecef2llh", sp1, sp2, sp3))
494  {
495  ossimString x = ts1;
496  ossimString y = ts2;
497  ossimString z = ts3;
498  ossimEcefPoint ecefPoint(x.toFloat64(), y.toFloat64(), z.toFloat64());
499  m_kwl.add( ECEF2LLH_KW, ecefPoint.toString().c_str() );
500  if ( ap.argc() < 2 )
501  {
502  break;
503  }
504 
505  }
506  if( ap.read("-i") )
507  {
508  m_kwl.add( IMAGE_INFO_KW, TRUE_KW );
509  requiresInputImage = true;
510  if ( ap.argc() < 2 )
511  {
512  break;
513  }
514  }
515 
516  if( ap.read("--img2grd", sp1, sp2) )
517  {
518  requiresInputImage = true;
519  ossimString x = ts1;
520  ossimString y = ts2;
521  ossimDpt dpt;
522  dpt.x = x.toFloat64();
523  dpt.y = y.toFloat64();
524  m_kwl.add( IMG2GRD_KW, dpt.toString().c_str() );
525  if ( ap.argc() < 2 )
526  {
527  break;
528  }
529  }
530 
531  if( ap.read("--grd2img", sp1, sp2, sp3) )
532  {
533  requiresInputImage = true;
534  ossimString lat = ts1;
535  ossimString lon = ts2;
536  ossimString hgt = ts3;
537  ossimGpt gpt;
538  gpt.makeNan();
539  gpt.latd(lat.toFloat64());
540  gpt.lond(lon.toFloat64());
541  if(hgt != "nan")
542  {
543  gpt.height(hgt.toFloat64());
544  }
545  m_kwl.add( GRD2IMG_KW, gpt.toString().c_str() );
546  if ( ap.argc() < 2 )
547  {
548  break;
549  }
550  }
551 
552  if( ap.read("-m") )
553  {
554  m_kwl.add( METADATA_KW, TRUE_KW );
555  requiresInputImage = true;
556  if ( ap.argc() < 2 )
557  {
558  break;
559  }
560  }
561 
562  if( ap.read("--mtrs2ft", sp1) )
563  {
564  m_kwl.add( MTRS2FT_KW, ts1.c_str());
565  if ( ap.argc() < 2 )
566  {
567  break;
568  }
569  }
570 
571  if( ap.read("--mtrs2ft-us-survey", sp1) )
572  {
573  m_kwl.add( MTRS2FT_KW, ts1.c_str());
574  m_kwl.add( MTRS2FT_US_SURVEY_KW, TRUE_KW);
575  if ( ap.argc() < 2 )
576  {
577  break;
578  }
579  }
580 
581  if( ap.read("--mtrsPerDeg", sp1) )
582  {
583  m_kwl.add( MTRSPERDEG_KW, ts1.c_str());
584  if ( ap.argc() < 2 )
585  {
586  break;
587  }
588  }
589 
590  if( ap.read("-n") || ap.read("--north-up") )
591  {
592  m_kwl.add( NORTH_UP_KW, TRUE_KW );
593  if ( ap.argc() < 2 )
594  {
595  break;
596  }
597  }
598 
599  if( ap.read("-o", sp1) )
600  {
601  m_kwl.add( OUTPUT_FILE_KW, ts1.c_str());
602  if ( ap.argc() < 2 )
603  {
604  break;
605  }
606  }
607 
608  if( ap.read("--overview-types") )
609  {
610  m_kwl.add( OVERVIEW_TYPES_KW, TRUE_KW );
611  if ( ap.argc() < 2 )
612  {
613  break;
614  }
615  }
616 
617  if( ap.read("-p") )
618  {
619  m_kwl.add( GEOM_INFO_KW, TRUE_KW );
620  requiresInputImage = true;
621  if ( ap.argc() < 2 )
622  {
623  break;
624  }
625  }
626 
627  if( ap.read("--palette") )
628  {
629  m_kwl.add( PALETTE_KW, TRUE_KW );
630  requiresInputImage = true;
631  if ( ap.argc() < 2 )
632  {
633  break;
634  }
635  }
636 
637  if( ap.read("--plugins") )
638  {
639  m_kwl.add( PLUGINS_KW, TRUE_KW );
640  if ( ap.argc() < 2 )
641  {
642  break;
643  }
644  }
645 
646  if( ap.read("--plugin-test", sp1) )
647  {
648  m_kwl.add( PLUGIN_TEST_KW, ts1.c_str());
649  if ( ap.argc() < 2 )
650  {
651  break;
652  }
653  }
654 
655  if( ap.read("--projections") )
656  {
657  m_kwl.add( PROJECTIONS_KW, TRUE_KW );
658  if ( ap.argc() < 2 )
659  {
660  break;
661  }
662  }
663 
664  if( ap.read("-r") )
665  {
666  m_kwl.add( IMAGE_RECT_KW, TRUE_KW );
667  requiresInputImage = true;
668  if ( ap.argc() < 2 )
669  {
670  break;
671  }
672  }
673 
674  if( ap.read("--rad2deg", sp1) )
675  {
676  m_kwl.add( RAD2DEG_KW, ts1.c_str());
677  if ( ap.argc() < 2 )
678  {
679  break;
680  }
681  }
682 
683  if( ap.read("--reader-props") )
684  {
685  m_kwl.add( READER_PROPS_KW, TRUE_KW );
686  if ( ap.argc() < 2 )
687  {
688  break;
689  }
690  }
691 
692  if( ap.read("--resampler-filters") )
693  {
694  m_kwl.add( RESAMPLER_FILTERS_KW, TRUE_KW );
695  if ( ap.argc() < 2 )
696  {
697  break;
698  }
699  }
700 
701  if( ap.read("--revision") ||
702  ap.read("--revision-number") ) // backwards compat
703  {
704  m_kwl.add( REVISION_NUMBER_KW, TRUE_KW );
705  if ( ap.argc() < 2 )
706  {
707  break;
708  }
709  }
710 
711  if( ap.read("-u") || ap.read("--up-is-up") )
712  {
713  requiresInputImage = true;
714  m_kwl.add( UP_IS_UP_KW, TRUE_KW );
715  if ( ap.argc() < 2 )
716  {
717  break;
718  }
719  }
720  if( ap.read("--up-is-up-ipt", sp1, sp2))
721  {
722  requiresInputImage = true;
723  m_kwl.add( UP_IS_UP_KW, TRUE_KW);
724  m_kwl.add( UP_IS_UP_IPT_KW, (ts1 +" "+ts2).c_str() );
725  if ( ap.argc() < 2 )
726  {
727  break;
728  }
729  }
730  if(ap.read("--up-is-up-gpt",sp1, sp2))
731  {
732  requiresInputImage = true;
733  m_kwl.add( UP_IS_UP_KW, TRUE_KW);
734  m_kwl.add( UP_IS_UP_GPT_KW, (ts1 +" "+ ts2).c_str() );
735  if ( ap.argc() < 2 )
736  {
737  break;
738  }
739  }
740 
741  if( ap.read("-v") )
742  {
743  m_kwl.add( OVERWRITE_KW, TRUE_KW );
744  if ( ap.argc() < 2 )
745  {
746  break;
747  }
748  }
749 
750  if( ap.read("--version") || ap.read("-V") )
751  {
752  m_kwl.add( VERSION_KW, TRUE_KW );
753  if ( ap.argc() < 2 )
754  {
755  break;
756  }
757  }
758 
759  if( ap.read("--writer-props") )
760  {
761  m_kwl.add( WRITER_PROPS_KW, TRUE_KW );
762  if ( ap.argc() < 2 )
763  {
764  break;
765  }
766  }
767 
768  if( ap.read("--writers") )
769  {
770  m_kwl.add( WRITERS_KW, TRUE_KW );
771  if ( ap.argc() < 2 )
772  {
773  break;
774  }
775  }
776 
777  if( ap.read("--zoom-level-gsds") )
778  {
779  m_kwl.add( ZOOM_LEVEL_GSDS_KW, TRUE_KW );
780  if ( ap.argc() < 2 )
781  {
782  break;
783  }
784  }
785 
786  // End of arg parsing.
788  if ( ap.errors() )
789  {
791  std::string errMsg = "Unknown option...";
792  throw ossimException(errMsg);
793  }
794 
795  break; // Break from while forever.
796 
797  } // End while (forever) loop.
798 
799  if ( ap.argc() == 2 )
800  {
801  m_kwl.add( IMAGE_FILE_KW, ap[1] );
802  }
803 
804  if ( (( ap.argc() == 1 ) && requiresInputImage) || (m_kwl.getSize() == 0) )
805  {
806  if ( requiresInputImage )
807  {
808  ossimNotify(ossimNotifyLevel_NOTICE) << "\nError: Option requires input image!\n\n";
809  }
810  setUsage(ap);
812  result = false;
813 
814  }
815 
816  if ( traceDebug() )
817  {
819  << "m_kwl:\n" << m_kwl << "\n"
820  << M << " exit result = " << (result?"true":"false")
821  << "\n";
822  }
823 
824  return result;
825 }
ossim_uint32 x
void write(std::ostream &output, const UsageMap &um, unsigned int widthOfOutput=80)
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
bool m_helpRequested
Definition: ossimTool.h:150
ossim_uint32 y
bool read(const std::string &str)
search for an occurance of a string in the argument list, on sucess remove that occurance from the li...
double y
Definition: ossimDpt.h:165
void makeNan()
Definition: ossimGpt.h:130
ossimKeywordlist m_kwl
Definition: ossimTool.h:148
ossimApplicationUsage * getApplicationUsage()
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
void reportRemainingOptionsAsUnrecognized(ossimErrorSeverity severity=OSSIM_BENIGN)
for each remaining option report it as an unrecongnized.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
bool errors(ossimErrorSeverity severity=OSSIM_BENIGN) const
ossim_float64 lon
Definition: ossimGpt.h:266
double height() const
Definition: ossimGpt.h:107
ossim_float64 toFloat64() const
virtual bool initialize(ossimArgumentParser &ap)
Initializes from command line arguments.
Definition: ossimTool.cpp:58
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimDpt.cpp:160
virtual void setUsage(ossimArgumentParser &ap)
Adds application arguments to the argument parser.
Definition: ossimInfo.cpp:126
double x
Definition: ossimDpt.h:164
ossim_uint32 getSize() const
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
ossim_float64 lat
Definition: ossimGpt.h:265
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimGpt.cpp:78
int & argc()
return the argument count.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void writeErrorMessages(std::ostream &output, ossimErrorSeverity sevrity=OSSIM_BENIGN)
write out error messages at an above specified .

◆ isImageEntryOverview() [1/2]

bool ossimInfo::isImageEntryOverview ( ) const
Returns
true if current open image entry is an overview.

Definition at line 2665 of file ossimInfo.cpp.

References ossimRefPtr< T >::get(), m_img, and ossimRefPtr< T >::valid().

Referenced by getImageGeometryInfo(), and getImageInfo().

2666 {
2667  bool result = false; // Have to prove it.
2668  if ( m_img.valid() )
2669  {
2670  result = isImageEntryOverview( m_img.get() );
2671  }
2672  return result;
2673 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
bool isImageEntryOverview() const
Definition: ossimInfo.cpp:2665

◆ isImageEntryOverview() [2/2]

bool ossimInfo::isImageEntryOverview ( const ossimImageHandler ih) const
private
Returns
true if current open image entry is an overview.

Definition at line 2675 of file ossimInfo.cpp.

References ossimImageHandler::getProperty(), ossimString::toFloat32(), ossimRefPtr< T >::valid(), and ossimProperty::valueToString().

2676 {
2677  bool result = false; // Have to prove it.
2678  if ( ih )
2679  {
2680  ossimString s = "imag";
2682  if (prop.valid())
2683  {
2684  ossimString s;
2685  prop->valueToString(s);
2686  if (s.toFloat32() < 1.0)
2687  {
2688  result = true;
2689  }
2690  }
2691  }
2692  return result;
2693 }
virtual void valueToString(ossimString &valueResult) const =0
bool valid() const
Definition: ossimRefPtr.h:75
ossim_float32 toFloat32() const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const

◆ keyIsTrue()

bool ossimInfo::keyIsTrue ( const std::string &  key) const
private
Returns
true if key is set to true; false, if not.

Definition at line 3414 of file ossimInfo.cpp.

References ossimKeywordlist::findKey(), ossimTool::m_kwl, and ossimString::toBool().

3415 {
3416  bool result = false;
3417  std::string value = m_kwl.findKey( key );
3418  if ( value.size() )
3419  {
3420  result = ossimString(value).toBool();
3421  }
3422  return result;
3423 }
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
ossimKeywordlist m_kwl
Definition: ossimTool.h:148
bool toBool() const
String to numeric methods.

◆ mtrs2ft() [1/2]

void ossimInfo::mtrs2ft ( const ossim_float64 meters,
bool  us_survey 
) const

Converts meters to feet and outputs to stdout.

Definition at line 2905 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

2906 {
2907  mtrs2ft(meters, us_survey, ossimNotify(ossimNotifyLevel_INFO));
2908 }
void mtrs2ft(const ossim_float64 &meters, bool us_survey) const
Converts meters to feet and outputs to stdout.
Definition: ossimInfo.cpp:2905
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ mtrs2ft() [2/2]

std::ostream & ossimInfo::mtrs2ft ( const ossim_float64 meters,
bool  us_survey,
std::ostream &  out 
) const

Converts meters to feet and outputs to stream.

Parameters
outOutput to write to out.
Returns
stream

Definition at line 2910 of file ossimInfo.cpp.

References MTRS_PER_FT, and US_METERS_PER_FT.

2913 {
2914  // Capture the original flags.
2915  std::ios_base::fmtflags f = out.flags();
2916 
2917  double feet = 0.0;
2918  std::string conversionString;
2919 
2920  if (us_survey)
2921  {
2922  feet = meters / US_METERS_PER_FT;
2923  conversionString = "0.3048006096";
2924  }
2925  else
2926  {
2927  feet = meters / MTRS_PER_FT;
2928  conversionString = "0.3048";
2929  }
2930 
2931  out << setiosflags(ios::fixed) << setprecision(15)
2932  << meters << " / " << conversionString << " = "
2933  << feet << " feet." << std::endl;
2934 
2935  // Reset flags.
2936  out.setf(f);
2937 
2938  return out;
2939 }
#define US_METERS_PER_FT
#define MTRS_PER_FT

◆ mtrsPerDeg() [1/2]

void ossimInfo::mtrsPerDeg ( const ossim_float64 latitude) const

Get meters per degree for a given latitude and outputs to stdout.

Parameters
latitude

Definition at line 2941 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

2942 {
2944 }
void mtrsPerDeg(const ossim_float64 &latitude) const
Get meters per degree for a given latitude and outputs to stdout.
Definition: ossimInfo.cpp:2941
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ mtrsPerDeg() [2/2]

std::ostream & ossimInfo::mtrsPerDeg ( const ossim_float64 latitude,
std::ostream &  out 
) const

Get meters per degree for a given latitude and outputs to stream.

Parameters
latitude
outOutput to write to out.
Returns
stream

Definition at line 2946 of file ossimInfo.cpp.

References ossimGpt::datum(), ossimDatum::ellipsoid(), ossimEllipsoid::geodeticRadius(), ossimGpt::metersPerDegree(), ossimDpt::x, and ossimDpt::y.

2947 {
2948  ossimGpt gpt(latitude, 0.0);
2949  ossimDpt mpd = gpt.metersPerDegree();
2950  ossim_float64 radius = gpt.datum()->ellipsoid()->geodeticRadius(latitude);
2951  ossim_float64 arcLengthLat = mpd.y/60.0;
2952  ossim_float64 arcLengthLon = mpd.x/60.0;
2953  out << setiosflags(ios::fixed) << setprecision(15)
2954  << "Meters per degree and minute at latitude of " << latitude << ":\n"
2955  << "Meters per degree latitude: "
2956  << setw(20) << mpd.y << "\n"
2957  << "Meters per degree longitude: "
2958  << setw(20) << mpd.x << "\n"
2959  << "Meters per minute latitude: "
2960  << setw(20) << arcLengthLat << "\n"
2961  << "Meters per minute longitude: "
2962  << setw(20) << arcLengthLon << "\n"
2963  << "Geodetic radius: "
2964  << setw(20) << radius << "\n"
2965  << std::endl;
2966  return out;
2967 }
double y
Definition: ossimDpt.h:165
double ossim_float64
double x
Definition: ossimDpt.h:164

◆ openImage()

void ossimInfo::openImage ( const ossimFilename file)

Opens image handler and stores in m_img data member.

Parameters
Imageto open.
Note
Throws ossimException if image cannot be opened.

Definition at line 1602 of file ossimInfo.cpp.

References ossimString::downcase(), ossimFilename::ext(), m_img, openImageFromState(), and openImageHandler().

1603 {
1604  if(file.ext().downcase()=="kwl")
1605  {
1606  openImageFromState(file);
1607  }
1608  else
1609  {
1610  m_img = openImageHandler( file );
1611  }
1612 }
ossimRefPtr< ossimImageHandler > openImageHandler(const ossimFilename &file) const
Opens image.
Definition: ossimInfo.cpp:1629
void openImageFromState(const ossimFilename &file)
Opens image handler and stores in m_img data member.
Definition: ossimInfo.cpp:1614
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString ext() const

◆ openImageFromState()

void ossimInfo::openImageFromState ( const ossimFilename file)

Opens image handler and stores in m_img data member.

Parameters
Imageto open.
Note
Throws ossimException if image cannot be opened.

Definition at line 1614 of file ossimInfo.cpp.

References ossimKeywordlist::addFile(), ossim::ImageHandlerStateRegistry::instance(), ossimImageHandlerRegistry::instance(), m_img, and ossimImageHandlerRegistry::open().

Referenced by openImage().

1615 {
1616  std::shared_ptr<ossim::ImageHandlerState> state;
1617  ossimKeywordlist kwl;
1618  if(kwl.addFile(file))
1619  {
1620  state = ossim::ImageHandlerStateRegistry::instance()->createState(kwl);
1621  if(state)
1622  {
1624  }
1625  }
1626 }
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
Represents serializable keyword/value map.
bool addFile(const char *file)
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
Definition: ossimInfo.h:805
static std::shared_ptr< ImageHandlerStateRegistry > instance()
static ossimImageHandlerRegistry * instance()

◆ openImageHandler()

ossimRefPtr< ossimImageHandler > ossimInfo::openImageHandler ( const ossimFilename file) const
private

Opens image.

Parameters
Imageto open.
Returns
ossimRefPtr with image handler.
Note
Throws ossimException if image cannot be opened.

Definition at line 1629 of file ossimInfo.cpp.

References ossimKeywordlist::addFile(), ossimString::downcase(), ossimFilename::ext(), ossimKeywordlist::find(), ossim::ImageHandlerStateRegistry::instance(), ossimImageHandlerRegistry::instance(), ossimTool::m_kwl, ossimImageHandlerRegistry::open(), ossimString::string(), ossimString::toBool(), and ossimRefPtr< T >::valid().

Referenced by getImageInfo(), and openImage().

1630 {
1632  if(file.ext().downcase()=="kwl")
1633  {
1634  std::shared_ptr<ossim::ImageHandlerState> state;
1635  ossimKeywordlist kwl;
1636  if(kwl.addFile(file))
1637  {
1638  state = ossim::ImageHandlerStateRegistry::instance()->createState(kwl);
1639  if(state)
1640  {
1641  result = ossimImageHandlerRegistry::instance()->open(state);
1642  }
1643  }
1644  }
1645  else
1646  {
1647  // Go through new interface that passes a stream around. (drb 10 Nov. 2016)
1648  // ossimRefPtr<ossimImageHandler> result = ossimImageHandlerRegistry::instance()->open(file);
1650  openConnection(file);
1651  }
1652  // only throw an exception if the can-open option
1653  // is not specified
1654  ossimString canOpenFlag = m_kwl.find("can_open");
1655  if ( !result.valid() && !canOpenFlag.toBool())
1656  {
1657  std::string errMsg = "ossimInfo::openImage ERROR:\nCould not open: ";
1658  errMsg += file.string();
1659  throw ossimException(errMsg);
1660  }
1661  return result;
1662 }
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
Represents serializable keyword/value map.
bool addFile(const char *file)
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
ossimKeywordlist m_kwl
Definition: ossimTool.h:148
bool toBool() const
String to numeric methods.
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
static std::shared_ptr< ImageHandlerStateRegistry > instance()
ossimString ext() const
static ossimImageHandlerRegistry * instance()
const std::string & string() const
Definition: ossimString.h:414

◆ outputHeight() [1/2]

void ossimInfo::outputHeight ( const ossimGpt gpt) const

Gets the height for ground point (latitude, longitude).

Outputs to stdout.

Parameters
gptGround point.

Definition at line 2969 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

2970 {
2972 }
void outputHeight(const ossimGpt &gpt) const
Gets the height for ground point (latitude, longitude).
Definition: ossimInfo.cpp:2969
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ outputHeight() [2/2]

std::ostream & ossimInfo::outputHeight ( const ossimGpt gpt,
std::ostream &  out 
) const

Gets the height for ground point (latitude, longitude).

Outputs to out.

Parameters
outOutput to write to out.
Returns
stream

Definition at line 2974 of file ossimInfo.cpp.

References ossimElevManager::getHeightAboveEllipsoid(), ossimElevManager::getHeightAboveMSL(), ossimElevManager::getOpenCellList(), ossimGeoidManager::instance(), ossimElevManager::instance(), ossim::isnan(), ossim::nan(), ossimGeoidManager::offsetFromEllipsoid(), and ossimGpt::wrap().

2975 {
2976  // Capture the original flags.
2977  std::ios_base::fmtflags f = out.flags();
2978 
2979  // Handle wrap conditions.
2980  ossimGpt copyGpt = gpt;
2981  copyGpt.wrap();
2982 
2984  ossim_float64 hgtAboveEllipsoid =
2987  ossim_float64 mslOffset = 0.0;
2988 
2989  if(ossim::isnan(hgtAboveEllipsoid)||ossim::isnan(hgtAboveMsl))
2990  {
2991  mslOffset = ossim::nan();
2992  }
2993  else
2994  {
2995  mslOffset = hgtAboveEllipsoid - hgtAboveMsl;
2996  }
2997 
2998  std::vector<ossimFilename> cellList;
3000 
3001  if (!cellList.empty())
3002  {
3003  out << "Opened cell: " << cellList[0] << "\n";
3004  }
3005  else
3006  {
3007  out << "Did not find cell for point: " << gpt << "\n";
3008  }
3009 
3010  out << "MSL to ellipsoid delta: ";
3011  if (!ossim::isnan(mslOffset))
3012  {
3013  out << std::setprecision(15) << mslOffset;
3014  }
3015  else
3016  {
3017  out << "nan";
3018  }
3019  out << "\nHeight above MSL: ";
3020  if (!ossim::isnan(hgtAboveMsl))
3021  {
3022  out << std::setprecision(15) << hgtAboveMsl;
3023  }
3024  else
3025  {
3026  out << "nan";
3027  }
3028  out << "\nHeight above ellipsoid: ";
3029  if (!ossim::isnan(hgtAboveEllipsoid))
3030  {
3031  out << std::setprecision(15) << hgtAboveEllipsoid << "\n";
3032  }
3033  else
3034  {
3035  out << "nan" << "\n";
3036  }
3037  out << "Geoid value: ";
3038 
3039  if (!ossim::isnan(geoidOffset))
3040  {
3041  out << std::setprecision(15) << geoidOffset << std::endl;
3042  }
3043  else
3044  {
3045  out << "nan" << std::endl;
3046  }
3047 
3048  // Reset flags.
3049  out.setf(f);
3050 
3051  return out;
3052 }
void getOpenCellList(std::vector< ossimFilename > &list) const
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
void wrap()
Wrap method to maintain longitude between -180 and +180 and latitude between -90 and +90...
Definition: ossimGpt.h:305
double ossim_float64
virtual double getHeightAboveEllipsoid(const ossimGpt &gpt)
static ossimGeoidManager * instance()
Implements singelton pattern:
virtual double getHeightAboveMSL(const ossimGpt &gpt)
Height access methods:
virtual double offsetFromEllipsoid(const ossimGpt &gpt)
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ outputXml() [1/2]

void ossimInfo::outputXml ( const ossimKeywordlist kwl) const
private

Convert keyword list to xml then outputs to standard out.

Parameters
kwlKeyword list to output.

Definition at line 3400 of file ossimInfo.cpp.

References ossimXmlDocument::fromKwl(), ossimNotify(), and ossimNotifyLevel_INFO.

3401 {
3402  ossimXmlDocument document;
3403  document.fromKwl( kwl );
3404  ossimNotify(ossimNotifyLevel_INFO) << document << std::endl;
3405 }
void fromKwl(const ossimKeywordlist &kwl)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ outputXml() [2/2]

void ossimInfo::outputXml ( const ossimKeywordlist kwl,
const ossimFilename file 
) const
private

Convert keyword list to xml then outputs to file.

Parameters
kwlKeyword list to output.
fileOutput file to write to.

Definition at line 3407 of file ossimInfo.cpp.

References ossimXmlDocument::fromKwl(), and ossimXmlDocument::write().

3408 {
3409  ossimXmlDocument document;
3410  document.fromKwl( kwl );
3411  document.write( file );
3412 }
bool write(const ossimFilename &file)
void fromKwl(const ossimKeywordlist &kwl)

◆ prettyPrint()

void ossimInfo::prettyPrint ( const ossimFilename file) const

Dumps the image information from ossimInfoFactoryRegistry.

Definition at line 1674 of file ossimInfo.cpp.

References ossimString::c_str(), ossimInfoFactoryRegistry::create(), ossimInfoFactoryRegistry::instance(), ossimNotify(), and ossimNotifyLevel_INFO.

1675 {
1676  std::shared_ptr<ossimInfoBase> info = ossimInfoFactoryRegistry::instance()->create(file);
1677  if (info)
1678  {
1679  //---
1680  // Old -d behavior was to dump all unless the dump no overview flag
1681  // was set. Need to see tiff tags in file order for all image file
1682  // directories(ifd's) so commenting out hard coded
1683  // info->setProcessOverviewFlag(false) that used to be settable with -d
1684  // + --dno options. Note the old -d option used to do file order for
1685  // tiffs but now dumps to a keyword list that prints alphabetical(not
1686  // file order) so can't use that anymore.
1687  //
1688  // drb - 15 Dec. 2016
1689  //---
1690  // info->setProcessOverviewFlag(false);
1691 
1692  info->print(ossimNotify(ossimNotifyLevel_INFO));
1693  info.reset();
1694  }
1695  else
1696  {
1698  << "No print available for: " << file.c_str() << std::endl;
1699  }
1700 }
std::shared_ptr< ossimInfoBase > create(const ossimFilename &file) const
Create method.
static ossimInfoFactoryRegistry * instance()
instance method
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
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printConfiguration() [1/2]

void ossimInfo::printConfiguration ( ) const

Dumps ossim preferences/configuration data.

Definition at line 2695 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

2696 {
2698 }
void printConfiguration() const
Dumps ossim preferences/configuration data.
Definition: ossimInfo.cpp:2695
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printConfiguration() [2/2]

std::ostream & ossimInfo::printConfiguration ( std::ostream &  out) const

Dumps ossim preferences/configuration data.

Parameters
outOutput to write to.
Returns
stream

Definition at line 2700 of file ossimInfo.cpp.

References ossimPreferences::getPreferencesFilename(), ossimPreferences::instance(), and ossimPreferences::preferencesKWL().

2701 {
2702  out << "\npreferences_keyword_file: "
2704  << "preferences_keyword_list:\n"
2706  << std::endl;
2707  return out;
2708 }
const ossimKeywordlist & preferencesKWL() const
static ossimPreferences * instance()
ossimFilename getPreferencesFilename() const

◆ printDatums() [1/2]

void ossimInfo::printDatums ( ) const

Dumps datum list to stdout.

Definition at line 2737 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

2738 {
2740 }
void printDatums() const
Dumps datum list to stdout.
Definition: ossimInfo.cpp:2737
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printDatums() [2/2]

std::ostream & ossimInfo::printDatums ( std::ostream &  out) const

Dumps datum list to stream.

Definition at line 2742 of file ossimInfo.cpp.

References ossimString::c_str(), ossimDatum::code(), ossimDatumFactoryRegistry::create(), ossimDatum::ellipsoid(), ossimDatum::epsgCode(), ossimDatumFactoryRegistry::getList(), ossimDatumFactoryRegistry::instance(), ossimDatum::name(), and ossimEllipsoid::name().

2743 {
2744  // Capture the original flags.
2745  std::ios_base::fmtflags f = out.flags();
2746 
2747  std::vector<ossimString> datumList;
2749 
2750  std::vector<ossimString>::const_iterator i = datumList.begin();
2751 
2752  while ( i != datumList.end() )
2753  {
2755  if (datum)
2756  {
2757  if ( datum->ellipsoid() )
2758  {
2759  out << setiosflags(ios::left)
2760  << setw(7)
2761  << datum->code().c_str()
2762  << setw(7)
2763  << datum->epsgCode()
2764  << setw(48)
2765  << datum->name().c_str()
2766  << setw(10)
2767  << "Ellipse:"
2768  << datum->ellipsoid()->name()
2769  << std::endl;
2770  }
2771  else
2772  {
2773  out << "No ellipsoid for code: " << (*i) << std::endl;
2774  }
2775  }
2776  else
2777  {
2778  out << "No datum for code: " << (*i) << std::endl;
2779  }
2780 
2781  ++i;
2782  }
2783 
2784  // Reset flags.
2785  out.setf(f);
2786 
2787  return out;
2788 }
static ossimDatumFactoryRegistry * instance()
instance method
virtual ossim_uint32 epsgCode() const
Definition: ossimDatum.h:59
virtual const ossimString & code() const
Definition: ossimDatum.h:57
virtual const ossimString & name() const
Definition: ossimDatum.h:58
const ossimString & name() const
virtual const ossimDatum * create(const ossimString &code) const
create method
virtual const ossimEllipsoid * ellipsoid() const
Definition: ossimDatum.h:60
virtual void getList(std::vector< ossimString > &list) const
getList method to return a combined list of all datums from registered datum factories.
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

◆ printExtensions() [1/2]

void ossimInfo::printExtensions ( ) const

Prints supported image file extensions to stdout.

Definition at line 3054 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3055 {
3057 }
void printExtensions() const
Prints supported image file extensions to stdout.
Definition: ossimInfo.cpp:3054
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printExtensions() [2/2]

std::ostream & ossimInfo::printExtensions ( std::ostream &  out) const

Prints supported image file extensions to stream.

Parameters
outOutput to write to out.
Returns
stream

Definition at line 3059 of file ossimInfo.cpp.

References ossimImageHandlerFactoryBase::UniqueList< T >::getList(), ossimImageHandlerRegistry::getSupportedExtensions(), and ossimImageHandlerRegistry::instance().

3060 {
3063  const vector<ossimString>& list = extList.getList();
3064 
3065  if (list.empty())
3066  {
3067  out << "No image file extensions handled. This should never happen!" << std::endl;
3068  return out;
3069  }
3070 
3071  out<<"\nImage Entensions Supported:"<< endl;
3072  for (const auto& extension : list)
3073  out<<" "<<extension<<endl;
3074 
3075  out<<endl;
3076  return out;
3077 }
virtual void getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList &extensionList) const
static ossimImageHandlerRegistry * instance()

◆ printFactories()

void ossimInfo::printFactories ( bool  keywordListFlag) const

Prints factories.

Parameters
keywordListFlagIf true the result of a saveState will be output for each factory.

Definition at line 2710 of file ossimInfo.cpp.

References ossimObjectFactoryRegistry::createObject(), ossimObjectFactoryRegistry::getTypeNameList(), ossimObjectFactoryRegistry::instance(), and ossimObject::saveState().

2711 {
2712  std::vector<ossimString> typeList;
2714  for(int i = 0; i < (int)typeList.size(); ++i)
2715  {
2716  if(keywordListFlag)
2717  {
2719  if(obj)
2720  {
2721  cout << typeList[i] << endl;
2722  cout << "______________________________________________________" << endl;
2723  ossimKeywordlist kwl;
2724  obj->saveState(kwl);
2725  cout << kwl << endl;
2726  cout << "______________________________________________________" << endl;
2727  delete obj;
2728  }
2729  }
2730  else
2731  {
2732  cout << typeList[i] << endl;
2733  }
2734  }
2735 }
Represents serializable keyword/value map.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Definition: ossimObject.cpp:95
static ossimObjectFactoryRegistry * instance()
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
virtual ossimObject * createObject(const ossimString &name) const

◆ printFonts() [1/2]

void ossimInfo::printFonts ( ) const

Prints fonts list to stdout.

Definition at line 2790 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

2791 {
2793 }
void printFonts() const
Prints fonts list to stdout.
Definition: ossimInfo.cpp:2790
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printFonts() [2/2]

std::ostream & ossimInfo::printFonts ( std::ostream &  out) const

Prints fonts list to stream.

Definition at line 2795 of file ossimInfo.cpp.

References ossimFontFactoryRegistry::getDefaultFont(), ossimFont::getFamilyName(), ossimFontFactoryRegistry::getFontInformation(), ossimFontFactoryRegistry::instance(), and ossimRefPtr< T >::valid().

2796 {
2797  std::vector<ossimFontInformation> fontInfoList;
2799 
2800  std::vector<ossimFontInformation>::const_iterator i = fontInfoList.begin();
2801 
2802  while ( i != fontInfoList.end() )
2803  {
2804  out << *(i) << endl;
2805  ++i;
2806  }
2807 
2808  // Get the default:
2810  if ( defaultFont.valid() )
2811  {
2812  out << "default_font: " << defaultFont->getFamilyName() << std::endl;
2813  }
2814 
2815  return out;
2816 }
bool valid() const
Definition: ossimRefPtr.h:75
void getFontInformation(std::vector< ossimFontInformation > &informationList) const
virtual ossimString getFamilyName() const
Definition: ossimFont.h:133
static ossimFontFactoryRegistry * instance()

◆ printOverviewTypes() [1/2]

void ossimInfo::printOverviewTypes ( ) const

Prints overview types to stdout.

Definition at line 3115 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3116 {
3118 }
void printOverviewTypes() const
Prints overview types to stdout.
Definition: ossimInfo.cpp:3115
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printOverviewTypes() [2/2]

std::ostream & ossimInfo::printOverviewTypes ( std::ostream &  out) const

Prints overview types to stream.

Definition at line 3120 of file ossimInfo.cpp.

References ossimOverviewBuilderFactoryRegistry::getTypeNameList(), and ossimOverviewBuilderFactoryRegistry::instance().

3121 {
3122  out << "\nValid overview types: " << std::endl;
3123 
3124  std::vector<ossimString> outputType;
3125 
3127  std::copy(outputType.begin(),
3128  outputType.end(),
3129  std::ostream_iterator<ossimString>(out, "\t\n"));
3130  return out;
3131 }
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
Method to populate a list of supported types of all factories registered to this registry.
static ossimOverviewBuilderFactoryRegistry * instance()
instance method for access to theInstance pointer.

◆ printPlugins() [1/2]

void ossimInfo::printPlugins ( ) const

Prints loaded plugins to stdout.

Definition at line 3079 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3080 {
3082 }
void printPlugins() const
Prints loaded plugins to stdout.
Definition: ossimInfo.cpp:3079
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printPlugins() [2/2]

std::ostream & ossimInfo::printPlugins ( std::ostream &  out) const

Prints loaded plugins to stream.

Parameters
outOutput to write to out.
Returns
stream

Definition at line 3084 of file ossimInfo.cpp.

References ossimSharedPluginRegistry::instance(), and ossimSharedPluginRegistry::printAllPluginInformation().

3085 {
3086  if(ossimSharedPluginRegistry::instance()->getNumberOfPlugins() > 0)
3087  {
3089  }
3090  else
3091  {
3092  out << "No plugins loaded in the OSSIM core library" << std::endl;
3093  }
3094  return out;
3095 }
void printAllPluginInformation(std::ostream &out)
static ossimSharedPluginRegistry * instance()

◆ printProjections() [1/2]

void ossimInfo::printProjections ( ) const

Prints projections to stdout.

Definition at line 3133 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3134 {
3136 }
void printProjections() const
Prints projections to stdout.
Definition: ossimInfo.cpp:3133
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printProjections() [2/2]

std::ostream & ossimInfo::printProjections ( std::ostream &  out) const

Prints projections to stream.

Definition at line 3138 of file ossimInfo.cpp.

References ossimProjectionFactoryRegistry::instance().

3139 {
3140  out << "Projections:\n";
3141 
3142  std::vector<ossimString> list;
3144  getAllTypeNamesFromRegistry(list);
3145 
3146  std::vector<ossimString>::const_iterator i = list.begin();
3147  while ( i != list.end() )
3148  {
3149  out << *i << "\n";
3150  ++i;
3151  }
3152  out << std::endl;
3153 
3154  return out;
3155 }
static ossimProjectionFactoryRegistry * instance()

◆ printReaderProps() [1/2]

void ossimInfo::printReaderProps ( ) const

Prints reader properties to stdout.

Definition at line 3157 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3158 {
3160 }
void printReaderProps() const
Prints reader properties to stdout.
Definition: ossimInfo.cpp:3157
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printReaderProps() [2/2]

std::ostream & ossimInfo::printReaderProps ( std::ostream &  out) const

Prints reader properties to stream.

Definition at line 3162 of file ossimInfo.cpp.

References ossimImageHandlerRegistry::instance(), and ossimImageHandlerRegistry::printReaderProps().

3163 {
3165 }
static ossimImageHandlerRegistry * instance()
std::ostream & printReaderProps(std::ostream &out) const
Prints list of readers and properties.

◆ printResamplerFilters() [1/2]

void ossimInfo::printResamplerFilters ( ) const

Prints resampler filters to stdout.

Definition at line 3167 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3168 {
3170 }
void printResamplerFilters() const
Prints resampler filters to stdout.
Definition: ossimInfo.cpp:3167
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printResamplerFilters() [2/2]

std::ostream & ossimInfo::printResamplerFilters ( std::ostream &  out) const

Prints resampler filters to stream.

Definition at line 3172 of file ossimInfo.cpp.

References ossimFilterResampler::getFilterTypes().

3173 {
3174  std::vector<ossimString> list;
3176  f.getFilterTypes(list);
3177  std::vector<ossimString>::const_iterator i = list.begin();
3178  while ( i != list.end() )
3179  {
3180  out << *i << "\n";
3181  ++i;
3182  }
3183  out << std::endl;
3184  return out;
3185 }
virtual void getFilterTypes(std::vector< ossimString > &filterTypes) const

◆ printWriterProps() [1/2]

void ossimInfo::printWriterProps ( ) const

Prints writer properties to stdout.

Definition at line 3280 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3281 {
3283 }
void printWriterProps() const
Prints writer properties to stdout.
Definition: ossimInfo.cpp:3280
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printWriterProps() [2/2]

std::ostream & ossimInfo::printWriterProps ( std::ostream &  out) const

Prints writer properties to stream.

Definition at line 3285 of file ossimInfo.cpp.

References ossimImageWriterFactoryRegistry::instance(), and ossimImageWriterFactoryRegistry::printWriterProps().

3286 {
3288 }
static ossimImageWriterFactoryRegistry * instance()
std::ostream & printWriterProps(std::ostream &out) const
Prints list of writers from getImageTypeList.

◆ printWriters() [1/2]

void ossimInfo::printWriters ( ) const

Prints list of available writers to stdout.

Definition at line 3187 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3188 {
3190 }
void printWriters() const
Prints list of available writers to stdout.
Definition: ossimInfo.cpp:3187
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printWriters() [2/2]

std::ostream & ossimInfo::printWriters ( std::ostream &  out) const

Prints list of available writers to stream.

Definition at line 3192 of file ossimInfo.cpp.

References ossimImageWriterFactoryRegistry::instance(), and ossimImageWriterFactoryRegistry::printImageTypeList().

3193 {
3195 }
static ossimImageWriterFactoryRegistry * instance()
std::ostream & printImageTypeList(std::ostream &out) const
Prints list of writers from getImageTypeList.

◆ printZoomLevelGsds() [1/2]

void ossimInfo::printZoomLevelGsds ( ) const

Prints zoom levels to stdout.

Definition at line 3197 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3198 {
3200 }
void printZoomLevelGsds() const
Prints zoom levels to stdout.
Definition: ossimInfo.cpp:3197
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ printZoomLevelGsds() [2/2]

std::ostream & ossimInfo::printZoomLevelGsds ( std::ostream &  out) const

Prints zoom levels to stream.

Definition at line 3202 of file ossimInfo.cpp.

3203 {
3204  // Capture the original flags.
3205  std::ios_base::fmtflags f = out.flags();
3206 
3207  out << setprecision(15)<< setiosflags(std::ios_base::fixed|std::ios_base::right);
3208 
3209  const int MAX_LEVEL = 24;
3210  const double TILE_SIZE = 256.0;
3211  const double EPSG_4326_BOUNDS = 180.0;
3212  const double EPSG_3857_BOUNDS = 40075016.685578488;
3213 
3214  // From: ossim-info --mtrsPerDeg 0.0
3215  const double MTRS_PER_DEGREE_AT_EQUATOR = 111319.490793273565941;
3216 
3217  out << "Notes:\n"
3218  << "tile size: 256\n"
3219  << "dpp = \"degrees per pixel\"\n"
3220  << "mpp = \"meters per pixel\"\n\n";
3221 
3222  // Assuming square pixels, level 0 having (2 x 1) tiles.
3223  double level_0_gsd = EPSG_4326_BOUNDS / TILE_SIZE;
3224  double level_gsd = 0.0;
3225  int i = 0;
3226  int tilesX = 2;
3227  int tilesY = 1;
3228 
3229  out << "EPSG:4326 level info:\n"
3230  << "Note: Assuming square pixels, level 0 having (2x1) tiles.\n"
3231  << "bounds: 360.0 X 180.0\n"
3232  << "level[" << std::setw(2) << std::setfill('0') << i << "] dpp:"
3233  << std::setw(18) << std::setfill(' ') << level_0_gsd
3234  << " equivalent mpp:" << std::setw(22)
3235  << (level_0_gsd * MTRS_PER_DEGREE_AT_EQUATOR)
3236  << " (" << tilesX << "x" << tilesY << ")" << "\n";
3237 
3238  for ( i = 1; i <= MAX_LEVEL; ++i )
3239  {
3240  tilesX = tilesX << 1;
3241  tilesY = tilesY << 1;
3242  level_gsd = level_0_gsd / std::pow( 2.0, i );
3243  out << "level[" << std::setw(2) << std::setfill('0') << i << "] dpp:"
3244  << std::setw(18) << std::setfill(' ') << level_gsd
3245  << " equivalent mpp:" << std::setw(22)
3246  << (level_gsd * MTRS_PER_DEGREE_AT_EQUATOR)
3247  << " (" << tilesX << "x" << tilesY << ")"<< "\n";
3248 
3249  }
3250 
3251  // Assuming square pixels, level 0 having (1 x 1) tiles.
3252  level_0_gsd = EPSG_3857_BOUNDS / TILE_SIZE;
3253  level_gsd = 0.0;
3254  i = 0;
3255  tilesX = 1; // X and y the same.
3256 
3257  out << "\n\nEPSG:3857 level info:\n"
3258  << "Note: Assuming square pixels, level 0 having (1x1) tile.\n"
3259  << "bounds: 40075016.685578488 X 40075016.685578488\n"
3260  << "level[" << std::setw(2) << std::setfill('0') << i << "] mpp:"
3261  << std::setw(23) << std::setfill(' ') << level_0_gsd
3262  << " (" << tilesX << "x" << tilesX << ")" << "\n";
3263 
3264  for ( i = 1; i <= MAX_LEVEL; ++i )
3265  {
3266  tilesX = tilesX << 1;
3267  level_gsd = level_0_gsd / std::pow( 2.0, i );
3268  out << "level[" << std::setw(2) << std::setfill('0') << i << "] mpp:"
3269  << std::setw(23) << std::setfill(' ') << level_gsd
3270  << " (" << tilesX << "x" << tilesX << ")" << "\n";
3271  }
3272 
3273  // Reset flags.
3274  out.setf(f);
3275 
3276  return out;
3277 
3278 } // End: ossimInfo::printZoomLevelGsds(std::ostream& out)

◆ rad2deg() [1/2]

void ossimInfo::rad2deg ( const ossim_float64 radians) const

Converts radians to degrees and outputs to stdout.

Definition at line 2848 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

2849 {
2851 }
void rad2deg(const ossim_float64 &radians) const
Converts radians to degrees and outputs to stdout.
Definition: ossimInfo.cpp:2848
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ rad2deg() [2/2]

std::ostream & ossimInfo::rad2deg ( const ossim_float64 radians,
std::ostream &  out 
) const

Converts radians to degrees and outputs to stream.

Parameters
outOutput to write to.
Returns
stream

Definition at line 2853 of file ossimInfo.cpp.

References DEG_PER_RAD.

2854 {
2855  double degrees = radians * DEG_PER_RAD;
2856 
2857  // Capture the original flags.
2858  std::ios_base::fmtflags f = out.flags();
2859 
2860  out << std::setiosflags(std::ios::fixed) << std::setprecision(15)
2861  << "\n" << radians << " radians = "
2862  << degrees << " degrees.\n" << std::endl;
2863 
2864  // Reset flags.
2865  out.setf(f);
2866 
2867  return out;
2868 }
#define DEG_PER_RAD

◆ setUsage()

void ossimInfo::setUsage ( ossimArgumentParser ap)
virtual

Adds application arguments to the argument parser.

Parameters
apParser to add to.

Reimplemented from ossimTool.

Definition at line 126 of file ossimInfo.cpp.

References ossimApplicationUsage::addCommandLineOption(), ossimInit::addOptions(), DESCRIPTION, ossimArgumentParser::getApplicationName(), ossimArgumentParser::getApplicationUsage(), ossimInit::instance(), ossimApplicationUsage::setCommandLineUsage(), and ossimApplicationUsage::setDescription().

127 {
128  // Add global usage options.
130 
131  // Set the general usage:
133  ossimString usageString = ap.getApplicationName();
134  usageString += " [options] <optional-image | optional-state>";
135  au->setCommandLineUsage(usageString);
136 
137  // Set the command line options:
138  au->addCommandLineOption("--bounds", "Will print out the edge to edge image bounds.");
139 
140  au->addCommandLineOption("--build-date", "Build date of code.");
141 
142  au->addCommandLineOption("-c", "Will print ground and image center.");
143 
144  au->addCommandLineOption("--can-open", "return can_open: true or can_open: false");
145 
146  au->addCommandLineOption("--cg", "Will print out ground center.");
147 
148  au->addCommandLineOption("--ci", "Will print out image center.");
149 
150  au->addCommandLineOption("--config", "Displays configuration info.");
151 
152  au->addCommandLineOption("-D", "A human-readable (i.e., not necessarily key:value pairs) dump of the image.");
153 
154  au->addCommandLineOption("-d", "A generic dump if one is available.");
155 
156  au->addCommandLineOption("--datums", "Prints datum list.");
157 
158  au->addCommandLineOption("--deg2rad", "<degrees> Gives radians from degrees.");
159 
160  au->addCommandLineOption("--dno", "A generic dump if one is available. This option ignores overviews.");
161 
162  au->addCommandLineOption("--dump-state", "If the image supports a state object then the state object will be dumped.");
163 
164  au->addCommandLineOption("--ecef2llh", "<X> <Y> <Z> in ECEF coordinates and returns latitude longitude height position.");
165 
166  au->addCommandLineOption("--extensions", "Prints list of supported image extensions.");
167 
168  au->addCommandLineOption("-f", "<format> Will output the information specified format [KWL | XML]. Default is KWL.");
169 
170  au->addCommandLineOption("--factories", "<keyword_list_flag> Prints factory list. If keyword_list_flag is true, the result of a saveState will be output for each object.");
171 
172  au->addCommandLineOption("--fonts", "Prints available fonts.");
173 
174  au->addCommandLineOption("--ft2mtrs", "<feet> Gives meters from feet (0.3048 meters per foot).");
175 
176  au->addCommandLineOption("--ft2mtrs-us-survey", "<feet> Gives meters from feet (0.3048006096 meters per foot).");
177 
178  au->addCommandLineOption("-h", "Display this information");
179 
180  au->addCommandLineOption("--height", "<latitude-in-degrees> <longitude-in-degrees> Returns the MSL and ellipoid height given a latitude longitude position.");
181 
182  au->addCommandLineOption("-i", "Will print out the general image information.");
183 
184  au->addCommandLineOption("--img2grd", "<x> <y> Gives ground point from zero based image point. Returns \"nan\" if point is outside of image area.");
185  au->addCommandLineOption("--grd2img", "<lat> <lon> <height> Gives full res image point from lat lon height.");
186 
187  au->addCommandLineOption("-m", "Will print out meta data image information.");
188 
189  au->addCommandLineOption("--mtrsPerDeg", "<latitude> Gives meters per degree and meters per minute for a given latitude.");
190 
191  au->addCommandLineOption("--mtrs2ft", "<meters> Gives feet from meters (0.3048 meters per foot).");
192 
193  au->addCommandLineOption("--mtrs2ft-us-survey", "<meters> Gives feet from meters (0.3048006096 meters per foot).");
194 
195  au->addCommandLineOption("-n or --north-up", "Rotation angle to North for an image.");
196 
197  au->addCommandLineOption("-o", "<output-file> Will output the information to the file specified. Default is to standard out.");
198 
199  au->addCommandLineOption("--overview-types", "Prints overview builder types.");
200 
201  au->addCommandLineOption("-p", "Will print out the image projection information.");
202 
203  au->addCommandLineOption("--palette", "Will print out the color palette if one exists.");
204 
205  au->addCommandLineOption("--plugins", "Prints plugin list.");
206 
207  au->addCommandLineOption("--plugin-test", "Test plugin passed to option.");
208 
209  au->addCommandLineOption("--projections", "Prints projections.");
210 
211  au->addCommandLineOption("-r", "Will print image rectangle.");
212 
213  au->addCommandLineOption("--rad2deg", "<radians> Gives degrees from radians.");
214 
215  au->addCommandLineOption("--reader-props", "Prints readers and properties.");
216 
217  au->addCommandLineOption("--resampler-filters", "Prints resampler filter list.");
218 
219  au->addCommandLineOption("--revision", "Revision of code.");
220 
221  au->addCommandLineOption("-s", "Force the ground rect to be the specified datum");
222 
223  au->addCommandLineOption("--up-is-up or -u", "Rotation angle to \"up is up\" for an image.\nWill return 0 if image's projection is not affected by elevation.");
224  au->addCommandLineOption("--up-is-up-gpt", "Computes up angle given gpt: <lat> <lon>");
225  au->addCommandLineOption("--up-is-up-ipt", "Computes up angle given full res image point: <x> <y>");
226  au->addCommandLineOption("-v", "Overwrite existing geometry.");
227 
228  au->addCommandLineOption("-V or --vesion", "Version of code, e.g. 1.8.20");
229 
230  au->addCommandLineOption("--writer-props", "Prints writers and properties.");
231 
232  au->addCommandLineOption("--writers", "Prints list of available writers.");
233 
234  au->addCommandLineOption("--zoom-level-gsds", "Prints zoom level gsds for projections EPSG:4326 and EPSG:3857.");
235 
236  ostringstream description;
237  description << DESCRIPTION << "\n\n Examples:\n\n"
238  << " ossim-info --version\n"
239  << " ossim-info -i ./myfile.tif\n"
240  << " prints out only general image information\n\n"
241  << " ossim-info -p ./myfile.tif\n"
242  << " prints out only image projection information\n\n"
243  << " ossim-info -p -s wge ./myfile.tif\n"
244  << " prints out only image projection information and shifts to wgs84\n\n"
245  << " ossim-info -p -i ./myfile.tif\n"
246  << " prints out both image and projection information\n\n"
247  << " ossim-info -p -i ./myfile.tif -o ./myfile.geom\n"
248  << " writes geometry file with both image and projection information\n\n"
249  << " ossim-info -p -i ./myfile.tif -v -o ./myfile.geom\n"
250  << " writes geometry file with both image and projection information\n"
251  << " while overwriting existing .geom file.\n\n"
252  << " ossim-info -f XML ./myfile.tif\n"
253  << " prints out image and projection information as an XML document\n\n"
254  << " ossim-info -d myfile.ntf\n"
255  << " Dumps all data available, in this case, all nitf tags, from file.\n\n"
256  << " ossim-info -d a.toc\n"
257  << " Dumps all data available, in this case, all nitf and rpf tags, from file.\n\n"
258  << " ossim-info --dno a.toc\n"
259  << " \"dno\" for \"dump no overviews\" Dumps all data available,\n"
260  << " in this case, all nitf and rpf tags, from file ignoring overviews.\n\n"
261  << " ossim-info -d -i -p myfile.ntf\n"
262  << " Typical usage case, i.e. do a dump of tags and print out image and\n"
263  << " projection information.\n\n"
264  << std::endl;
265  au->setDescription(description.str());
266 
267 } // void ossimInfo::addArguments(ossimArgumentParser& ap)
static const char * DESCRIPTION
Used by ossimUtilityFactory.
Definition: ossimInfo.h:40
std::string getApplicationName() const
return the application name, as specified by argv[0]
void addCommandLineOption(const ossimString &option, const ossimString &explanation)
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
void addOptions(ossimArgumentParser &parser)
Definition: ossimInit.cpp:100
void setCommandLineUsage(const ossimString &explanation)
ossimApplicationUsage * getApplicationUsage()
void setDescription(const ossimString &desc)
static ossimInit * instance()
Definition: ossimInit.cpp:89

◆ testPlugin() [1/2]

void ossimInfo::testPlugin ( const ossimFilename plugin) const

Test a plugin load and outputs to stdout.

Parameters
pluginPlugin to test.

Definition at line 3097 of file ossimInfo.cpp.

References ossimNotify(), and ossimNotifyLevel_INFO.

3098 {
3100 }
void testPlugin(const ossimFilename &plugin) const
Test a plugin load and outputs to stdout.
Definition: ossimInfo.cpp:3097
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ testPlugin() [2/2]

std::ostream & ossimInfo::testPlugin ( const ossimFilename plugin,
std::ostream &  out 
) const

Test a plugin load outputs to stream.

Parameters
pluginPlugin to test.
outStream to write to.
stream

Definition at line 3102 of file ossimInfo.cpp.

References ossimFilename::expand(), and ossimSharedPluginRegistry::instance().

3103 {
3104  if( ossimSharedPluginRegistry::instance()->registerPlugin(plugin.expand()) )
3105  {
3106  out << "Plugin loaded: " << plugin << std::endl;
3107  }
3108  else
3109  {
3110  out << "Unable to load plugin: " << plugin << std::endl;
3111  }
3112  return out;
3113 }
ossimFilename expand() const
Method to do file name expansion.
static ossimSharedPluginRegistry * instance()

Member Data Documentation

◆ DESCRIPTION

const char * ossimInfo::DESCRIPTION
static
Initial value:
=
"Dumps metadata information about input image and OSSIM in general."

Used by ossimUtilityFactory.

Definition at line 40 of file ossimInfo.h.

Referenced by ossimToolFactory::getCapabilities(), and setUsage().

◆ m_img

ossimRefPtr<ossimImageHandler> ossimInfo::m_img
private

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