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

#include <ossimHdf5ProjectionFactory.h>

Inheritance diagram for ossimHdf5ProjectionFactory:
ossimProjectionFactoryBase ossimProjectionFactoryBase ossimObjectFactory ossimObjectFactory ossimObject ossimObject ossimReferenced ossimReferenced

Public Member Functions

virtual ossimProjectioncreateProjection (const ossimFilename &filename, ossim_uint32 entryIdx) const
 Takes a filename. More...
 
virtual ossimProjectioncreateProjection (const ossimString &name) const
 Take a projection type name. More...
 
virtual ossimProjectioncreateProjection (const ossimKeywordlist &kwl, const char *prefix=0) const
 Take a keywordlist. More...
 
virtual ossimObjectcreateObject (const ossimString &typeName) const
 
virtual ossimObjectcreateObject (const ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual void getTypeNameList (std::vector< ossimString > &typeList) const
 
void addProjDataPath (const ossimString &projPath)
 Specifies which HDF5 internal paths to search through to locate geometry information. More...
 
virtual ossimProjectioncreateProjection (const ossimFilename &filename, ossim_uint32 entryIdx) const
 Takes a filename. More...
 
virtual ossimProjectioncreateProjection (const ossimString &name) const
 Take a projection type name. More...
 
virtual ossimProjectioncreateProjection (const ossimKeywordlist &kwl, const char *prefix=0) const
 Take a keywordlist. More...
 
virtual ossimObjectcreateObject (const ossimString &typeName) const
 
virtual ossimObjectcreateObject (const ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual void getTypeNameList (std::vector< ossimString > &typeList) const
 
- Public Member Functions inherited from ossimProjectionFactoryBase
virtual ossimProjectioncreateProjection (ossimImageHandler *handler) const
 
- Public Member Functions inherited from ossimObjectFactory
virtual ~ossimObjectFactory ()
 
- 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
 

Static Public Member Functions

static ossimHdf5ProjectionFactoryinstance ()
 
static ossimHdf5ProjectionFactoryinstance ()
 

Protected Member Functions

 ossimHdf5ProjectionFactory ()
 
 ossimHdf5ProjectionFactory ()
 
- Protected Member Functions inherited from ossimProjectionFactoryBase
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 ()
 

Protected Attributes

std::vector< ossimStringm_projDataPaths
 

Detailed Description

Definition at line 14 of file ossimHdf5ProjectionFactory.h.

Constructor & Destructor Documentation

◆ ossimHdf5ProjectionFactory() [1/2]

ossimHdf5ProjectionFactory::ossimHdf5ProjectionFactory ( )
protected

Definition at line 89 of file ossimHdf5ProjectionFactory.cpp.

Referenced by instance().

90 {
91 }

◆ ossimHdf5ProjectionFactory() [2/2]

ossimHdf5ProjectionFactory::ossimHdf5ProjectionFactory ( )
protected

Member Function Documentation

◆ addProjDataPath()

void ossimHdf5ProjectionFactory::addProjDataPath ( const ossimString projPath)
inline

Specifies which HDF5 internal paths to search through to locate geometry information.

This can be either explicit dataset names, or group names containing known datasets, such as "Latitude" and "longitude". The plugins depending on HDF5 should register their geometry groups here in the same order as image entries.

Definition at line 53 of file ossimHdf5ProjectionFactory.h.

53 { m_projDataPaths.push_back(projPath); }
std::vector< ossimString > m_projDataPaths

◆ createObject() [1/4]

ossimObject * ossimHdf5ProjectionFactory::createObject ( const ossimString typeName) const
virtual

Creates an object given a type name.

Implements ossimObjectFactory.

Definition at line 72 of file ossimHdf5ProjectionFactory.cpp.

References createProjection().

74 {
75  return createProjection(typeName);
76 }
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
Takes a filename.

◆ createObject() [2/4]

virtual ossimObject* ossimHdf5ProjectionFactory::createObject ( const ossimString typeName) const
virtual

Creates an object given a type name.

Implements ossimObjectFactory.

◆ createObject() [3/4]

ossimObject * ossimHdf5ProjectionFactory::createObject ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Creates and object given a keyword list.

Implements ossimObjectFactory.

Definition at line 78 of file ossimHdf5ProjectionFactory.cpp.

References createProjection().

80 {
81  return createProjection(kwl, prefix);
82 }
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
Takes a filename.

◆ createObject() [4/4]

virtual ossimObject* ossimHdf5ProjectionFactory::createObject ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Creates and object given a keyword list.

Implements ossimObjectFactory.

◆ createProjection() [1/6]

ossimProjection * ossimHdf5ProjectionFactory::createProjection ( const ossimFilename filename,
ossim_uint32  entryIdx 
) const
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.

Implements ossimProjectionFactoryBase.

Definition at line 23 of file ossimHdf5ProjectionFactory.cpp.

References ossimProjectionFactoryBase::createProjectionFromGeometryFile(), ossimRefPtr< T >::get(), ossimHdf5GridModel::initialize(), ossimHdf5::open(), ossimRefPtr< T >::release(), and ossimRefPtr< T >::valid().

Referenced by createObject().

25 {
26  // Try external geom file first:
27  ossimRefPtr<ossimProjection> projection = createProjectionFromGeometryFile(filename, entryIdx);
28  if (!projection.valid())
29  {
30  // Try internal grid model. This may be specific to VIIRS. In any case, it is not very
31  // robust as this model simply looks for "Latitude" and "Longitude" dataset names, ignoring
32  // multiple entries with potentially different geometries for each. Eventually should
33  // provide for the specification of specific dataset names or at least path to parent group.
34  // This is not trivial with only an entry index available. (OLK 08/16)
36  if (hdf5->open(filename))
37  {
39  hdf5_grid->initialize(hdf5.get());
40  }
41  }
42 
43  // Must release or pointer will self destruct when it goes out of scope.
44  return projection.release();
45 }
ossimProjection * createProjectionFromGeometryFile(const ossimFilename &imageFile, ossim_uint32 entryIdx) const
This method takes the filename and tries to find an external ".geom" file.
bool valid() const
Definition: ossimRefPtr.h:75
bool open(const ossimFilename &hdf5File)
Opens specified HDF5 file.
Definition: ossimHdf5.cpp:29
bool initialize(ossimHdf5 *hdf5, const ossimString &projDataPath="")
Initializes from an open HDF5 file.
T * release()
Definition: ossimRefPtr.h:93
Low-level OSSIM interface to HDF5 libraries.
Definition: ossimHdf5.h:27

◆ createProjection() [2/6]

virtual ossimProjection* ossimHdf5ProjectionFactory::createProjection ( const ossimFilename filename,
ossim_uint32  entryIdx 
) const
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.

Implements ossimProjectionFactoryBase.

◆ createProjection() [3/6]

virtual ossimProjection* ossimHdf5ProjectionFactory::createProjection ( const ossimString name) const
virtual

Take a projection type name.

Implements ossimProjectionFactoryBase.

◆ createProjection() [4/6]

ossimProjection * ossimHdf5ProjectionFactory::createProjection ( const ossimString name) const
virtual

Take a projection type name.

Implements ossimProjectionFactoryBase.

Definition at line 47 of file ossimHdf5ProjectionFactory.cpp.

48 {
49  return 0;
50 }

◆ createProjection() [5/6]

ossimProjection * ossimHdf5ProjectionFactory::createProjection ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Take a keywordlist.

Implements ossimProjectionFactoryBase.

Definition at line 52 of file ossimHdf5ProjectionFactory.cpp.

References ossimKeywordlist::add(), ossimKeywordlist::find(), ossimProjection::loadState(), ossimRefPtr< T >::release(), and ossimKeywordNames::TYPE_KW.

54 {
56  ossimString value = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
57  if ((value != "ossimHdf5GridModel") && (value != "ossimH5GridModel"))
58  return 0;
59 
60  // The HDF5 grid model is just an implementation of the coarse grid model, but the geom file
61  // is purely the latter, so trick the KWL to properly load an OCG model:
62  ossimKeywordlist new_kwl (kwl);
63  new_kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimCoarseGridModel", true);
64 
65  result = new ossimHdf5GridModel;
66  if( !result->loadState(new_kwl, prefix) )
67  result = 0;
68 
69  return result.release();
70 }
Represents serializable keyword/value map.
const char * find(const char *key) const
static const char * TYPE_KW
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
T * release()
Definition: ossimRefPtr.h:93

◆ createProjection() [6/6]

virtual ossimProjection* ossimHdf5ProjectionFactory::createProjection ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Take a keywordlist.

Implements ossimProjectionFactoryBase.

◆ getTypeNameList() [1/2]

void ossimHdf5ProjectionFactory::getTypeNameList ( std::vector< ossimString > &  typeList) const
virtual

This should return the type name of all objects in all factories. This is the name used to construct the objects dynamially and this name must be unique.

Implements ossimObjectFactory.

Definition at line 84 of file ossimHdf5ProjectionFactory.cpp.

85 {
86  typeList.push_back(ossimString("ossimHdf5GridModel"));
87 }

◆ getTypeNameList() [2/2]

virtual void ossimHdf5ProjectionFactory::getTypeNameList ( std::vector< ossimString > &  typeList) const
virtual

This should return the type name of all objects in all factories. This is the name used to construct the objects dynamially and this name must be unique.

Implements ossimObjectFactory.

◆ instance() [1/2]

ossimHdf5ProjectionFactory * ossimHdf5ProjectionFactory::instance ( )
static

◆ instance() [2/2]

static ossimHdf5ProjectionFactory* ossimHdf5ProjectionFactory::instance ( )
static

Member Data Documentation

◆ m_projDataPaths

std::vector<ossimString> ossimHdf5ProjectionFactory::m_projDataPaths
protected

Definition at line 59 of file ossimHdf5ProjectionFactory.h.


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