68 static ossimTrace traceDebug(
"ossimOrthoIgen:debug");
69 static ossimTrace traceLog(
"ossimOrthoIgen:log");
71 static const char* AUTOGENERATE_HISTOGRAM_KW =
"autogenerate_histogram";
73 using namespace ossim;
79 bool ossimOrthoIgen::parseFilename(
const ossimString& file_spec,
bool decodeEntry)
83 std::vector<ossimString> fileInfos = file_spec.
split(
"|");
84 unsigned int num_fields = (
unsigned int) fileInfos.size();
85 unsigned int field_idx = 0;
95 if ((field_idx < num_fields) && decodeEntry)
97 src_record.
setEntryIndex(fileInfos[field_idx].trim().toInt32());
102 while (field_idx < num_fields)
104 ossimString active_field (fileInfos[field_idx].trim());
106 downcased_field.downcase();
111 if (filename.contains(
".ovr") || filename.isDir())
115 else if (filename.contains(
".mask") || filename.isDir())
121 else if ((downcased_field ==
"auto-minmax") || downcased_field.contains(
"std-stretch"))
130 std::vector<ossimString> bandsStr = active_field.split(
",");
131 std::vector<ossim_uint32> bands;
132 for (
unsigned int i = 0; i < bandsStr.size(); i++)
134 int band = bandsStr[i].toInt32() - 1;
143 theSrcRecords.push_back(src_record);
155 theProjectionType(OSSIM_UNKNOWN_PROJECTION),
156 theProjectionName(
""),
157 theGeoScalingLatitude(
ossim::
nan()),
158 theCombinerType(
"ossimImageMosaic"),
159 theResamplerType(
"nearest neighbor"),
162 theTilingTemplate(
""),
163 theTilingFilename(
""),
164 theChainTemplate(
""),
165 theCombinerTemplate(
""),
166 theAnnotationTemplate(
""),
167 theWriterTemplate(
""),
168 theSupplementaryDirectory(
""),
169 theSlaveBuffers(
"2"),
178 theUseAutoMinMaxFlag(false),
179 theClipToValidRectFlag(false),
180 theReaderProperties(),
181 theWriterProperties(),
182 theTargetHistoFileName(),
183 theProductFilename(),
186 theCacheExcludedFlag(false),
187 theOutputRadiometry(
""),
193 theClipToValidRectFlag = flag.
toBool();
207 "--annotate",
"annotation keyword list");
209 "--chain-template",
"Specify an external file that contains chain information");
211 "--clamp-pixels <min> <max>",
"Specify the min and max allowed pixel values. All values " 212 "outside of this get mapped to their corresponding clamp value.");
214 "--clip-pixels <min> <max>",
"Causes all pixel values between min and max (inclusive)" 215 " to be mapped to the null pixel value. Min and max can be equal for mapping a single value." 216 " See also related option \"--replacement-mode\" for additional explanation.");
218 "--clip-to-valid-rect <true|false>",
"When true, any requested cut rect is clipped by the " 219 "valid image bounding rect to minimize null border pixels. If false, the output will " 220 "correspond to the cut rect as close as possible given the product projection. This option " 221 "overrides the ossim_preferences setting. If no cut options are supplied, this option is " 224 "--combiner-template",
"Specify an external file that contains combiner information");
226 "--combiner-type",
"Specify what mosaic to use, ossimImageMosiac or ossimFeatherMosaic or " 227 "osimBlendMosaic ... etc");
229 "--cut-bbox-en",
"Specify the min easting, min northing, max easting, max northing");
231 "--cut-bbox-ll",
"Specify the min lat and min lon and max lat and maxlon <minLat> <minLon> " 232 "<maxLat> <maxLon>");
234 "--cut-center-ll",
"Specify the center cut in lat lon space. Takes two argument <lat> <lon>");
236 "--cut-pixel-width-height",
"Specify cut box's width and height in pixels");
238 "--cut-radius-meters",
"Specify the cut distance in meters. A bounding box for the cut will " 241 "--degrees",
"Specifies an override for degrees per pixel. Takes either a single value " 242 "applied equally to x and y directions, or two values applied correspondingly to x then y.");
244 "--geo",
"Defaults to a geographic image chain with GSD = to the input. Origin of latitude is" 247 "--geo-auto-scaled",
"Computes the mosaic center latitude for purpose of scaling in the " 248 "longitude direction so that the pixels will appear nearly square in ground space at " 249 "specified latitude. Implies a geographic projection.");
251 "--geo-scaled",
"Takes latitude as an argument for purpose of scaling in the " 252 "longitude direction so that the pixels will appear nearly square in ground space at " 253 "specified latitude. Implies a geographic projection.");
255 "--hist-auto-minmax",
"uses the automatic search for the best min and max clip values." 256 " Incompatible with other histogram options.");
258 "--hist-match",
"Takes one image filename argument for target histogram to match." 259 " Incompatible with other histogram options.");
261 "--hist-std-stretch",
"Specify histogram stretch as a standard deviation from the mean as" 262 " <int>, where <int> is 1, 2, or 3." 263 " Incompatible with other histogram options.");
265 "--hist-stretch",
"Specify in normalized percent the low clip and then the high clip value" 266 " as <low.dd> <hi.dd>." 267 " Incompatible with other histogram options.");
269 "--input-proj",
"Makes the view equal to the input. If more than one file then the first is " 272 "--mask",
"Specify the ESRI shape file with polygons to clip the image");
274 "--meters",
"Specifies an override for the meters per pixel. Takes either a single value " 275 "applied equally to x and y directions, or two values applied correspondingly to x then y.");
277 "--no-cache",
"Excludes the cache from the input image chain(s). Necessary as a workaround " 278 " for inconsistent cache behavior for certain image types.");
280 "--output-radiometry",
"Specifies the desired product's pixel radiometry type. Possible " 281 "values are: U8, U11, U16, S16, F32. Note this overrides the deprecated option \"scale-to" 284 "--reader-prop",
"Passes a name=value pair to the reader(s) for setting it's property. Any " 285 "number of these can appear on the line.");
287 "--replacement-mode <mode>",
"Specify how to treat multi-band imagery when providing " 288 "clip-pixels and/or clamp-pixels settings. Possible values are: REPLACE_BAND_IF_TARGET | " 289 "REPLACE_BAND_IF_PARTIAL_TARGET | REPLACE_ALL_BANDS_IF_ANY_TARGET | " 290 "REPLACE_ONLY_FULL_TARGETS.");
292 "--resample-type",
"Specify what resampler to use, nearest neighbor, bilinear, cubic");
294 "--scale-to-8-bit",
"Scales the output to unsigned eight bits per band. This option has been" 295 " deprecated by the newer \"--output-radiometry\" option.");
297 "--slave-buffers",
"number of slave tile buffers for mpi processing (default = 2)");
299 "--srs",
"specify an output reference frame/projection. Example: --srs EPSG:4326");
301 "--stdout",
"Output the image to standard out. This will return an error if writer does not " 302 "support writing to standard out. Callers should combine this with the --ossim-logfile " 303 "option to ensure output image stream does not get corrupted. You must still pass an output " 304 "file so the writer type can be determined like \"dummy.png\".");
306 "--supplementary-directory or --support",
"Specify the supplementary directory path where " 307 "overviews, histograms and external geometries are located");
309 "-t or --thumbnail",
"thumbnail size");
311 "--tiling-template",
"Specify an external file that contains tiling information");
313 "--threads [n]",
"Indicates multi-threaded process using optionally-specified number of threads");
315 "--utm",
"Defaults to a utm image chain with GSD = to the input");
317 "--view-template",
"Specify an external file that contains view information");
319 "-w or --writer",
"Specifies the output writer. Default uses output file extension to " 320 "determine writer.");
322 "--wkt",
"specify an output reference frame/projection that is in a wkt format. Must have the" 323 " ossimgdal_plugin compiled");
325 "--writer-prop",
"Passes a name=value pair to the writer for setting it's property. Any " 326 "number of these can appear on the line.");
328 "--writer-template",
"Specify an external file that contains tiling information");
339 <<
"ossimOrthoIgen::initialize DEBUG:" 348 unsigned int tempUint;
356 theCutOrigin.makeNan();
357 theCutDxDy.makeNan();
363 theUseAutoMinMaxFlag =
false;
364 theDeltaPerPixelOverride.makeNan();
366 theCacheExcludedFlag =
false;
372 if(argumentParser.
read(
"--annotate", stringParam))
376 if(argumentParser.
read(
"-t", stringParam) ||
377 argumentParser.
read(
"--thumbnail", stringParam))
393 theReaderProperties.clear();
394 while(argumentParser.
read(
"--reader-prop", stringParam))
396 std::vector<ossimString> splitArray;
397 tempString.
split(splitArray,
"=");
398 if(splitArray.size() == 2)
400 theReaderProperties.insert(std::make_pair(splitArray[0], splitArray[1]));
404 if(argumentParser.
read(
"-w", stringParam) ||
405 argumentParser.
read(
"--writer", stringParam))
407 theWriterType = tempString;
410 theWriterProperties.
clear();
412 while(argumentParser.
read(
"--writer-prop", stringParam))
414 std::vector<ossimString> splitArray;
415 tempString.
split(splitArray,
"=");
416 if(splitArray.size() == 2)
418 theWriterProperties.insert(std::make_pair(splitArray[0], splitArray[1]));
422 if(argumentParser.
read(
"--slave-buffers", stringParam))
424 theSlaveBuffers = tempString;
426 if(argumentParser.
read(
"--cut-center-ll", doubleParam, doubleParam2))
428 theCutOrigin.lat = tempDouble;
429 theCutOrigin.lon = tempDouble2;
433 if(argumentParser.
read(
"--cut-radius-meters", doubleParam))
435 theCutDxDy.x = tempDouble;
436 theCutDxDy.y = tempDouble;
439 if(argumentParser.
read(
"--cut-bbox-ll", doubleParam, doubleParam2, doubleParam3, doubleParam4))
447 theCutOrigin.lat = maxY;
448 theCutOrigin.lon = minX;
449 theCutDxDy.lat = (maxY-minY);
450 if ( (maxX < 0.0) && (minX >= 0.0) )
460 theCutDxDy.lon = (maxX-minX);
463 if(argumentParser.
read(
"--cut-bbox-en", doubleParam, doubleParam2, doubleParam3, doubleParam4))
471 theCutOrigin.x = minX;
472 theCutOrigin.y = maxY;
473 theCutDxDy.x = (maxX-minX);
474 theCutDxDy.y = (maxY-minY);
477 if(argumentParser.
read(
"--cut-pixel-width-height", doubleParam, doubleParam2))
484 theDeltaPerPixelOverride =
ossimDpt(theCutDxDy.x/(tempDouble-1),
485 theCutDxDy.y/(tempDouble2-1));
486 theDeltaPerPixelUnit = theCutDxDyUnit;
490 theCutOrigin.makeNan();
495 int num_params = argumentParser.
numberOfParams(
"--degrees", doubleParam);
498 argumentParser.
read(
"--degrees", doubleParam);
500 theDeltaPerPixelOverride.x = tempDouble;
501 theDeltaPerPixelOverride.y = tempDouble;
503 else if (num_params == 2)
505 argumentParser.
read(
"--degrees", doubleParam, doubleParam2);
507 theDeltaPerPixelOverride.x = tempDouble;
508 theDeltaPerPixelOverride.y = tempDouble2;
512 bool histo_op_selected =
false;
513 if(argumentParser.
read(
"--hist-match", stringParam))
516 histo_op_selected =
true;
519 if (target_image.isReadable())
522 theTargetHistoFileName = target_image;
523 theTargetHistoFileName.setExtension(
"his");
524 if (!theTargetHistoFileName.isReadable())
527 <<
"> not found. Cannot perform histogram matching." << std::endl;
528 theTargetHistoFileName.clear();
532 if(argumentParser.
read(
"--hist-stretch", doubleParam, doubleParam2))
534 if (histo_op_selected)
537 " Ignoring --hist-stretch option." << std::endl;
541 theLowPercentClip = tempDouble;
542 theHighPercentClip = tempDouble2;
543 histo_op_selected =
true;
546 if(argumentParser.
read(
"--hist-std-stretch", stringParam))
548 if (histo_op_selected)
551 " Ignoring --hist-stretch option." << std::endl;
555 theStdDevClip = tempString.
toInt32();
556 histo_op_selected =
true;
557 if ((theStdDevClip < 1) || (theStdDevClip > 3))
560 " --hist-std-stretch option. Only 1,2, or 3 allowed. Ignoring option."<< std::endl;
564 if(argumentParser.
read(
"--hist-auto-minmax"))
566 if (histo_op_selected)
569 " Ignoring --hist-auto-minmax option." << std::endl;
572 theUseAutoMinMaxFlag =
true;
575 num_params = argumentParser.
numberOfParams(
"--meters", doubleParam);
578 argumentParser.
read(
"--meters", doubleParam);
580 theDeltaPerPixelOverride.x = tempDouble;
581 theDeltaPerPixelOverride.y = tempDouble;
583 else if (num_params == 2)
585 argumentParser.
read(
"--meters", doubleParam, doubleParam2);
587 theDeltaPerPixelOverride.x = tempDouble;
588 theDeltaPerPixelOverride.y = tempDouble2;
591 if(argumentParser.
read(
"--no-cache"))
593 theCacheExcludedFlag =
true;
596 if(argumentParser.
read(
"--output-radiometry", stringParam))
598 theOutputRadiometry = tempString;
601 if(argumentParser.
read(
"--scale-to-8-bit"))
603 if (theOutputRadiometry.empty())
604 theOutputRadiometry =
"U8";
607 if (argumentParser.
read(
"--stdout"))
612 int result = _setmode( _fileno(stdout), _O_BINARY );
616 <<
"ossimOrthoIgen::initialize WARNING:" 617 <<
"\nCannot set standard output mode to binary." 626 if(argumentParser.
read(
"--writer-template", stringParam))
628 theWriterTemplate = tempString;
630 if(argumentParser.
read(
"--tiling-template", stringParam))
634 if(argumentParser.
read(
"--chain-template", stringParam))
638 if(argumentParser.
read(
"--combiner-template", stringParam))
645 if (argumentParser.
read(
"--utm"))
648 theProjectionName =
"ossimUtmProjection";
650 else if(argumentParser.
read(
"--geo"))
653 theProjectionName =
"ossimEquDistCylProjection";
654 theGeoScalingLatitude = 0.0;
656 else if(argumentParser.
read(
"--input-proj"))
660 else if (argumentParser.
read(
"--srs", stringParam))
662 theCrsString=tempString;
666 if(argumentParser.
read(
"--view-template", stringParam))
672 if(argumentParser.
read(
"--geo-scaled", doubleParam))
675 theProjectionName =
"ossimEquDistCylProjection";
676 if ( (tempDouble < 90.0) && (tempDouble > -90.0) )
678 theGeoScalingLatitude = tempDouble;
683 <<
"ossimOrthoIgen::initialize WARNING:" 684 <<
"\nLatitude out of range! Must be between -90 and 90." 690 <<
"ossimOrthoIgen::initialize DEBUG:" 691 <<
"\ngeographicOriginOfLatitude: " << theGeoScalingLatitude
696 if(argumentParser.
read(
"--geo-auto-scaled"))
699 theProjectionName =
"ossimEquDistCylProjection";
700 theGeoScalingLatitude = 999.0;
703 if(argumentParser.
read(
"--combiner-type", stringParam))
704 theCombinerType = tempString;
706 if(argumentParser.
read(
"--resample-type", stringParam))
708 theResamplerType = tempString;
710 if(argumentParser.
read(
"--supplementary-directory", stringParam) ||
711 argumentParser.
read(
"--support", stringParam))
716 if (argumentParser.
read(
"--clip-to-valid-rect", stringParam))
718 theClipToValidRectFlag = tempString.
toBool();
721 if(argumentParser.
read(
"--mask", stringParam))
723 theMaskShpFile = tempString;
727 if (argumentParser.
read(
"--clip-pixels", doubleParam, doubleParam2))
729 theClipPixelMin = tempDouble;
730 theClipPixelMax = tempDouble2;
732 if (argumentParser.
read(
"--clamp-pixels", doubleParam, doubleParam2))
734 theClampPixelMin = tempDouble;
735 theClampPixelMax = tempDouble2;
737 if (argumentParser.
read(
"--replacement-mode", stringParam))
739 thePixelReplacementMode = tempString;
743 num_params = argumentParser.
numberOfParams(
"--threads", uintParam);
746 argumentParser.
read(
"--threads");
749 else if (num_params == 1)
751 argumentParser.
read(
"--threads", uintParam);
758 <<
"ossimOrthoIgen::initialize DEBUG:" 773 while(argumentParser.
argv()[idx] && (idx < last_idx))
784 parseFilename(file_spec, withDecoding);
790 theProductFilename = argumentParser.
argv()[last_idx];
796 bool ossimOrthoIgen::execute()
801 <<
"ossimOrthoIgen::execute DEBUG: Entered ..." 806 if(theSrcRecords.size() < 1)
809 <<
"ossimOrthoIgen::execute WARNING: No filenames to process" 814 if (!theCrsString.empty() && !theProductFilename.empty())
816 if ((theProductFilename.ext().upcase() ==
"KMZ" || theProductFilename.ext().upcase() ==
"KML")
817 && theCrsString.upcase() !=
"EPSG:4326")
820 <<
"ossimOrthoIgen::execute ERROR: Unsupported projection for kmz or kml" 867 void ossimOrthoIgen::clearFilenameList()
869 theSrcRecords.clear();
876 void ossimOrthoIgen::addSrcFile(
const ossimFilename& src_file)
883 if ( src_kwl.
addFile(src_file) == false )
return;
885 unsigned int image_idx = 0;
889 double sum_weights = 0;
893 if (!src_record.
valid())
900 for (
ossim_uint32 rgb_index = 0; rgb_index < 3; rgb_index++)
908 theSrcRecords.back().setRgbDataBool(
true);
918 theSrcRecords.push_back(src_record);
923 theCombinerType =
"ossimBlendMosaic";
927 double max_weight = (sum_weights > 100.0 ? sum_weights : 100.0);
928 double num_entries = (double)theSrcRecords.size();
930 vector<ossimSrcRecord>::iterator iter = theSrcRecords.begin();
931 while (iter != theSrcRecords.end())
933 if (sum_weights > 0.0)
937 theCombinerType =
"ossimBlendMosaic";
938 if (iter->getWeight() == 0.0)
941 if (num_entries == 1.0)
946 weight = (1.0 - sum_weights/max_weight)/(num_entries - 1);
954 weight = iter->getWeight()/max_weight;
961 weight = 100.0/num_entries;
964 iter->setWeight(weight);
972 void ossimOrthoIgen::setDefaultValues()
976 theDeltaPerPixelOverride.makeNan();
977 theTemplateView =
"";
980 theCombinerType =
"ossimImageMosaic";
981 theResamplerType =
"nearest neighbor";
982 theTilingTemplate =
"";
983 theTilingFilename =
"";
984 theSupplementaryDirectory =
"";
985 theSlaveBuffers =
"2";
989 theCutOrigin.makeNan();
990 theCutDxDy.makeNan();
1003 void ossimOrthoIgen::setupIgenChain()
1010 if (theSlaveBuffers ==
"")
1015 if(theProductFilename.empty())
1016 throw(
ossimException(std::string(
"Must supply an output file.")));
1020 templateKwl.
clear();
1023 if(theCombinerTemplate.exists())
1025 templateKwl.
addFile(theCombinerTemplate);
1029 if (!mosaicObject.
valid())
1033 if(!mosaicObject.
valid())
1048 templateKwl.
clear();
1050 if(theChainTemplate.exists())
1052 templateKwl.
addFile(theChainTemplate);
1054 if(templateKwl.
find(
"type"))
1056 else if(templateKwl.
find(
"object1.type"))
1060 if(!default_single_image_chain.
valid())
1070 default_single_image_chain->
addChild(renderer);
1078 theReferenceProj = 0;
1083 for(idx = 0; idx < num_inputs; ++idx)
1088 if(!handler.
valid())
1091 <<
"Skipping this entry." << std::endl;
1097 PropertyMap::iterator iter = theReaderProperties.begin();
1098 while(iter != theReaderProperties.end())
1100 propInterface->
setProperty(iter->first, iter->second);
1108 if (theSrcRecords[idx].isVectorData())
1109 handler->
loadState(theSrcRecords[idx].getAttributesKwl());
1111 std::vector<ossim_uint32> entryList;
1112 if(theSrcRecords[idx].getEntryIndex() > -1 )
1113 entryList.push_back(theSrcRecords[idx].getEntryIndex());
1120 for(entryIdx = 0; entryIdx < entryList.size(); ++entryIdx)
1129 if (entryList.size() == 1)
1130 img_handler = handler.
get();
1135 if ( theSupplementaryDirectory.empty() == false )
1139 else if (theSrcRecords[idx].getSupportDir().empty() ==
false)
1143 else if (theSrcRecords[idx].getOverviewPath().empty() ==
false)
1145 if (theSrcRecords[idx].getOverviewPath().isDir())
1155 if (theSrcRecords[idx].isRgbData() && theSrcRecords[idx].getBands().
size() > 0 &&
1156 theSrcRecords[idx].getOverviewPath().empty())
1162 singleImageChain->
addLast(img_handler);
1163 current_source = img_handler;
1173 current_source = setupRasterMask(singleImageChain, theSrcRecords[idx]);
1177 if (!theReferenceProj.valid())
1186 current_source = setupPixelFlipper(singleImageChain, theSrcRecords[idx]);
1192 bool validBand =
true;
1193 for (
ossim_uint32 i = 0; i < theSrcRecords[idx].getBands().size(); ++i)
1195 if (theSrcRecords[idx].getBands()[i] >= bands)
1199 <<
"\nHighest available band: " << bands << std::endl;
1207 current_source = bs.
get();
1212 setupHistogram(singleImageChain, theSrcRecords[idx]);
1215 if (!theCacheExcludedFlag)
1216 addChainCache(singleImageChain);
1221 if (theSrcRecords[idx].isRgbData())
1223 if (!bandMergeObject)
1239 obm->
setWeight(idx, theSrcRecords[idx].getWeight());
1245 if (bandMergeObject)
1268 if ( isAffectedByElevation() )
1273 reComputeChainGsds();
1286 setupOutputRadiometry();
1302 void ossimOrthoIgen::setupCutter()
1307 consolidateCutRectSpec();
1316 if (!theMaskShpFile.empty())
1318 if (theMaskShpFile.contains(
"|"))
1321 std::vector<ossimString> fileList = fileName.
split(
"|");
1322 if (fileList.size() > 1)
1324 theMaskShpFile = fileList[0];
1325 query = fileList[1];
1330 if (!theMaskShpFile.exists())
1336 ossimDpt lr (theCutOrigin.x + theCutDxDy.x - mpp.x, theCutOrigin.y - theCutDxDy.y + mpp.y);
1344 std::vector<ossimGpt> polygon;
1347 ossimGpt ul(theCutOrigin.lat, theCutOrigin.lon );
1348 ossimGpt ur(theCutOrigin.lat, theCutOrigin.lon + theCutDxDy.x - dpp.x);
1349 ossimGpt lr(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon + theCutDxDy.x - dpp.x);
1350 ossimGpt ll(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon );
1352 polygon.push_back(ul);
1353 polygon.push_back(ur);
1354 polygon.push_back(lr);
1355 polygon.push_back(ll);
1374 if (shpInterface != NULL)
1380 std::multimap<long, ossimAnnotationObject*> features = shpInterface->
getFeatureTable();
1381 if (features.size() > 0)
1383 std::multimap<long, ossimAnnotationObject*>::iterator it = features.begin();
1384 while (it != features.end())
1391 if (annoPoly == NULL)
1395 if (annoPoly != NULL)
1397 std::vector<ossimGpt> polygon;
1400 std::vector<ossimGpt> points = annoPoly->
getPoints();
1403 polygon.push_back(points[i]);
1410 if (interiorCutter == NULL)
1423 else if (annoMultiPoly != NULL)
1425 std::vector<ossimGeoPolygon> multiPolys = annoMultiPoly->
getMultiPolygon();
1429 std::vector<ossimGeoPolygon> holePolys = geoPoly.
getHoleList();
1430 if (holePolys.size() > 0)
1432 if (interiorCutter == NULL)
1448 throw(
ossimException(std::string(
"The geometry type of the mask shape file is not polygon.")));
1458 if (!theCutDxDy.hasNans() && !theCutOrigin.hasNans())
1460 std::vector<ossimGpt> bound;
1469 bound.push_back(ul);
1470 bound.push_back(ur);
1471 bound.push_back(lr);
1472 bound.push_back(ll);
1477 ossimGpt ul(theCutOrigin.lat, theCutOrigin.lon );
1478 ossimGpt ur(theCutOrigin.lat, theCutOrigin.lon + theCutDxDy.x - dpp.x);
1479 ossimGpt lr(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon + theCutDxDy.x - dpp.x);
1480 ossimGpt ll(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon );
1482 bound.push_back(ul);
1483 bound.push_back(ur);
1484 bound.push_back(lr);
1485 bound.push_back(ll);
1494 if (boundCutter == NULL)
1505 if (interiorCutter != NULL)
1510 if (boundCutter != NULL)
1520 void ossimOrthoIgen::setupWriter()
1527 if (theWriterType.size())
1532 else if ( theWriterTemplate.size() && theWriterTemplate.exists() )
1536 kwlTemplate.
addFile(theWriterTemplate);
1540 if ( !writer.
valid() )
1543 else if ( theTilingFilename ==
"%SRTM%")
1546 kwlWriter.
add(
"type",
"ossimGeneralRasterWriter",
true);
1547 kwlWriter.
add(
"byte_order",
"big_endian");
1549 theProductFilename = theProductFilename.path();
1551 else if (!theTilingFilename.empty())
1553 if (theProductFilename.isDir())
1555 theProductFilename = theProductFilename +
"/" + theTilingFilename;
1568 throw(
ossimException(std::string(
"Writer output filename not set.")));
1574 if ( !writer.
valid() )
1584 if( !writer.
valid() )
1587 theProductFilename.setExtension(
"tif");
1597 theWriterProperties.erase(pixelType);
1598 theWriterProperties.insert(std::make_pair(pixelType,
ossimString(
"area")));
1604 if ( writer.
valid() )
1610 PropertyMap::iterator iter = theWriterProperties.begin();
1611 while(iter != theWriterProperties.end())
1613 propInterface->
setProperty(iter->first, iter->second);
1636 void ossimOrthoIgen::setupProjection()
1646 if(!theReferenceProj.valid())
1648 std::string errMsg =
"ossimOrthoIgen::setupProjection() -- Could not establish input image's " 1649 "projection. Cannot setup output view.";
1660 if (!theTemplateView.isReadable())
1662 ossimString errMsg =
"ossimOrthoIgen::setupProjection() -- Could not read the product " 1663 "projection template file at <";
1664 errMsg += theTemplateView;
1665 errMsg +=
">. Cannot establish output projection.";
1674 if(!productObj.
valid())
1684 if (theGeoScalingLatitude == 999.0)
1686 computeGeoScalingLatitude();
1687 gpt =
ossimGpt(theGeoScalingLatitude, 0.0);
1690 gpt =
ossimGpt(theGeoScalingLatitude, 0.0);
1709 gpt =
ossimGpt(theGeoScalingLatitude, 0.0);
1717 <<
"ossimOrthoIgen::setupProjection() WARNING:" <<
" Unsupported spatial reference system." 1718 <<
" Will default to the projection from the input image." 1728 theReferenceProj->lineSampleToWorld(
ossimDpt(0,0), refGpt);
1753 gpt =
ossimGpt(theGeoScalingLatitude, 0.0);
1761 std::string errMsg =
"ossimOrthoIgen::setupProjection() -- Could not establish valid output " 1794 establishMosaicTiePoint();
1799 <<
"ossimOrthoIgen::setupProjection DEBUG:" 1800 <<
"Leaving...." << __LINE__
1808 void ossimOrthoIgen::setupAnnotation()
1814 if(theAnnotationTemplate.exists() ==
false)
1818 if (templateKwl.
addFile(theAnnotationTemplate) ==
false)
1839 bool ossimOrthoIgen::setupTiling()
1849 if ((theTilingTemplate ==
"")||(!templateKwl.
addFile(theTilingTemplate)))
1861 if(outputFilename.
isDir())
1863 if(templateKwl.
find(prefix.chars(),
"type"))
1865 theTilingFilename = templateKwl.
find(prefix.chars(),
"tile_name_mask");
1869 else if (templateKwl.
find(prefix.chars(),
"tile_size") || templateKwl.
find(prefix.chars(),
"tile_source"))
1871 theTilingFilename = templateKwl.
find(prefix.chars(),
"output_file_name");
1878 theTilingFilename = outputFilename.
file();
1879 if (!theTilingFilename.contains(
"%"))
1881 ossimString fileNoExt = theTilingFilename.fileNoExtension();
1883 theTilingFilename = fileNoExt +
"_%r%_%c%." + ext;
1885 if(templateKwl.
find(prefix.chars(),
"type"))
1887 templateKwl.
add(prefix.chars(),
"tile_name_mask", theTilingFilename.c_str(),
true);
1889 theProductFilename = path;
1893 else if (templateKwl.
find(prefix.chars(),
"tile_size") || templateKwl.
find(prefix.chars(),
"tile_source"))
1895 templateKwl.
add(prefix.chars(),
"output_file_name", theTilingFilename.c_str(),
true);
1897 theProductFilename = path;
1910 if (templateKwl.
find(prefix.chars(),
"tile_size"))
1916 if (templateKwl.
find(prefix.chars(),
"tile_source"))
1947 void ossimOrthoIgen::consolidateCutRectSpec()
1957 " type of units was encountered. The cut rect needs to be specified in either meters or" 1958 " degrees. The resulting cut rect and origin may be incorrect." << std::endl;
1972 theCutOrigin.x = originPLH.
lon;
1973 theCutOrigin.y = originPLH.
lat;
1977 originPLH.
lat = theCutOrigin.y;
1978 originPLH.
lon = theCutOrigin.x;
1985 theCutDxDy.
x = theCutDxDy.x/mtrs_per_deg.x;
1986 theCutDxDy.y = theCutDxDy.y/mtrs_per_deg.y;
1993 if (theClipToValidRectFlag)
2006 ossimGpt cutrect_lr (theCutOrigin.lat - theCutDxDy.lat, theCutOrigin.lon + theCutDxDy.lon);
2007 if (mosaic_ul.
lat < theCutOrigin.lat)
2008 theCutOrigin.lat = mosaic_ul.
lat;
2009 if (mosaic_lr.
lat > cutrect_lr.lat)
2010 theCutDxDy.lat = theCutOrigin.lat - mosaic_lr.
lat;
2011 if (mosaic_ul.
lon > theCutOrigin.lon)
2012 theCutOrigin.lon = mosaic_ul.
lon;
2013 if (mosaic_lr.
lon < cutrect_lr.lon)
2014 theCutDxDy.lon = mosaic_lr.
lon - theCutOrigin.lon;
2028 ossimGpt ulgp (theCutOrigin.lat , theCutOrigin.lon , 0);
2029 ossimGpt urgp (theCutOrigin.lat , theCutOrigin.lon + theCutDxDy.lon, 0);
2030 ossimGpt llgp (theCutOrigin.lat - theCutDxDy.lat, theCutOrigin.lon , 0);
2031 ossimGpt lrgp (theCutOrigin.lat - theCutDxDy.lat, theCutOrigin.lon + theCutDxDy.lon, 0);
2038 double n_top = (ulen.y > uren.y ? ulen.y : uren.y);
2039 double n_bottom = (llen.y < lren.y ? llen.y : lren.y);
2040 double e_left = (ulen.x < llen.x ? ulen.x : llen.x);
2041 double e_right = (uren.x > lren.x ? uren.x : lren.x);
2043 theCutOrigin.
x = e_left;
2044 theCutOrigin.y = n_top;
2046 theCutDxDy.x = e_right - e_left;
2047 theCutDxDy.y = n_top - n_bottom;
2049 if (theClipToValidRectFlag)
2059 ossimDpt cutrect_lr (theCutOrigin.x + theCutDxDy.x, theCutOrigin.y - theCutDxDy.y);
2060 if (mosaic_ul.
y < theCutOrigin.y)
2061 theCutOrigin.y = mosaic_ul.
y;
2062 if (mosaic_lr.
y > cutrect_lr.y)
2063 theCutDxDy.y = theCutOrigin.y - mosaic_lr.
y;
2064 if (mosaic_ul.
x > theCutOrigin.x)
2065 theCutOrigin.x = mosaic_ul.
x;
2066 if (mosaic_lr.
x < cutrect_lr.x)
2067 theCutDxDy.x = mosaic_lr.
x - theCutOrigin.x;
2076 originPLH.
lat = theCutOrigin.y;
2077 originPLH.
lon = theCutOrigin.x;
2092 theCutDxDy.
x = theCutDxDy.x * mtrs_per_deg.x;
2093 theCutDxDy.y = theCutDxDy.y * mtrs_per_deg.y;
2106 ossimDpt half_pixel = resolution * 0.5;
2107 theCutOrigin.
y -= half_pixel.
y;
2108 theCutOrigin.x += half_pixel.
x;
2111 theCutDxDy.x = (floor(theCutDxDy.x/resolution.
x + 0.5))* resolution.
x;
2112 theCutDxDy.y = (floor(theCutDxDy.y/resolution.
y + 0.5))* resolution.
y;
2117 theCutOrigin.y += theCutDxDy.y;
2118 theCutOrigin.x -= theCutDxDy.x;
2122 theCutDxDy.x *= 2.0;
2123 theCutDxDy.y *= 2.0;
2128 ossimDpt cutCenter (theCutOrigin.x + theCutDxDy.x/2.0, theCutOrigin.y - theCutDxDy.y/2.0);
2138 gpt.
lat = cutCenter.y;
2143 gpt.
lat = theCutOrigin.y;
2144 gpt.
lon = theCutOrigin.x;
2162 if (input_chain == NULL)
2164 if (!theTargetHistoFileName.isReadable())
2176 theTargetHistoFileName.empty())
2183 if (handler == NULL)
2186 <<
"chain provided. This should not happen. Ignoring histogram request." << std::endl;
2200 if (!histoFilename.empty())
2203 if (histoFilename.isDir())
2204 histoFilename = histoFilename.
dirCat(defaultHistoFilename.file());
2205 if (histoFilename.exists())
break;
2210 histoFilename = histoFilename.
path().
dirCat(entryName.file());
2211 if (histoFilename.exists())
break;
2215 candidateHistoFilename = histoFilename;
2219 histoFilename = defaultHistoFilename;
2220 if (histoFilename.exists())
break;
2226 histoFilename = entryName;
2227 if (histoFilename.exists())
break;
2230 if (candidateHistoFilename.empty())
2231 candidateHistoFilename = histoFilename;
2237 if (!histoFilename.exists())
2244 histoFilename = candidateHistoFilename;
2246 <<
"> not found. Creating one now..." << std::endl;
2247 bool success = createHistogram(input_chain, histoFilename);
2251 << histoFilename <<
">. Ignoring histogram request." << std::endl;
2266 input_chain->
accept( visitor );
2270 if (theTargetHistoFileName.isReadable())
2286 bool are_incompatible =
false;
2287 if (!sourceHisto.
valid() || !targetHisto.
valid())
2289 are_incompatible =
true;
2296 are_incompatible =
true;
2300 for (
ossim_uint32 band=0; band<num_source_bands; band++)
2304 if (!sourceBandHisto.
valid() || !targetBandHisto.
valid() ||
2305 (sourceBandHisto->
GetRes() != targetBandHisto->
GetRes()))
2307 are_incompatible =
true;
2313 if (are_incompatible)
2317 "operation. Check that source and target histograms are compatible. No histogram " 2318 "operations will be performed on this image." << std::endl;
2323 if ( renderer.
valid() )
2335 if ( renderer.
valid() )
2341 bool histo_read_ok = remapper->
openHistogram(histoFilename);
2346 << histoFilename <<
">. No histogram operations will be performed on this image." 2365 if (img_histo_op==
"auto-minmax")
2367 else if (img_histo_op.contains(
"std-stretch"))
2369 if (img_histo_op.contains(
"1"))
2371 else if (img_histo_op.contains(
"2"))
2373 else if (img_histo_op.contains(
"3"))
2376 else if (theUseAutoMinMaxFlag)
2378 else if (theStdDevClip > 0)
2405 bool success = writer->
execute();
2417 << histo_filename <<
">. No histogram operations will be performed on this image." 2439 chain->
accept( visitor );
2441 if ( renderer.
valid() )
2452 void ossimOrthoIgen::generateLog()
2475 void ossimOrthoIgen::establishMosaicTiePoint()
2485 if (clientList.size() == 0)
2488 "Expected to find image handler in the chain but none was identified."<<std::endl;
2499 if ( visitor.getObjects().empty() )
2502 "Expected to find image handler in the chain but none was identified."<<std::endl;
2515 for(
ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
2521 if (!handler)
break;
2530 if ( tie_gpt_i.
hasNans() == false )
2533 tie_gpt = tie_gpt_i;
2536 if (tie_gpt_i.
lat > tie_gpt.
lat)
2537 tie_gpt.
lat = tie_gpt_i.
lat;
2538 if (tie_gpt_i.
lon < tie_gpt.
lon)
2539 tie_gpt.
lon = tie_gpt_i.
lon;
2546 if ( tie_dpt_i.
hasNans() == false )
2549 tie_dpt = tie_dpt_i;
2552 if (tie_dpt_i.
y > tie_dpt.
y)
2553 tie_dpt.
y = tie_dpt_i.
y;
2554 if (tie_dpt_i.
x < tie_dpt.
x)
2555 tie_dpt.
x = tie_dpt_i.
x;
2567 vector<ossimDpt> img_vertices;
2568 img_vertices.push_back(boundingRect.
ul() +
ossimDpt(-0.5, -0.5));
2569 img_vertices.push_back(boundingRect.
ur() +
ossimDpt( 0.5, -0.5));
2570 img_vertices.push_back(boundingRect.
lr() +
ossimDpt( 0.5, 0.5));
2571 img_vertices.push_back(boundingRect.
ll() +
ossimDpt(-0.5, 0.5));
2577 for (
int j=0; j<4; j++)
2584 tie_gpt = tie_gpt_i;
2587 if (tie_gpt_i.
lat > tie_gpt.
lat)
2588 tie_gpt.
lat = tie_gpt_i.
lat;
2589 if (tie_gpt_i.
lon < tie_gpt.
lon)
2590 tie_gpt.
lon = tie_gpt_i.
lon;
2597 tie_dpt = tie_dpt_i;
2600 if (tie_dpt_i.
y > tie_dpt.
y)
2601 tie_dpt.
y = tie_dpt_i.
y;
2602 if (tie_dpt_i.
x < tie_dpt.
x)
2603 tie_dpt.
x = tie_dpt_i.
x;
2614 if (theProductProjection->isGeographic())
2616 half_pixel_shift = theProductProjection->getDecimalDegreesPerPixel() * 0.5;
2619 tie_gpt.
lat -= half_pixel_shift.lat;
2620 tie_gpt.
lon += half_pixel_shift.lon;
2621 theProductProjection->setUlTiePoints(tie_gpt);
2626 half_pixel_shift = theProductProjection->getMetersPerPixel() * 0.5;
2627 tie_dpt.
y -= half_pixel_shift.y;
2628 tie_dpt.
x += half_pixel_shift.x;
2629 theProductProjection->setUlTiePoints(tie_dpt);
2639 void ossimOrthoIgen::computeGeoScalingLatitude()
2650 if ( visitor.getObjects().empty() )
2653 "Expected to find image handler in the chain but none was identified."<<std::endl;
2662 for (
ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i)
2679 if (!midPoint.isLatNan())
2680 theGeoScalingLatitude = midPoint.
lat;
2682 theGeoScalingLatitude = 0.0;
2691 if (singleImageChain == NULL)
2696 if (current_source == NULL)
2706 if (replaceModeStr.
empty())
2707 replaceModeStr = thePixelReplacementMode;
2712 clip_min = theClipPixelMin;
2715 clip_max = theClipPixelMax;
2726 singleImageChain->
insertRight(flipper, current_source);
2727 current_source = flipper;
2734 clamp_min = theClampPixelMin;
2737 clamp_max = theClampPixelMax;
2758 singleImageChain->
insertRight(flipper, current_source);
2759 current_source = flipper;
2762 return current_source;
2773 if (singleImageChain == NULL)
2779 if (img_handler == NULL)
2789 if (mask_handler == NULL)
2792 "raster mask file <"<<mask_file<<
">. Maske request will be ignored."<<endl;
2812 return mask_filter.
get();
2819 void ossimOrthoIgen::setupOutputRadiometry()
2821 if (theOutputRadiometry.empty())
2842 bool ossimOrthoIgen::isAffectedByElevation()
2844 bool result =
false;
2860 for(
ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
2864 if ( handler.
valid() )
2889 void ossimOrthoIgen::reComputeChainGsds()
2906 for(
ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
2911 if ( handler.
valid() )
2932 void ossimOrthoIgen::setProductGsd()
2966 int num_contributors = 0;
2969 for(
ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
2973 if ( handler.
valid() )
2983 if (num_contributors == 0)
2984 origin.lat = geocenter.
lat;
2986 origin.lat += geocenter.
lat;
2996 if (num_contributors)
2997 origin.lat /= (double)num_contributors;
3002 origin.lat = theGeoScalingLatitude;
3012 ossimDpt resolution (theDeltaPerPixelOverride);
3024 resolution = theReferenceProj->getMetersPerPixel();
Class used for parsing the command line *.src files.
void clear()
Erases the entire container.
virtual const ossimDpt & getDecimalDegreesPerPixel() const
Returns decimal degrees per pixel as an ossimDpt with "x" representing longitude and "y" representing...
virtual bool addListener(ossimListener *listener)
ossimImageFileWriter * createWriterFromExtension(const ossimString &fileExtension) const
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
ossim_int32 getEntryIndex() const
void addCommandLineOption(const ossimString &option, const ossimString &explanation)
virtual ossimObject * dup() const =0
virtual std::vector< ossimGpt > getPoints()
ossimString before(const ossimString &str, std::string::size_type pos=0) const
METHOD: before(str, pos) Returns string beginning at pos and ending one before the token str If strin...
virtual void makeUniqueIds()
Will cycle through all sources setting their ids.
ossimRefPtr< ossimHistogram > getHistogram(ossim_uint32 band, ossim_uint32 resLevel=0)
virtual void setQuery(const ossimString &query)=0
Pure virtual setQuery method.
bool addLast(ossimConnectableObject *obj)
Adds it to the end.
void setComputationMode(ossimHistogramMode mode)
ossimScalarType getScalarTypeFromString(const ossimString &s) const
ossimString getRgbHistogramOp(int band) const
virtual void setPolygon(const vector< ossimDpt > &polygon, ossim_uint32 i=0)
static const ossimFilename NIL
This was taken from Wx widgets for performing touch and access date stamps.
virtual ossimImageSource * getFirstSource()
Return the first source which is the one that first receives the getTile request. ...
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
This will be a base for all combiners.
Represents serializable keyword/value map.
bool addFile(const char *file)
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
const ossimFilename & getMaskPath() const
const char * find(const char *key) const
ossimFilename getRgbOverviewPath(int band) const
virtual ossim_uint32 getPcsCode() const
Returns the EPSG PCS code or 32767 if the projection is a custom (non-EPSG) projection.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
void setHighNormalizedClipPoint(const ossim_float64 &clip)
Sets the high clip point.
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...
double nan()
Method to return ieee floating point double precision NAN.
This code was derived from https://gist.github.com/mshockwave.
virtual void setHistogram(ossimRefPtr< ossimMultiResLevelHistogram > histogram)
const ossimDpt & ul() const
virtual void setOrigin(const ossimGpt &origin)
Sets theOrigin to origin.
ossim_uint32 height() const
bool contains(char aChar) const
static ossimImageWriterFactoryRegistry * instance()
virtual bool isGeographic() 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 setEastingNorthingRectangle(const ossimDpt &ul, const ossimDpt &lr)
static ossimObjectFactoryRegistry * instance()
bool insertRight(ossimConnectableObject *newObj, ossimConnectableObject *rightOfThisObj)
virtual void setDecimalDegreesPerPixel(const ossimDpt &gsd)
bool getCornerGpts(ossimGpt &ul, ossimGpt &ur, ossimGpt &lr, ossimGpt &ll) const
Assigns the ossimGpts with the ground coordinates of the four corresponding image corner points...
OSSIM_DLL ossimStdOutProgress theStdOutProgress
ossimRefPtr< ossimConnectableContainer > theContainer
ossimApplicationUsage * getApplicationUsage()
virtual ossimRefPtr< ossimMultiResLevelHistogram > getHistogram()
virtual void setGeometry(ossimImageGeometry *projection)
virtual ossimImageSource * getLastSource()
Return the last source which is the one that last receives the getTile request.
An image mosaic is a simple combiner that will just do a simple mosaic.
ossimFilename getRgbFilename(int band) const
void setClampValue(ossim_float64 clamp_value, bool is_high_clamp_value=true)
virtual bool write(const char *file, const char *comment=0) const
Methods to dump the ossimKeywordlist to a file on disk.
std::vector< ossimGeoPolygon > & getHoleList()
const ossimDrect & expand(const ossimDpt &padding)
virtual ossimGpt inverse(const ossimDpt &projectedPoint) const =0
Will take a point in meters and convert it to ground.
bool theBuildThumbnailFlag
virtual bool openOverview()
Searches for an overview.
const PixelFlipParams & getPixelFlipParams() const
ossimRefPtr< ossimMapProjection > theProductProjection
int numberOfParams(const std::string &str, const ossimParameter value) const
void setReplacementMode(ossimPixelFlipper::ReplacementMode mode)
void setFilterType(ossimFilterResamplerType filterType)
virtual void setUlGpt(const ossimGpt &ulGpt)
virtual void setMetersPerPixel(const ossimDpt &gsd)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
void initializeElevation()
ossimString replacementMode
ossimRefPtr< ossimImageChain > theProductChain
virtual ossimScalarType getOutputScalarType() const
This call is passed to the head of the list.
ossim_int32 toInt32() const
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
void setStretchMode(StretchMode mode, bool rebuildTableFlag=false)
Sets remap mode to mode.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual void setNumberOfPolygons(ossim_uint32 count)
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
virtual void changeOwner(ossimObject *owner)
Permits changing the object's owner.
void setEntryIndex(ossim_int32 i)
virtual bool setView(ossimObject *baseObject)
virtual void setOutputScalarType(ossimScalarType scalarType)
Sets the output scalar type.
const char * findPreference(const char *key) const
void setFilename(const ossimFilename &f)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
ossim_uint32 theThreadCount
virtual const char * what() const
Returns the error message.
virtual void setPcsCode(ossim_uint32 pcsCode)
virtual void lineSampleToEastingNorthing(const ossimDpt &liineSample, ossimDpt &eastingNorthing) const
std::string::size_type size() const
static ossimEpsgProjectionDatabase * instance()
Instantiates singleton instance of this class:
bool toBool() const
String to numeric methods.
virtual void initialize(const ossimKeywordlist &kwl)
virtual ossimDpt getMetersPerPixel() const =0
virtual ossimString getProjectionName() const
Returns the projection name.
ossimRefPtr< ossimTiling > theTiling
unsigned int ossim_uint32
const char * chars() const
For backward compatibility.
#define STATIC_TYPE_INFO(T)
const std::vector< ossimGeoPolygon > & getMultiPolygon() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossimPixelType getPixelType() const
Returns the raster pixel alignment type.
ossimObject * createObject(const ossimString &objectType)
virtual void enableSource()
virtual ossim_int32 connectMyInputTo(ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
Will try to connect this objects input to the passed in object.
virtual void addPolygon(const vector< ossimIpt > &polygon)
ossim_uint32 width() const
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
ossimFilename getRgbHistogramPath(int band) const
virtual const ossimGpt & getUlGpt() const
static ossimPreferences * instance()
ossimIpt theThumbnailSize
ossimFilterResampler * getResampler()
long theNumberOfTilesToBuffer
const ossimFilename & getHistogramPath() const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
ossim_uint32 getNumberOfBands(ossim_uint32 resLevel=0) const
const ossimGpt & getOrigin() const
ossimGpt midPoint() const
void setZone(const ossimGpt &ground)
virtual ossimDpt forward(const ossimGpt &worldPoint) const =0
All map projections will convert the world coordinate to an easting northing (Meters).
virtual bool addChild(ossimConnectableObject *attachableObject)
Will add an object to the container and then set the added objects owner to this. ...
bool isRgbData() const
Returns TRUE if the record represents an rgb data set:
void setWeight(ossim_uint32 index, double weight)
void setSupportDir(const ossimFilename &f)
Sets supplementary data files dir.
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Will pass this call to the head of the list.
virtual bool setView(ossimObject *baseObject)
virtual void setFilename(const ossimFilename &file)
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
virtual void setInverseFlag(bool inverseFlag)
ossimGrect combine(const ossimGrect &rect) const
void setTargetRange(ossim_float64 target_min, ossim_float64 target_max)
Instead of a single value for a target, this method allows for specifying a range of values to flip t...
virtual ossimPolyType getPolyType()
void setView()
Initializes all clients of the view projection to the current product projection. ...
bool valid() const
Returns TRUE if record is valid.
virtual bool addChild(ossimConnectableObject *attachableObject)
void setReplacementValue(ossim_float64 replacement_value)
void getTiePoint(ossimGpt &tie, bool edge) const
Get the latitude, longitude of the tie point.
virtual void setMaskType(ossimFileSelectionMaskType type)
Sets the mask type.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Class to scan pixels and flip target dn value to a replacement dn value.
virtual void setProperty(const ossimString &name, const ossimString &value)
const ossimDpt & ur() const
virtual void setOutputBandList(const vector< ossim_uint32 > &outputBandList, bool disablePassThru=false)
Sets the output band list.
void setHistogramOp(const ossimString &s)
bool isVectorData() const
Returns TRUE if the record represents a vector data set:
virtual ossimObject * createObject(const ossimString &name) const
ossimFilename dirCat(const ossimFilename &file) const
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
STUB. Not implemented.
virtual void setSupplementaryDirectory(const ossimFilename &dir)
Sets the supplementary directory.
virtual ossimObject * dup() const
virtual bool isAffectedByElevation() const =0
Pure virtual method to query if projection is affected by elevation.
virtual ossimFilename createDefaultHistogramFilename() const
static ossimInit * instance()
virtual std::multimap< long, ossimAnnotationObject * > getFeatureTable()=0
Pure virtual getFeatureTable method.
ossimFilename file() const
virtual bool hasOverviews() const
ossimImageFileWriter * createWriter(const ossimFilename &filename) const
virtual void setUlTiePoints(const ossimGpt &gpt)
ossimDpt metersPerDegree() const
static ossimImageHandlerRegistry * instance()
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
const ossimDpt & ll() const
void setRectangle(const ossimIrect &rect)
char ** argv()
return the argument array.
virtual ossimDpt getMetersPerPixel() const
virtual void setFilename(const ossimFilename &filename)
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
ossimString after(const ossimString &str, std::string::size_type pos=0) const
METHOD: after(str, pos) Returns string immediately after the token str.
virtual void lineSampleHeightToWorld(const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const
This is the pure virtual that projects the image point to the given elevation above ellipsoid...
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
virtual bool setOutputBandList(const std::vector< ossim_uint32 > &band_list)
If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled...
const ossimDpt & lr() const
const ossimString & getHistogramOp() const
void setBands(const std::vector< ossim_uint32 > &v)
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...
int & argc()
return the argument count.
void setHemisphere(const ossimGpt &ground)
void setExpandEnvVarsFlag(bool flag)
void setLowNormalizedClipPoint(const ossim_float64 &clip)
Sets the low clip point.
bool insertLeft(ossimConnectableObject *newObj, const ossimId &id)
ossimFilename path() const
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
virtual void outputProduct()
Writes the output product image. Throws an ossimException if error encountered.
static ossimEpsgProjectionFactory * instance()
Implements singleton pattern.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
bool openHistogram(const ossimFilename &histogram_file)
Open the histogram file.
void getCenter(ossimDpt ¢er_point) const
void setCutType(ossimPolyCutterCutType cutType)
bool addFirst(ossimConnectableObject *obj)
Adds it to the start of the chain.
const double & getWeight() const
void setMaskSource(ossimImageSource *maskSource)
This set method is necessary when this object is being added to an ossimImageChain because ossimImage...
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.