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

#include <ossimProjectionFactoryBase.h>

Inheritance diagram for ossimProjectionFactoryBase:
ossimObjectFactory ossimObject ossimReferenced ossimEpsgProjectionFactory ossimGdalProjectionFactory ossimHdf5ProjectionFactory ossimHdf5ProjectionFactory ossimJpipProjectionFactory ossimMapProjectionFactory ossimMiscProjectionFactory ossimNgaProjectionFactory ossimNitfProjectionFactory ossimplugins::ossimPluginProjectionFactory ossimSensorModelFactory ossimTiffProjectionFactory ossimWktProjectionFactory

Public Member Functions

virtual ossimProjectioncreateProjection (const ossimFilename &filename, ossim_uint32 entryIdx) const =0
 takes a filename. More...
 
virtual ossimProjectioncreateProjection (const ossimString &name) const =0
 Take a projection type name. More...
 
virtual ossimProjectioncreateProjection (const ossimKeywordlist &kwl, const char *prefix) const =0
 Take a keywordlist. More...
 
virtual ossimProjectioncreateProjection (ossimImageHandler *handler) const
 
- Public Member Functions inherited from ossimObjectFactory
virtual ~ossimObjectFactory ()
 
virtual ossimObjectcreateObject (const ossimString &typeName) const =0
 
virtual ossimObjectcreateObject (const ossimKeywordlist &kwl, const char *prefix=0) const =0
 
virtual void getTypeNameList (std::vector< ossimString > &typeList) const =0
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Protected Member Functions

ossimProjectioncreateProjectionFromGeometryFile (const ossimFilename &imageFile, ossim_uint32 entryIdx) const
 This method takes the filename and tries to find an external ".geom" file. More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 17 of file ossimProjectionFactoryBase.h.

Member Function Documentation

◆ createProjection() [1/4]

virtual ossimProjection* ossimProjectionFactoryBase::createProjection ( const ossimFilename filename,
ossim_uint32  entryIdx 
) const
pure virtual

takes a filename.

This filename can be an image file or it can also be a ossim .geom file. It could be other forms of geom files as well. The factories job will be to determine what parser to use and return a projection if successful.

Implemented in ossimNitfProjectionFactory, ossimMiscProjectionFactory, ossimEpsgProjectionFactory, ossimWktProjectionFactory, ossimMapProjectionFactory, ossimTiffProjectionFactory, ossimplugins::ossimPluginProjectionFactory, ossimGdalProjectionFactory, ossimNgaProjectionFactory, ossimSensorModelFactory, ossimHdf5ProjectionFactory, ossimHdf5ProjectionFactory, and ossimJpipProjectionFactory.

Referenced by createProjection().

◆ createProjection() [2/4]

virtual ossimProjection* ossimProjectionFactoryBase::createProjection ( const ossimString name) const
pure virtual

◆ createProjection() [3/4]

virtual ossimProjection* ossimProjectionFactoryBase::createProjection ( const ossimKeywordlist kwl,
const char *  prefix 
) const
pure virtual

◆ createProjection() [4/4]

ossimProjection * ossimProjectionFactoryBase::createProjection ( ossimImageHandler handler) const
virtual

Reimplemented in ossimNitfProjectionFactory, and ossimTiffProjectionFactory.

Definition at line 105 of file ossimProjectionFactoryBase.cpp.

References createProjection(), ossimImageHandler::getCurrentEntry(), and ossimImageHandler::getFilename().

106 {
107  if(!handler) return 0;
108  return createProjection(handler->getFilename(), handler->getCurrentEntry());
109 }
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const =0
takes a filename.
virtual const ossimFilename & getFilename() const
Returns the filename.
virtual ossim_uint32 getCurrentEntry() const

◆ createProjectionFromGeometryFile()

ossimProjection * ossimProjectionFactoryBase::createProjectionFromGeometryFile ( const ossimFilename imageFile,
ossim_uint32  entryIdx 
) const
protected

This method takes the filename and tries to find an external ".geom" file.

If the "entryIndx" is 0 and the "imageFile" is foo.ntf this will look for "foo.geom". If that fails it will look for foo_e0.geom.

If the "entryIndx" is 5 and the "imageFile" is foo.ntf this will look for foo_e5.geom.

Parameters
imageFileImage file that needs a projection.
entryIdxFor image files that support multiple images this is the zero base index to that image. Images that don't support multiple indexes should just pass 0.
Returns
An ossimProjection* on success or NULL on failure.

Definition at line 25 of file ossimProjectionFactoryBase.cpp.

Referenced by ossimHdf5ProjectionFactory::createProjection(), ossimSensorModelFactory::createProjection(), ossimNgaProjectionFactory::createProjection(), ossimMapProjectionFactory::createProjection(), and ossimMiscProjectionFactory::createProjection().

26 {
27  if (traceDebug())
28  {
30  << "ossimProjectionFactoryBase::createProjectionFromGeometryFile "
31  << "DEBUG:"
32  << "\nimageFile: " << imageFile
33  << "\nentryIdx: " << entryIdx
34  << std::endl;
35  }
36 
37  // Try to find a geometry file for imageFile.
38 
39  ossimFilename geomFile = imageFile;
40  if (entryIdx == 0)
41  {
42  geomFile.setExtension("geom");
43  if(geomFile.exists())
44  {
45  if (traceDebug())
46  {
48  << "Found geometry file: " << geomFile
49  << std::endl;
50  }
51 
52  ossimKeywordlist kwl;
53  if(kwl.addFile(geomFile))
54  {
55  //---
56  // Add the geometry file to the keyword list.
57  // This was added for ossimCoarseGridModel so it can pick up the
58  // file.ocg with a relative path.
59  //
60  // NOTE: The can't be called "geometry_file" as it causes an infinite loop in the factory
61  // code. (drb - 20140211)
62  //---
63  kwl.addPair( std::string("kwl_source"),
64  geomFile.expand().string(),
65  false); // Don't overwrite if in there already.
66 
68  createProjection(kwl);
69  }
70  }
71  }
72 
73  // Look for an indexed geometry file.
74  geomFile = imageFile.fileNoExtension();
75  geomFile += "_e";
76  geomFile += ossimString::toString(entryIdx);
77  geomFile.setExtension("geom");
78  if(geomFile.exists())
79  {
80  if (traceDebug())
81  {
83  << "Found geometry file: " << geomFile
84  << std::endl;
85  }
86 
87  ossimKeywordlist kwl;
88  if(kwl.addFile(geomFile))
89  {
91  createProjection(kwl);
92  }
93  }
94 
95  if (traceDebug())
96  {
98  << "DEBUG: No geometry file found. Returning NULL..."
99  << std::endl;
100  }
101 
102  return NULL;
103 }
Represents serializable keyword/value map.
bool addFile(const char *file)
ossimFilename expand() const
Method to do file name expansion.
static ossimString toString(bool aValue)
Numeric to string methods.
void addPair(const std::string &key, const std::string &value, bool overwrite=true)
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const =0
takes a filename.
bool exists() const
static ossimProjectionFactoryRegistry * instance()
ossimFilename fileNoExtension() const
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
const std::string & string() const
Definition: ossimString.h:414

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