24 " No reprojection is done. Presently, the subimage geometry is represented by an RPC " 25 "replacement model until generic models can support subimage chipping.";
29 : m_geomFormat (OGEOM)
42 usageString +=
" subimage [options] <input-image> <output-image>";
53 "--bbox <ulx> <uly> <lrx> <lry>",
54 "Specify upper-left and lower-right bounds the image rect (in pixels).");
57 "For multi image entries which entry do you wish to extract. For list " 58 "of entries use: \"ossim-info -i <your_image>\" ");
60 "--geom <format>",
"Specifies format of the subimage RPC geometry file." 61 " Possible values are: \"OGEOM\" (OSSIM geometry, default), \"DG\" (DigitalGlobe WV/QB " 62 ".RPB format), \"JSON\" (MSP-style JSON), or \"XML\". Case insensitive.");
84 vector<ossimString> paramList;
90 if ( ap.
read(
"--bbox", stringParam1, stringParam2, stringParam3, stringParam4))
93 ostr<<tempString1<<
" "<<tempString2<<
" "<<tempString3<<
" "<<tempString4<<ends;
96 if ( ap.
read(
"-e", stringParam1) || ap.
read(
"--entry", stringParam1) )
99 if ( ap.
read(
"--geom", stringParam1))
103 if (formatStr ==
"OGEOM")
105 else if (formatStr ==
"DG")
107 else if (formatStr ==
"JSON")
109 else if (formatStr ==
"XML")
114 errMsg <<
" ERROR: ossimSubImageTool ["<<__LINE__<<
"] Unknown geometry format <" 115 <<formatStr<<
"> specified. Aborting." << endl;
137 errMsg<<
"ERROR: ossimSubImageTool ["<<__LINE__<<
"] Could not open <"<<fname<<
">"<<ends;
149 errMsg <<
" ERROR: ossimSubImageTool ["<<__LINE__<<
"] Entry " << entryIndex <<
" out of range!" << endl;
157 vector<ossimString> substrings = lookup.
split(
", ",
true);
158 if (substrings.size() != 4)
161 errMsg <<
"ossimSubImageTool ["<<__LINE__<<
"] Incorrect number of values specified for bbox!";
165 int ulx = substrings[0].toInt32();
166 int uly = substrings[1].toInt32();
167 int lrx = substrings[2].toInt32();
168 int lry = substrings[3].toInt32();
199 errMsg <<
" ERROR: ossimSubImageTool ["<<__LINE__<<
"] Null projection returned for input " 207 bool converged =
false;
231 bool write_ok =
false;
236 write_ok = kwl.
write(geomFile);
240 #if OSSIM_HAS_JSONCPP 243 if (!jsonStream.fail())
248 write_ok = rpc->
toJSON(jsonStream);
253 errMsg <<
" ERROR: ossimSubImageTool ["<<__LINE__<<
"] JSON geometry output requested but JSON is not " 254 "available in this build! <" << endl;
262 if (!rpbStream.fail())
264 write_ok = rpc->
toRPB(rpbStream);
273 write_ok = xmlDocument.
write(geomFile);
std::string getApplicationName() const
return the application name, as specified by argv[0]
void addCommandLineOption(const ossimString &option, const ossimString &explanation)
static ossimString upcase(const ossimString &aString)
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
static const char * OUTPUT_FILE_KW
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).
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
bool write(const ossimFilename &file)
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...
const ossimIpt & ul() const
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
void addPair(const std::string &key, const std::string &value, bool overwrite=true)
ossim_uint32 toUInt32() const
void setCommandLineUsage(const ossimString &explanation)
ossimApplicationUsage * getApplicationUsage()
void setImageSize(const ossimIpt &size)
virtual bool write(const char *file, const char *comment=0) const
Methods to dump the ossimKeywordlist to a file on disk.
const ossimRefPtr< ossimRpcModel > getRpcModel() const
Fetches the solved-for RPC model.
void set_ul(const ossimIpt &pt)
bool solve(const ossimDrect &aoiBounds, ossimImageGeometry *geom, const double &pixel_tolerance=0.5)
Similar to the other solve methods except that the final grid size is established iteratively so that...
void fromKwl(const ossimKeywordlist &kwl)
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
virtual bool add(ossimConnectableObject *source)
Will return true or false if an image source was added to the chain.
void setImageOffset(const ossimDpt &offset_to_chip_ul)
Allows setting an offset to a subimage while using the coefficients of a full-image model...
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
static const char * ENTRY_KW
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
void set_lr(const ossimIpt &pt)
void setDescription(const ossimString &desc)
bool toJSON(std::ostream &json) const
Serializes RPC to JSON format.
This currently only support Rational poilynomial B format.
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()
std::basic_ofstream< char > ofstream
Class for char output file streams.
static const char * IMAGE_FILE_KW
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
bool toRPB(std::ostream &out) const
Serialize to WorldView-style .RPB file to the stream provided.
const std::string & string() const