Geoscience Reference
In-Depth Information
unsigned short nNoCloud=0;
unsigned short nCloud=1;
unsigned short nCirrus=1;
try {
ostringstream stlosError;
stlosError <<"usage: "<< argv[0] <<" [-nocloud <value>] [-cloud <
value>] [-cirrus <value>] <bqa_input>
<cloud_output>";
for ( int i=1;i<argc;i++){
string stlsOption=argv[i];//convert to std::string
if (stlsOption=="-nocloud"||stlsOption=="--nocloud"){
nNoCloud=atoi(argv[++i]);
}
else if (stlsOption=="-cloud"||stlsOption=="--cloud"){
nCloud=atoi(argv[++i]);
}
else if (stlsOption=="-cirrus"||stlsOption=="--cirrus"){
nCirrus=atoi(argv[++i]);
}
else if (stlsOption=="-h"||stlsOption=="--help")
throw (stlosError.str());
else if (stlsOption.find('-')==0){
cerr <<"Error: unknown option "<< stlsOption << endl;
throw (stlosError.str());
}
else if (stlsBQAimageFilename.empty()){
stlsBQAimageFilename=argv[i];
}
else if (stlsCLDimageFilename.empty()){
stlsCLDimageFilename=argv[i];
}
else
throw (stlosError.str());
}
if (stlsBQAimageFilename.empty()){
cerr <<"Error: no BQA raster file provided"<< endl;
throw (stlosError.str());
}
if (stlsCLDimageFilename.empty()){
cerr <<"Error: no CLD raster file provided"<< endl;
throw (stlosError.str());
}
}
catch (string stlsError){
cerr << stlsError << endl;
exit(1);
}
//create the input and output datasets here...
return 0;
}
The output dataset has the same number of bands, size, data type, projection
and geotransform as the input dataset. It is therefore appropriate to create the output
dataset with the CreateCopy method of the driver. Before using a particular driver,
all drivers must be registered ( GDALAllRegister() ). The input dataset will not
be altered and is opened in read only mode.
 
 
Search WWH ::




Custom Search