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

ossimReadmeFileWriter More...

#include <ossimReadmeFileWriter.h>

Inheritance diagram for ossimReadmeFileWriter:
ossimMetadataFileWriter ossimConnectableObject ossimProcessInterface ossimConnectableObjectListener ossimObject ossimListenerManager ossimPropertyInterface ossimListener ossimReferenced

Public Member Functions

 ossimReadmeFileWriter ()
 default constructor More...
 
virtual void getMetadatatypeList (std::vector< ossimString > &metadatatypeList) const
 Satisfies pure virtual from ossimMetadataWriter base. More...
 
virtual bool hasMetadataType (const ossimString &metadataType) const
 Satisfies pure virtual from ossimMetadataWriter base. More...
 
- Public Member Functions inherited from ossimMetadataFileWriter
 ossimMetadataFileWriter ()
 
virtual ossimObjectgetObject ()
 
virtual const ossimObjectgetObject () const
 
virtual void initialize ()
 
virtual bool execute ()
 
virtual void setPercentComplete (double percentComplete)
 
virtual void setFilename (const ossimFilename &file)
 
const ossimFilenamegetFilename () const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Load state method: More...
 
bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 required to be overriden by derived classes More...
 
virtual void disconnectInputEvent (ossimConnectionEvent &event)
 
virtual void connectInputEvent (ossimConnectionEvent &event)
 
virtual void propertyEvent (ossimPropertyEvent &event)
 
virtual void setPixelType (ossimPixelType pixelType)
 Ossim uses a concept of "pixel is point" internally. More...
 
virtual ossimPixelType getPixelType () const
 
virtual void setAreaOfInterest (const ossimIrect &areaOfInterest)
 Sets the area of interest to write the meta data for. More...
 
virtual ossimIrect getAreaOfInterest () const
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- 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 ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimProcessInterface
 ossimProcessInterface ()
 
virtual ~ossimProcessInterface ()
 
virtual void abort ()
 
bool needsAborting () const
 
bool isAbortRequested () const
 
bool isAborted () const
 
bool isExecuting () const
 
ossimProcessStatus getProcessStatus () const
 
virtual void setProcessStatus (ossimProcessStatus processStatus)
 
virtual double getPercentComplete () const
 
virtual ossimListenerManagergetManager ()
 
void enableEvents ()
 
void disableEvents ()
 
void setCurrentMessage (const ossimString &message)
 
virtual std::ostream & print (std::ostream &out) const
 
- Public Member Functions inherited from ossimConnectableObjectListener
 ossimConnectableObjectListener ()
 
virtual ~ossimConnectableObjectListener ()
 
virtual void processEvent (ossimEvent &event)
 ProcessEvent. More...
 
virtual void objectDestructingEvent (ossimObjectDestructingEvent &)
 
virtual void connectionEvent (ossimConnectionEvent &)
 
virtual void disconnectOutputEvent (ossimConnectionEvent &)
 
virtual void connectOutputEvent (ossimConnectionEvent &)
 
virtual void addObjectEvent (ossimContainerEvent &)
 
virtual void removeObjectEvent (ossimContainerEvent &)
 
virtual void containerEvent (ossimContainerEvent &)
 
virtual void refreshEvent (ossimRefreshEvent &)
 
- Public Member Functions inherited from ossimListener
 ossimListener ()
 
virtual ~ossimListener ()
 
void enableListener ()
 
void disableListener ()
 
void setListenerEnableFlag (bool flag)
 
bool isListenerEnabled () const
 
bool getListenerEnableFlag () const
 

Protected Member Functions

virtual ~ossimReadmeFileWriter ()
 virtual destructor More...
 
virtual bool writeFile ()
 Write out the file. More...
 
- Protected Member Functions inherited from ossimMetadataFileWriter
virtual ~ossimMetadataFileWriter ()
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Additional Inherited Members

- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 
- Public Types inherited from ossimProcessInterface
enum  ossimProcessStatus {
  PROCESS_STATUS_UNKNOWN = 0, PROCESS_STATUS_EXECUTING = 1, PROCESS_STATUS_ABORTED = 2, PROCESS_STATUS_ABORT_REQUEST = 3,
  PROCESS_STATUS_NOT_EXECUTING = 4
}
 
- Protected Attributes inherited from ossimMetadataFileWriter
ossimImageSourcetheInputConnection
 
ossimFilename theFilename
 
ossimPixelType thePixelType
 
ossimIrect theAreaOfInterest
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimProcessInterface
double thePercentComplete
 
ossimProcessStatus theProcessStatus
 
ossimString theMessage
 
bool theEventFlag
 
- Protected Attributes inherited from ossimListener
bool theListenerEnableFlag
 

Detailed Description

ossimReadmeFileWriter

Definition at line 20 of file ossimReadmeFileWriter.h.

Constructor & Destructor Documentation

◆ ossimReadmeFileWriter()

ossimReadmeFileWriter::ossimReadmeFileWriter ( )

default constructor

Definition at line 37 of file ossimReadmeFileWriter.cpp.

◆ ~ossimReadmeFileWriter()

ossimReadmeFileWriter::~ossimReadmeFileWriter ( )
protectedvirtual

virtual destructor

Definition at line 46 of file ossimReadmeFileWriter.cpp.

47 {
48 }

Member Function Documentation

◆ getMetadatatypeList()

void ossimReadmeFileWriter::getMetadatatypeList ( std::vector< ossimString > &  metadatatypeList) const
virtual

Satisfies pure virtual from ossimMetadataWriter base.

Appends the writers image types to the "metadatatypeList".

Parameters
metadatatypeListstl::vector<ossimString> list to append to.
Note
Appends to the list, does not clear it first.

Implements ossimMetadataFileWriter.

Definition at line 443 of file ossimReadmeFileWriter.cpp.

444 {
445  metadatatypeList.push_back(ossimString("ossim_readme"));
446 }

◆ hasMetadataType()

bool ossimReadmeFileWriter::hasMetadataType ( const ossimString metadataType) const
virtual

Satisfies pure virtual from ossimMetadataWriter base.

Parameters
imageTypestring representing image type.
Returns
true if "metadataType" is supported by writer.

Implements ossimMetadataFileWriter.

Definition at line 451 of file ossimReadmeFileWriter.cpp.

452 {
453  return (metadataType == "ossim_readme");
454 }

◆ writeFile()

bool ossimReadmeFileWriter::writeFile ( )
protectedvirtual

Write out the file.

Returns
true on success, false on error.

Implements ossimMetadataFileWriter.

Definition at line 53 of file ossimReadmeFileWriter.cpp.

References ossimMetadataFileWriter::theInputConnection.

