OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimEnviHeaderFileWriter.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 // Copyright (c) 2005, David Burken, all rights reserved.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: David Burken
9 //
10 // Description:
11 //
12 // Class definition for ossimEnviHeaderFileWriter. Meta data class for
13 // writing an ENVI (The Environment for Visualizing Images) header file.
14 //
15 //----------------------------------------------------------------------------
16 // $Id: ossimEnviHeaderFileWriter.cpp 21631 2012-09-06 18:10:55Z dburken $
17 
20 #include <ossim/base/ossimIrect.h>
26 
27 
29  "ossimEnviHeaderFileWriter",
31 
33  :
35  theHdr()
36 {
37 }
38 
40 {
41 }
42 
44  const char* prefix)
45 {
46  bool result = false;
47 
48  if (ossimMetadataFileWriter::loadState(kwl, prefix))
49  {
50  result = theHdr.loadState(kwl, prefix);
51  }
52 
53  return result;
54 }
55 
56 bool writeFile()
57 {
58  bool result = true;
59 
60  return result;
61 }
62 
64 {
68 
69  // Get the geometry from the input.
70  // Get the geometry from the input.
71  ossimMapProjection* mapProj = 0;
73  if ( inputGeom.valid() ) mapProj = PTR_CAST(ossimMapProjection, inputGeom->getProjection());
74  if (mapProj)
75  {
76  // Create the projection info.
79 
80  // Set the tie points in the keyword list.
81  ossimKeywordlist kwl;
82  projectionInfo->getGeom(kwl);
83 
84  // Pass it on to envi header to set the map info string from geometry.
85  theHdr.setMapInfo(kwl);
86  }
87 
89 }
90 
92  std::vector<ossimString>& metadatatypeList) const
93 {
94  metadatatypeList.push_back(ossimString("envi_header"));
95 }
96 
98  const ossimString& metadataType)const
99 {
100  return (metadataType == "envi_header");
101 }
virtual void getMetadatatypeList(std::vector< ossimString > &metadatatypeList) const
Satisfies pure virtual from ossimMetadataWriter base.
RTTI_DEF1(ossimEnviHeaderFileWriter, "ossimEnviHeaderFileWriter", ossimMetadataFileWriter) ossimEnviHeaderFileWriter
void setMapInfo(const ossimString &mapInfo)
Sets the envi map info string.
virtual bool writeFile()
Write out the file.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Initializes the state of the writer.
void setBands(ossim_uint32 bands)
Sets the number of bands.
Represents serializable keyword/value map.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 height() const
Definition: ossimIrect.h:487
virtual bool hasMetadataType(const ossimString &metadataType) const
Satisfies pure virtual from ossimMetadataWriter base.
ossimEnviHeaderFileWriter()
default constructor
void setSamples(ossim_uint32 samples)
Sets the number of samples.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Load state method:
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
ossimMetadataFileWriter
virtual ~ossimEnviHeaderFileWriter()
virtual destructor
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
void getGeom(ossimKeywordlist &kwl, const char *prefix=0) const
Adds tie point to keyword list.
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
bool writeFile()
ossimImageSource * theInputConnection
bool writeFile(const ossimFilename &file)
Writes header to file in a standard envi format.
Class for writing a "ENVI" style header.
void setLines(ossim_uint32 lines)
Sets the number of lines.