31 static const string IMAGE_DATASET_KW =
"image_dataset";
32 static const string GEOM_DATASET_KW =
"geom_dataset";
33 static const string LIST_DATASETS_KW =
"list_datasets";
34 static const string LIST_NDIMS_KW =
"list_ndims";
35 static const string DUMP_INFO_KW =
"dump_info";
36 static const string DUMP_KWL_KW =
"dump_kwl";
41 m_listDatasets (false),
42 m_listNdimDatasets (false)
55 usageString +=
" hdf5 [options] [--i <input-hdf5-file>] [-o <output-image>]";
61 "Full HDF5-internal path to geometry dataset to use for image. ");
63 "Full HDF5-internal path to pixel dataset to extract. ");
65 "Lists all datasets with extents. ");
67 "Lists all datasets with extents that are of rank 2 or higher.");
69 "Dumps the geometry keyword-list to the specified file or the console if no filename specified.");
71 "Outputs human-readable dump of all objects in the file");
73 "Outputs keywordlist dump of all objects in the file");
86 std::string tempString1;
88 const string TRUE_STR (
"true");
90 if ( ap.
read(
"--geom-dataset", stringParam1) || ap.
read(
"--gdata", stringParam1))
93 if ( ap.
read(
"--geom", stringParam1))
96 if ( ap.
read(
"--image-dataset", stringParam1) || ap.
read(
"--idata", stringParam1))
99 if ( ap.
read(
"--list-datasets"))
102 if ( ap.
read(
"--list-ndims") )
105 if ( ap.
read(
"--info") )
108 if ( ap.
read(
"--kwl") )
157 if (hdfFile.
empty() )
159 xmsg<<
"ERROR: ossimHdf5Tool:"<<__LINE__<<
" -- No input filename was specified.";
166 xmsg<<
"ERROR: ossimHdf5Tool:"<<__LINE__<<
" -- Could not open <"<<hdfFile
167 <<
"> as an HDF5 file.";
180 xmsg<<
"ERROR: ossimHdf5Tool:"<<__LINE__<<
" -- No input chain available. Make sure an HDF5" 181 " input file name is specified";
201 errMsg<<
"ERROR: ossimHdf5Tool:"<<__LINE__<<
" -- No input HDF5 file name specified.";
214 if (!handler.
valid())
216 errMsg<<
"ERROR: ossimHdf5Tool:"<<__LINE__<<
" -- No HDF5 dataset paths were specified" 217 " and no default HDF5-derived handlers were found. Don't know what dataset to " 218 "extract. Use \"--image-dataset\" option to specify.";
228 if (!handler->
open())
230 errMsg<<
"ERROR: ossimHdf5Tool:"<<__LINE__<<
" -- Could not open <"<<value<<
"> as an HDF5 file.";
246 chain->
add(remapper.
get());
253 std::vector<ossimGpt> points;
255 if(points.size() >= 3)
297 info.getKeywordlist(kwl);
307 vector<DataSet> datasets;
314 info.print(cout, datasets[i]);
331 geomFile.
string() +=
".geom";
339 cout <<
"Wrote file: " << geomFile << endl;
349 cout <<
"Wrote file: " << geomFile << endl;
std::string getApplicationName() const
return the application name, as specified by argv[0]
void addCommandLineOption(const ossimString &option, const ossimString &explanation)
void addRenderable(const ossimString &datasetName)
Adds the dataset name, either the full HDF5 path or the simple object name, to the list of renderable...
ossimFilename noExtension() const
virtual std::ostream & print(std::ostream &os) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
ossim_uint32 numberOf(const char *str) const
bool addLast(ossimConnectableObject *obj)
Adds it to the end.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
static const char * OUTPUT_FILE_KW
bool getRoot(H5::Group &root) const
Assigns the root group.
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
Represents serializable keyword/value map.
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
const char * find(const char *key) const
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...
virtual bool open()
The derived class needs to initialize the raster dataset names m_renderableNames in their constructor...
This is the base class for all imagery using HDF5 as the file format.
virtual void initialize()
void setNullPixelValue(double null)
Set the null output pixel.
void addList(const ossimKeywordlist &src, bool overwrite=true)
void addPair(const std::string &key, const std::string &value, bool overwrite=true)
void setCommandLineUsage(const ossimString &explanation)
ossimApplicationUsage * getApplicationUsage()
virtual bool write(const char *file, const char *comment=0) const
Methods to dump the ossimKeywordlist to a file on disk.
bool open(const ossimFilename &hdf5File)
Opens specified HDF5 file.
Class to shift/stretch input values to given min/max.
static bool getDatasets(H5::Group group, std::vector< H5::DataSet > &datasetList, bool recursive=false)
Assigns list of datasets under specified group.
Single image chain class.
virtual ossimScalarType getOutputScalarType() const
This call is passed to the head of the list.
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)
virtual void setOutputScalarType(ossimScalarType scalarType)
Sets the output scalar type.
OSSIM_DLL void toVector(std::vector< ossimDpt > &result, const ossimString &stringOfPoints)
Will take a string list separated by spaces and convert to a vector of ossimDpts. ...
virtual void setFilename(const ossimFilename &filename)
Sets the filename.
void setMaxPixelValue(double max)
Set the max output pixel.
unsigned int ossim_uint32
static const char * GEOM_FILE_KW
virtual bool add(ossimConnectableObject *source)
Will return true or false if an image source was added to the chain.
bool getBoolKeywordValue(bool &rtn_val, const char *keyword, const char *prefix=0) const
[OLK, Aug/2008] Sets the boolean <rtn_val> depending on value associated with keyword for values = (y...
void setMinPixelValue(double min)
Set the min output pixel.
Low-level OSSIM interface to HDF5 libraries.
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
void setDescription(const ossimString &desc)
bool saveCoarseGrid(const ossimFilename &cgFileName) const
Saves the coarse grid to the specified file.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the transform (if any) and projection (if any) states to the KWL.
static ossimImageHandlerRegistry * instance()
static bool getNdimDatasets(H5::Group group, std::vector< H5::DataSet > &datasetList, bool recursive=false)
Assigns list of all multi-dimensional datasets under current active group.
static const char * IMAGE_FILE_KW
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
int & argc()
return the argument count.
void addGeoPolyCutterPolygon(const vector< ossimGpt > &polygon)
const std::string & string() const