54 {
55  static const char MODULE[] = "ossimReadmeFileWriter::writeFile";
56 
58  {
59  if (traceDebug())
60  {
61  CLOG << "DEBUG:"
62  << "\nNo input connection! Returning..."
63  << endl;
64  }
65 
66  return false;
67  }
68 
69  std::ofstream out(theFilename.c_str(), ios_base::out);
70  if (!out)
71  return false;
72 
73  // Fetch the map projection of the input image if it exists:
74  const ossimMapProjection* mapProj = 0;
76  if ( imgGeom.valid() )
77  {
78  const ossimProjection* proj = imgGeom->getProjection();
79  mapProj = PTR_CAST(ossimMapProjection, proj);
80  }
81  if (!mapProj)
82  {
83  out.close();
84  return false;
85  }
86 
87  ossimMapProjectionInfo* projectionInfo = new ossimMapProjectionInfo(mapProj, theAreaOfInterest);
88  if(projectionInfo)
89  {
90  out << setiosflags(ios::fixed)
91  << setiosflags(ios::left)
92  << setw(16) << "Image: "
93  << projectionInfo->getImageInfoString();
94 
95  out << setw(17) << "\nLines:"
96  << projectionInfo->linesPerImage()
97  << setw(17) << "\nSamples:"
98  << projectionInfo->pixelsPerLine()
99  << setw(17) << "\nPixel Size x:"
100  << setprecision(8)
101  << projectionInfo->getMetersPerPixel().x
102  << " meters";
103 
104  out << ", "
105  << setprecision(8)
106  << projectionInfo->getUsSurveyFeetPerPixel().x
107  << " U.S. feet";
108 
109  out << setw(17) << "\nPixel Size y:"
110  << setprecision(8)
111  << projectionInfo->getMetersPerPixel().y
112  << " meters";
113 
114  out << ", "
115  << setprecision(8)
116  << projectionInfo->getUsSurveyFeetPerPixel().y
117  << " U.S. feet";
118 
119  const ossimString type = TYPE_NAME(mapProj);
120  const ossimString datum = mapProj->getDatum()->code();
121  const ossimString ellipsoid = mapProj->getEllipsoid().code();
122 
123  if(type)
124  out << setw(17) << "\nProjection:" << type;
125 
126  const ossimUtmProjection* utmProj = PTR_CAST(ossimUtmProjection, mapProj);
127  if (utmProj)
128  out << setw(17) << "\nUTM map zone:" << utmProj->getZone();
129 
130  if(datum && ellipsoid)
131  out << setw(17) << "\nDatum:" << datum
132  << setw(17) << "\nEllipsoid:"
133  << ellipsoid;
134 
135  out << resetiosflags(ios::left) << endl;
136 
137  const ossimString NORTH = "N";
138  const ossimString SOUTH = "S";
139  const ossimString EAST = "E";
140  const ossimString WEST = "W";
141 
142  ossimString tmpString;
143  double tmpDouble;
144 
145  // HACK: Easiest way to get projection info for optional params is via the old keywordlist:
146  ossimKeywordlist kwl;
147  mapProj->saveState(kwl);
148  const char* parallel1 = kwl.find(ossimKeywordNames::STD_PARALLEL_1_KW);
149  const char* parallel2 = kwl.find(ossimKeywordNames::STD_PARALLEL_2_KW);
150  const char* scaleFactor = kwl.find(ossimKeywordNames::SCALE_FACTOR_KW);
151 
152 
153  ossimString proj_name = mapProj->getClassName();
154  if ( ( proj_name.contains("Lambert") ) ||
155  ( proj_name.contains("Albers") ) ||
156  ( proj_name.contains("TransverseMercator" ) ) )
157  {
158  double falseEasting = mapProj->getFalseEasting();
159  double falseNorthing = mapProj->getFalseNorthing();
160 
161  double origin_lat = mapProj->origin().latd();
162  tmpDouble = fabs(origin_lat);
163  tmpString = (origin_lat < 0.0) ? SOUTH : NORTH;
164  out << setiosflags(ios::left)
165  << "\n"
166  << setw(18) << "Origin Latitude:"
167  << resetiosflags(ios::left)
168  << setw(21) << setprecision(12) << tmpDouble
169  << tmpString << endl;
170 
171  double origin_lon = mapProj->origin().lond();
172  tmpDouble = fabs(origin_lon);
173  tmpString = (origin_lon < 0.0) ? WEST : EAST;
174  out << setiosflags(ios::left)
175  << setw(18) << "Origin Longitude:"
176  << resetiosflags(ios::left)
177  << setw(21) << tmpDouble << tmpString
178  << setiosflags(ios::left)
179  << "\n"
180  << setw(23) << "False Easting:"
181  << resetiosflags(ios::left)
182  << setw(17) << setprecision(4)
183  << falseEasting;
184 
185  out << " meters, " << setprecision(4)
186  << ossim::mtrs2usft(falseEasting)
187  << " U.S. feet";
188 
189  out << endl;
190 
191  out << setiosflags(ios::left)
192  << setw(23) << "False Northing:"
193  << resetiosflags(ios::left)
194  << setw(17) << setprecision(4)
195  << falseNorthing;
196 
197  out << " meters, " << setprecision(4)
198  << ossim::mtrs2usft(falseNorthing)
199  << " U.S. feet";
200 
201  out << endl;
202 
203  } // End of if "Alber Lambert or TM.
204 
205  if (proj_name.contains("TransverseMercator"))
206  {
207 
208  out << setiosflags(ios::left)
209  << "\n"
210  << setw(18) << "Scale Factor:"
211  << resetiosflags(ios::left)
212  << setw(21) << setprecision(10)
213  << ossimString(scaleFactor).toDouble()
214  << "\n" << endl;
215  }
216 
217  if ( (proj_name.contains("Lambert") ) ||
218  (proj_name.contains("Albers") ) )
219  {
220  double stdpar1 = ossimString(parallel1).toDouble();
221  tmpDouble = fabs(stdpar1);
222  tmpString = (stdpar1 < 0.0) ? SOUTH : NORTH;
223  out << setiosflags(ios::left)
224  << setw(23) << "Standard Parallel #1:"
225  << resetiosflags(ios::left)
226  << setw(16) << setprecision(12) << tmpDouble
227  << tmpString << endl;
228 
229  double stdpar2 = ossimString(parallel2).toDouble();
230  tmpDouble = fabs(stdpar2);
231  tmpString = (stdpar2 < 0.0) ? SOUTH : NORTH;
232  out << setiosflags(ios::left)
233  << setw(23) << "Standard Parallel #2:"
234  << resetiosflags(ios::left)
235  << setw(16) << setprecision(12)
236  << tmpDouble << tmpString
237  << "\n" << endl;
238  }
239 
240  ossimString cornerString[4] = { "Upper Left",
241  "Upper Right",
242  "Lower Right",
243  "Lower Left" };
244 
245  //---
246  // Add a note to the readme file stating what the corner coordinates
247  // are relative to.
248  //---
249  if (projectionInfo->getPixelType() == OSSIM_PIXEL_IS_AREA)
250  {
251  out
252  << "\nCorner coordinates relative to outer edge of pixel.\n\n";
253  }
254  else
255  {
256  out
257  << "\nCorner coordinates relative to center of pixel.\n\n";
258  }
259 
260  out << "Corner Coordinates:\n\n";
261 
262  //---
263  // Upper Left Corner Points
264  //---
265  tmpDouble = fabs(projectionInfo->ulGroundPt().latd());
266  tmpString = (projectionInfo->ulGroundPt().latd() < 0.0) ? SOUTH : NORTH;
267  out << cornerString[0] << endl;
268  out << setw(14) << "Latitude: "
269  << setw(16) << setprecision(12) << tmpDouble
270  << tmpString << endl;
271  tmpDouble = fabs(projectionInfo->ulGroundPt().lond());
272  tmpString = (projectionInfo->ulGroundPt().lond() < 0.0) ? WEST : EAST;
273  out << setw(14) << "Longitude: "
274  << setw(16) << tmpDouble << tmpString << endl;
275 
276  out << setw(14) << "Easting: "
277  << setw(17) << setprecision(4)
278  << projectionInfo->ulEastingNorthingPt().x;
279 
280  out << " meters, " << setprecision(4)
281  << ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().x)
282  << " U.S. feet";
283 
284  out << endl
285  << setw(14) << "Northing: "
286  << setw(17) << projectionInfo->ulEastingNorthingPt().y;
287 
288  out << " meters, " << setprecision(4)
289  << ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().y)
290  << " U.S. feet";
291 
292  out << endl << endl;
293 
294  //---
295  // Upper Right Corner Points
296  //---
297  tmpDouble = fabs(projectionInfo->urGroundPt().latd());
298  tmpString = (projectionInfo->urGroundPt().latd() < 0.0) ? SOUTH : NORTH;
299  out << cornerString[1] << endl;
300  out << setw(14) << "Latitude: "
301  << setw(16) << setprecision(12) << tmpDouble
302  << tmpString << endl;
303  tmpDouble = fabs(projectionInfo->urGroundPt().lond());
304  tmpString = (projectionInfo->urGroundPt().lond() < 0.0) ? WEST : EAST;
305  out << setw(14) << "Longitude: "
306  << setw(16) << tmpDouble << tmpString << endl;
307 
308  out << setw(14) << "Easting: "
309  << setw(17) << setprecision(4)
310  << projectionInfo->urEastingNorthingPt().x;
311 
312  out << " meters, " << setprecision(4)
313  << ossim::mtrs2usft(projectionInfo->urEastingNorthingPt().x)
314  << " U.S. feet";
315 
316  out << endl
317  << setw(14) << "Northing: "
318  << setw(17) << projectionInfo->urEastingNorthingPt().y;
319 
320  out << " meters, " << setprecision(4)
321  << ossim::mtrs2usft(projectionInfo->urEastingNorthingPt().y)
322  << " U.S. feet";
323 
324  out << endl << endl;
325 
326  //---
327  // Lower Right Corner Points
328  //---
329  tmpDouble = fabs(projectionInfo->lrGroundPt().latd());
330  tmpString = (projectionInfo->lrGroundPt().latd() < 0.0) ? SOUTH : NORTH;
331  out << cornerString[2] << endl;
332  out << setw(14) << "Latitude: "
333  << setw(16) << setprecision(12) << tmpDouble
334  << tmpString << endl;
335  tmpDouble = fabs(projectionInfo->lrGroundPt().lond());
336  tmpString = (projectionInfo->lrGroundPt().lond() < 0.0) ? WEST : EAST;
337  out << setw(14) << "Longitude: "
338  << setw(16) << tmpDouble << tmpString << endl;
339 
340  out << setw(14) << "Easting: "
341  << setw(17) << setprecision(4)
342  << projectionInfo->lrEastingNorthingPt().x;
343 
344  out << " meters, " << setprecision(4)
345  << ossim::mtrs2usft(projectionInfo->lrEastingNorthingPt().x)
346  << " U.S. feet";
347 
348  out << endl
349  << setw(14) << "Northing: "
350  << setw(17) << projectionInfo->lrEastingNorthingPt().y;
351 
352  out << " meters, " << setprecision(4)
353  << ossim::mtrs2usft(projectionInfo->lrEastingNorthingPt().y)
354  << " U.S. feet";
355 
356  out << endl << endl;
357 
358  //---
359  // Lower Left Corner Points
360  //---
361  tmpDouble = fabs(projectionInfo->llGroundPt().latd());
362  tmpString = (projectionInfo->llGroundPt().latd() < 0.0) ? SOUTH : NORTH;
363  out << cornerString[3] << endl;
364  out << setw(14) << "Latitude: "
365  << setw(16) << setprecision(12) << tmpDouble
366  << tmpString << endl;
367  tmpDouble = fabs(projectionInfo->llGroundPt().lond());
368  tmpString = (projectionInfo->llGroundPt().lond() < 0.0) ? WEST : EAST;
369  out << setw(14) << "Longitude: "
370  << setw(16) << tmpDouble << tmpString << endl;
371 
372  out << setw(14) << "Easting: "
373  << setw(17) << setprecision(4)
374  << projectionInfo->llEastingNorthingPt().x;
375 
376  out << " meters, " << setprecision(4)
377  << ossim::mtrs2usft(projectionInfo->llEastingNorthingPt().x)
378  << " U.S. feet";
379 
380  out << endl
381  << setw(14) << "Northing: "
382  << setw(17) << projectionInfo->llEastingNorthingPt().y;
383 
384  out << " meters, " << setprecision(4)
385  << ossim::mtrs2usft(projectionInfo->llEastingNorthingPt().y)
386  << " U.S. feet";
387 
388  out << endl << endl;
389 
390  out << "Center Coordinates:\n\n";
391 
392  tmpDouble = fabs(projectionInfo->centerGroundPt().latd());
393 
394  tmpString = (projectionInfo->centerGroundPt().latd() < 0.0) ? SOUTH : NORTH;
395 
396  out << setw(14) << "Latitude: "
397  << setw(16) << setprecision(12) << tmpDouble
398  << tmpString << endl;
399 
400  tmpDouble = fabs(projectionInfo->centerGroundPt().lond());
401 
402  tmpString = (projectionInfo->centerGroundPt().lond() < 0.0) ? WEST : EAST;
403 
404  out << setw(14) << "Longitude: "
405  << setw(16) << tmpDouble << tmpString << endl;
406 
407  out << setw(14) << "Easting: "
408  << setw(17) << setprecision(4)
409  << projectionInfo->centerEastingNorthingPt().x;
410 
411  out << " meters, " << setprecision(4)
412  << ossim::mtrs2usft(projectionInfo->centerEastingNorthingPt().x)
413  << " U.S. feet";
414 
415  out << endl
416  << setw(14) << "Northing: "
417  << setw(17) << projectionInfo->centerEastingNorthingPt().y;
418 
419  out << " meters, " << setprecision(4)
420  << ossim::mtrs2usft(projectionInfo->centerEastingNorthingPt().y)
421  << " U.S. feet";
422 
423  out << endl << endl;
424 
425  out
426  << "\nNOTE: Lat/Lon values are in decimal degrees.";
427 
428  out
429  << "\n Eastings/Northings are in meters.";
430 
431  out << endl;
432 
433  delete projectionInfo;
434  }
435 
436  out.close();
437  return true;
438 }
ossimGpt urGroundPt() const
Returns the upper right ground point.
#define TYPE_NAME(p)
Definition: ossimRtti.h:326
virtual double getFalseNorthing() const
#define CLOG
Definition: ossimTrace.h:23
ossim_int32 linesPerImage() const
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
ossimDpt getUsSurveyFeetPerPixel() const
Returns the pixel size in U.S.
double y
Definition: ossimDpt.h:165
bool contains(char aChar) const
Definition: ossimString.h:58
virtual const ossimString & code() const
Definition: ossimDatum.h:57
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
ossimDpt lrEastingNorthingPt() const
Returns the lower right easting and northing as a ossimDpt.
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
ossimPixelType getPixelType() const
Returns data member "thePixelType".
virtual const ossimDatum * getDatum() const
ossimGpt lrGroundPt() const
Returns the lower right ground point.
ossimDpt centerEastingNorthingPt() const
ossimString getImageInfoString() const
Returns theImageInfoString.
virtual ossimGpt origin() const
double toDouble() const
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossimGpt ulGroundPt() const
Returns the upper left ground point.
ossimDpt urEastingNorthingPt() const
Returns the upper right easting and northing as a ossimDpt.
static const char * STD_PARALLEL_1_KW
ossim_int32 pixelsPerLine() const
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
ossimDpt llEastingNorthingPt() const
Returns the lower left easting and northing as a ossimDpt.
const ossimString & code() const
ossimDpt getMetersPerPixel() const
Returns the pixel size in meters.
virtual double getFalseEasting() const
const ossimEllipsoid & getEllipsoid() const
ossimDpt ulEastingNorthingPt() const
Returns the upper left easting and northing as a ossimDpt.
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
ossimGpt centerGroundPt() const
Returns the center ground point.
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
ossim_int32 getZone() const
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47
ossimImageSource * theInputConnection
double mtrs2usft(double meters)
Definition: ossimCommon.h:375
static const char * SCALE_FACTOR_KW
static const char * STD_PARALLEL_2_KW
ossimGpt llGroundPt() const
Returns the lower left ground point.

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