58 static const char BUILD_DATE_KW[] =
"build_date";
59 static const char CAN_OPEN_KW[] =
"can_open";
60 static const char CENTER_GROUND_KW[] =
"center_ground";
61 static const char CENTER_IMAGE_KW[] =
"center_image";
62 static const char CONFIGURATION_KW[] =
"configuration";
63 static const char DATUMS_KW[] =
"datums";
64 static const char DEG2RAD_KW[] =
"deg2rad";
65 static const char DUMP_KW[] =
"dump";
66 static const char DUMP_NO_OVERVIEWS_KW[] =
"dump_no_overviews";
67 static const char EXTENSIONS_KW[] =
"extensions";
68 static const char FACTORIES_KW[] =
"factories";
69 static const char FACTORY_KEYWORD_LIST_KW[] =
"factory_keyword_list";
70 static const char FONTS_KW[] =
"fonts";
71 static const char FORMAT_KW[] =
"format";
72 static const char FT2MTRS_KW[] =
"ft2mtrs";
73 static const char FT2MTRS_US_SURVEY_KW[] =
"ft2mtrs_us_survey";
74 static const char GEOM_INFO_KW[] =
"geometry_info";
75 static const char HEIGHT_KW[] =
"height";
76 static const char IMAGE_BOUNDS_KW[] =
"image_bounds";
77 static const char IMAGE_CENTER_KW[] =
"image_center";
78 static const char IMAGE_FILE_KW[] =
"image_file";
79 static const char IMAGE_INFO_KW[] =
"image_info";
80 static const char IMAGE_RECT_KW[] =
"image_rect";
81 static const char IMG2GRD_KW[] =
"img2grd";
82 static const char GRD2IMG_KW[] =
"grd2img";
83 static const char METADATA_KW[] =
"metadata";
84 static const char MTRS2FT_KW[] =
"mtrs2ft";
85 static const char MTRS2FT_US_SURVEY_KW[] =
"mtrs2ft_us_survey";
86 static const char MTRSPERDEG_KW[] =
"mtrs_per_deg";
87 static const char NORTH_UP_KW[] =
"north_up_angle";
88 static const char OUTPUT_FILE_KW[] =
"output_file";
89 static const char OVERVIEW_TYPES_KW[] =
"overview_types";
90 static const char OVERWRITE_KW[] =
"overwrite";
91 static const char PALETTE_KW[] =
"palette";
92 static const char PLUGINS_KW[] =
"plugins";
93 static const char PLUGIN_TEST_KW[] =
"plugin_test";
94 static const char PRETTY_PRINT_KW[] =
"pretty_print";
95 static const char PROJECTIONS_KW[] =
"projections";
96 static const char RAD2DEG_KW[] =
"rad2deg";
97 static const char READER_PROPS_KW[] =
"reader_props";
98 static const char RESAMPLER_FILTERS_KW[] =
"resampler_filters";
99 static const char REVISION_NUMBER_KW[] =
"revision_number";
100 static const char UP_IS_UP_KW[] =
"up_is_up";
101 static const char UP_IS_UP_GPT_KW[] =
"up_is_up_gpt";
102 static const char UP_IS_UP_IPT_KW[] =
"up_is_up_ipt";
103 static const char VERSION_KW[] =
"version";
104 static const char WRITERS_KW[] =
"writers_kw";
105 static const char WRITER_PROPS_KW[] =
"writer_props";
106 static const char ZOOM_LEVEL_GSDS_KW[] =
"zoom_level_gsds";
107 static const char ECEF2LLH_KW[] =
"ecef2llh";
108 static const char DUMP_STATE_KW[] =
"dump_state";
109 static const char STATE_KW[] =
"state";
112 "Dumps metadata information about input image and OSSIM in general.";
134 usageString +=
" [options] <optional-image | optional-state>";
152 au->
addCommandLineOption(
"-D",
"A human-readable (i.e., not necessarily key:value pairs) dump of the image.");
160 au->
addCommandLineOption(
"--dno",
"A generic dump if one is available. This option ignores overviews.");
162 au->
addCommandLineOption(
"--dump-state",
"If the image supports a state object then the state object will be dumped.");
164 au->
addCommandLineOption(
"--ecef2llh",
"<X> <Y> <Z> in ECEF coordinates and returns latitude longitude height position.");
168 au->
addCommandLineOption(
"-f",
"<format> Will output the information specified format [KWL | XML]. Default is KWL.");
170 au->
addCommandLineOption(
"--factories",
"<keyword_list_flag> Prints factory list. If keyword_list_flag is true, the result of a saveState will be output for each object.");
174 au->
addCommandLineOption(
"--ft2mtrs",
"<feet> Gives meters from feet (0.3048 meters per foot).");
176 au->
addCommandLineOption(
"--ft2mtrs-us-survey",
"<feet> Gives meters from feet (0.3048006096 meters per foot).");
180 au->
addCommandLineOption(
"--height",
"<latitude-in-degrees> <longitude-in-degrees> Returns the MSL and ellipoid height given a latitude longitude position.");
184 au->
addCommandLineOption(
"--img2grd",
"<x> <y> Gives ground point from zero based image point. Returns \"nan\" if point is outside of image area.");
185 au->
addCommandLineOption(
"--grd2img",
"<lat> <lon> <height> Gives full res image point from lat lon height.");
189 au->
addCommandLineOption(
"--mtrsPerDeg",
"<latitude> Gives meters per degree and meters per minute for a given latitude.");
191 au->
addCommandLineOption(
"--mtrs2ft",
"<meters> Gives feet from meters (0.3048 meters per foot).");
193 au->
addCommandLineOption(
"--mtrs2ft-us-survey",
"<meters> Gives feet from meters (0.3048006096 meters per foot).");
197 au->
addCommandLineOption(
"-o",
"<output-file> Will output the information to the file specified. Default is to standard out.");
223 au->
addCommandLineOption(
"--up-is-up or -u",
"Rotation angle to \"up is up\" for an image.\nWill return 0 if image's projection is not affected by elevation.");
225 au->
addCommandLineOption(
"--up-is-up-ipt",
"Computes up angle given full res image point: <x> <y>");
234 au->
addCommandLineOption(
"--zoom-level-gsds",
"Prints zoom level gsds for projections EPSG:4326 and EPSG:3857.");
238 <<
" ossim-info --version\n" 239 <<
" ossim-info -i ./myfile.tif\n" 240 <<
" prints out only general image information\n\n" 241 <<
" ossim-info -p ./myfile.tif\n" 242 <<
" prints out only image projection information\n\n" 243 <<
" ossim-info -p -s wge ./myfile.tif\n" 244 <<
" prints out only image projection information and shifts to wgs84\n\n" 245 <<
" ossim-info -p -i ./myfile.tif\n" 246 <<
" prints out both image and projection information\n\n" 247 <<
" ossim-info -p -i ./myfile.tif -o ./myfile.geom\n" 248 <<
" writes geometry file with both image and projection information\n\n" 249 <<
" ossim-info -p -i ./myfile.tif -v -o ./myfile.geom\n" 250 <<
" writes geometry file with both image and projection information\n" 251 <<
" while overwriting existing .geom file.\n\n" 252 <<
" ossim-info -f XML ./myfile.tif\n" 253 <<
" prints out image and projection information as an XML document\n\n" 254 <<
" ossim-info -d myfile.ntf\n" 255 <<
" Dumps all data available, in this case, all nitf tags, from file.\n\n" 256 <<
" ossim-info -d a.toc\n" 257 <<
" Dumps all data available, in this case, all nitf and rpf tags, from file.\n\n" 258 <<
" ossim-info --dno a.toc\n" 259 <<
" \"dno\" for \"dump no overviews\" Dumps all data available,\n" 260 <<
" in this case, all nitf and rpf tags, from file ignoring overviews.\n\n" 261 <<
" ossim-info -d -i -p myfile.ntf\n" 262 <<
" Typical usage case, i.e. do a dump of tags and print out image and\n" 263 <<
" projection information.\n\n" 271 static const char M[] =
"ossimInfo::initialize(ossimArgumentParser&)";
289 bool requiresInputImage =
false;
300 const char TRUE_KW[] =
"true";
302 if( ap.
read(
"--bounds") )
304 m_kwl.
add( IMAGE_BOUNDS_KW, TRUE_KW );
311 if( ap.
read(
"--build-date") )
313 m_kwl.
add( BUILD_DATE_KW, TRUE_KW );
322 m_kwl.
add( IMAGE_CENTER_KW, TRUE_KW );
329 if( ap.
read(
"--can-open") )
332 requiresInputImage =
true;
340 if( ap.
read(
"--cg") )
342 m_kwl.
add( CENTER_GROUND_KW, TRUE_KW );
349 if( ap.
read(
"--ci") )
351 m_kwl.
add( CENTER_IMAGE_KW, TRUE_KW );
358 if( ap.
read(
"--config") || ap.
read(
"--configuration") )
360 m_kwl.
add( CONFIGURATION_KW, TRUE_KW );
367 if( ap.
read(
"--datums") )
376 if( ap.
read(
"--deg2rad", sp1) )
378 m_kwl.
add( DEG2RAD_KW, ts1.c_str() );
387 m_kwl.
add( PRETTY_PRINT_KW, TRUE_KW );
388 requiresInputImage =
true;
398 requiresInputImage =
true;
405 if( ap.
read(
"--dump-state") )
407 m_kwl.
add( DUMP_STATE_KW, TRUE_KW );
408 requiresInputImage =
true;
415 if( ap.
read(
"--dno") )
418 m_kwl.
add( DUMP_NO_OVERVIEWS_KW, TRUE_KW );
419 requiresInputImage =
true;
426 if( ap.
read(
"--extensions") )
428 m_kwl.
add( EXTENSIONS_KW, TRUE_KW );
433 if( ap.
read(
"-f", sp1) )
442 if( ap.
read(
"--factories", sp1) )
445 m_kwl.
add( FACTORY_KEYWORD_LIST_KW, ts1.c_str());
452 if( ap.
read(
"--fonts") )
461 if( ap.
read(
"--ft2mtrs", sp1) )
463 m_kwl.
add( FT2MTRS_KW, ts1.c_str());
470 if( ap.
read(
"--ft2mtrs-us-survey", sp1) )
472 m_kwl.
add( FT2MTRS_KW, ts1.c_str());
473 m_kwl.
add( FT2MTRS_US_SURVEY_KW, TRUE_KW);
480 if( ap.
read(
"--height", sp1, sp2) )
493 if( ap.
read(
"--ecef2llh", sp1, sp2, sp3))
499 m_kwl.
add( ECEF2LLH_KW, ecefPoint.toString().c_str() );
508 m_kwl.
add( IMAGE_INFO_KW, TRUE_KW );
509 requiresInputImage =
true;
516 if( ap.
read(
"--img2grd", sp1, sp2) )
518 requiresInputImage =
true;
522 dpt.
x =
x.toFloat64();
523 dpt.
y =
y.toFloat64();
531 if( ap.
read(
"--grd2img", sp1, sp2, sp3) )
533 requiresInputImage =
true;
555 requiresInputImage =
true;
562 if( ap.
read(
"--mtrs2ft", sp1) )
564 m_kwl.
add( MTRS2FT_KW, ts1.c_str());
571 if( ap.
read(
"--mtrs2ft-us-survey", sp1) )
573 m_kwl.
add( MTRS2FT_KW, ts1.c_str());
574 m_kwl.
add( MTRS2FT_US_SURVEY_KW, TRUE_KW);
581 if( ap.
read(
"--mtrsPerDeg", sp1) )
583 m_kwl.
add( MTRSPERDEG_KW, ts1.c_str());
590 if( ap.
read(
"-n") || ap.
read(
"--north-up") )
599 if( ap.
read(
"-o", sp1) )
601 m_kwl.
add( OUTPUT_FILE_KW, ts1.c_str());
608 if( ap.
read(
"--overview-types") )
610 m_kwl.
add( OVERVIEW_TYPES_KW, TRUE_KW );
620 requiresInputImage =
true;
627 if( ap.
read(
"--palette") )
630 requiresInputImage =
true;
637 if( ap.
read(
"--plugins") )
646 if( ap.
read(
"--plugin-test", sp1) )
648 m_kwl.
add( PLUGIN_TEST_KW, ts1.c_str());
655 if( ap.
read(
"--projections") )
657 m_kwl.
add( PROJECTIONS_KW, TRUE_KW );
666 m_kwl.
add( IMAGE_RECT_KW, TRUE_KW );
667 requiresInputImage =
true;
674 if( ap.
read(
"--rad2deg", sp1) )
676 m_kwl.
add( RAD2DEG_KW, ts1.c_str());
683 if( ap.
read(
"--reader-props") )
685 m_kwl.
add( READER_PROPS_KW, TRUE_KW );
692 if( ap.
read(
"--resampler-filters") )
694 m_kwl.
add( RESAMPLER_FILTERS_KW, TRUE_KW );
701 if( ap.
read(
"--revision") ||
702 ap.
read(
"--revision-number") )
704 m_kwl.
add( REVISION_NUMBER_KW, TRUE_KW );
711 if( ap.
read(
"-u") || ap.
read(
"--up-is-up") )
713 requiresInputImage =
true;
720 if( ap.
read(
"--up-is-up-ipt", sp1, sp2))
722 requiresInputImage =
true;
724 m_kwl.
add( UP_IS_UP_IPT_KW, (ts1 +
" "+ts2).c_str() );
730 if(ap.
read(
"--up-is-up-gpt",sp1, sp2))
732 requiresInputImage =
true;
734 m_kwl.
add( UP_IS_UP_GPT_KW, (ts1 +
" "+ ts2).c_str() );
750 if( ap.
read(
"--version") || ap.
read(
"-V") )
759 if( ap.
read(
"--writer-props") )
761 m_kwl.
add( WRITER_PROPS_KW, TRUE_KW );
768 if( ap.
read(
"--writers") )
777 if( ap.
read(
"--zoom-level-gsds") )
779 m_kwl.
add( ZOOM_LEVEL_GSDS_KW, TRUE_KW );
791 std::string errMsg =
"Unknown option...";
799 if ( ap.
argc() == 2 )
806 if ( requiresInputImage )
819 <<
"m_kwl:\n" <<
m_kwl <<
"\n" 820 << M <<
" exit result = " << (result?
"true":
"false")
829 static const char M[] =
"ossimInfo::execute()";
836 << M <<
" entered..." 837 <<
"\nMap size: " << KEY_COUNT <<
"\n";
855 if ( consumedKeys < KEY_COUNT )
859 if (
keyIsTrue( std::string(BUILD_DATE_KW)) )
863 << BUILD_DATE_KW <<
": " << value <<
"\n";
922 bool keywordListFlag =
false;
923 lookup =
m_kwl.
find(FACTORY_KEYWORD_LIST_KW);
948 bool us_survey =
false;
949 lookup =
m_kwl.
find(FT2MTRS_US_SURVEY_KW);
973 bool us_survey =
false;
974 lookup =
m_kwl.
find(MTRS2FT_US_SURVEY_KW);
1051 lookup =
m_kwl.
find(RESAMPLER_FILTERS_KW);
1062 if (
keyIsTrue( std::string(REVISION_NUMBER_KW) ) )
1066 << REVISION_NUMBER_KW <<
": " << value <<
"\n";
1069 if (
keyIsTrue( std::string(VERSION_KW) ) )
1073 << VERSION_KW <<
": " << value <<
"\n";
1098 lookup =
m_kwl.
find(ZOOM_LEVEL_GSDS_KW);
1114 <<
"KEY_COUNT: " << KEY_COUNT
1115 <<
"\nconsumedKeys: " << consumedKeys <<
"\n";
1129 static const char M[] =
"ossimInfo::executeImageOptions()";
1139 const char* lookup = 0;
1142 bool dnoFlag =
false;
1143 bool overwriteFlag =
false;
1144 bool xmlOutFlag =
false;
1151 overwriteFlag = value.
toBool();
1160 if ( format.
upcase() ==
"XML" )
1171 outputFile = lookup;
1186 lookup =
m_kwl.
find( DUMP_NO_OVERVIEWS_KW );
1191 dnoFlag = value.
toBool();
1212 bool centerGroundFlag =
false;
1213 bool centerImageFlag =
false;
1214 bool imageBoundsFlag =
false;
1215 bool imageCenterFlag =
false;
1216 bool imageGeomFlag =
false;
1217 bool imageInfoFlag =
false;
1218 bool imageRectFlag =
false;
1219 bool img2grdFlag =
false;
1220 bool grd2imgFlag =
false;
1221 bool metaDataFlag =
false;
1222 bool northUpFlag =
false;
1223 bool paletteFlag =
false;
1224 bool upIsUpFlag =
false;
1225 bool imageToGroundFlag =
false;
1226 bool groundToImageFlag =
false;
1227 bool dumpState =
false;
1228 bool canOpenFlag =
false;
1235 dumpState = value.
toBool();
1239 lookup =
m_kwl.
find( CENTER_GROUND_KW );
1244 centerGroundFlag = value.
toBool();
1253 centerImageFlag = value.
toBool();
1262 metaDataFlag = value.
toBool();
1271 paletteFlag = value.
toBool();
1280 imageBoundsFlag = value.
toBool();
1289 imageCenterFlag = value.
toBool();
1298 imageRectFlag = value.
toBool();
1310 imageInfoFlag = value.
toBool();
1336 imageGeomFlag = value.
toBool();
1345 northUpFlag = value.
toBool();
1354 upIsUpFlag = value.
toBool();
1363 canOpenFlag = value.
toBool();
1367 if ( consumedKeys == 0 )
1369 imageInfoFlag =
true;
1370 imageGeomFlag =
true;
1373 if ( centerGroundFlag || centerImageFlag || imageBoundsFlag || imageCenterFlag ||
1374 imageRectFlag || img2grdFlag || grd2imgFlag || metaDataFlag || paletteFlag ||
1375 imageInfoFlag || imageGeomFlag || northUpFlag || upIsUpFlag || dumpState ||
1376 imageToGroundFlag || groundToImageFlag || canOpenFlag)
1388 okwl.
add(
"can_open",
"true",
true);
1392 okwl.
add(
"can_open",
"false",
true);
1396 if ( centerGroundFlag )
1401 if ( centerImageFlag )
1406 if ( imageCenterFlag )
1413 if ( imageBoundsFlag )
1418 if ( imageRectFlag )
1442 if ( imageInfoFlag )
1447 if ( imageGeomFlag )
1452 if ( imageRectFlag )
1498 if ( !overwriteFlag && outputFile.
exists() )
1501 <<
"ERROR: File already exists: " << outputFile
1502 <<
"\nUse -v option to overwrite." 1509 okwl.
write( outputFile );
1524 <<
"consumedKeys: " << consumedKeys <<
"\n" 1525 << M <<
" exited...\n";
1528 return consumedKeys;
1541 if ( dumpFlag || dnoFlag )
1547 if ( imageGeomFlag || imageInfoFlag || metaDataFlag || paletteFlag )
1561 if ( imageInfoFlag )
1565 if ( imageGeomFlag )
1577 bool result =
false;
1593 errMsg <<
"ossimInfo::getImageInfo ERROR:\nInvalid entry: " << entry
1616 std::shared_ptr<ossim::ImageHandlerState> state;
1634 std::shared_ptr<ossim::ImageHandlerState> state;
1650 openConnection(file);
1657 std::string errMsg =
"ossimInfo::openImage ERROR:\nCould not open: ";
1698 <<
"No print available for: " << file.
c_str() << std::endl;
1711 info->setProcessOverviewFlag(
false);
1713 info->getKeywordlist(kwl);
1719 <<
"No dump available for: " << file.
c_str() << std::endl;
1734 std::vector< ossimRefPtr< ossimProperty > > list;
1736 std::vector< ossimRefPtr< ossimProperty > >::const_iterator i = list.begin();
1737 while (i != list.end())
1745 if ((*i)->getClassName() ==
"ossimContainerProperty")
1750 std::vector< ossimRefPtr< ossimProperty > > list2;
1753 std::vector< ossimRefPtr< ossimProperty > >::const_iterator i2 = list2.begin();
1754 while (i2 != list2.end())
1756 key = (*i2)->getName();
1757 value = (*i2)->valueToString();
1765 key = (*i)->getName();
1766 value = (*i)->valueToString();
1792 std::vector<ossim_uint32> entryList;
1823 std::vector<ossim_uint32> entryList;
1826 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
1827 while ( i != entryList.end() )
1843 bool result =
false;
1854 bool result =
false;
1860 bool outputEntry =
true;
1865 outputEntry =
false;
1879 std::string entryName;
1881 if ( entryName.size() )
1883 kwl.
add(prefix.
c_str(),
"entry_name", entryName.c_str(),
true);
1901 kwl.
add(prefix,
"overview.type",
1916 boundingRect.
height(),
true);
1918 boundingRect.
width(),
true);
1934 kwl.
add(prefix,
"radiometry", rad.
c_str(),
true);
1962 std::vector<ossim_uint32> entryList;
1965 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
1966 while ( i != entryList.end() )
1982 bool result =
false;
1995 bool result =
false;
2001 bool outputEntry =
true;
2006 outputEntry =
false;
2046 if ((ulg.
lon == 180.0) && (urg.
lon == 180.0))
2050 if ((llg.
lon == 180.0) && (lrg.
lon == 180.0))
2055 kwl.
add(prefix,
"ul_lat", ulg.
latd(),
true);
2056 kwl.
add(prefix,
"ul_lon", ulg.
lond(),
true);
2057 kwl.
add(prefix,
"ll_lat", llg.
latd(),
true);
2058 kwl.
add(prefix,
"ll_lon", llg.
lond(),
true);
2059 kwl.
add(prefix,
"lr_lat", lrg.
latd(),
true);
2060 kwl.
add(prefix,
"lr_lon", lrg.
lond(),
true);
2061 kwl.
add(prefix,
"ur_lat", urg.
latd(),
true);
2062 kwl.
add(prefix,
"ur_lon", urg.
lond(),
true);
2078 fabs(ulg.
lond()-urg.
lond())/(outputRect.
width()-1.0),
true);
2095 <<
"No geometry for file " << ih->
getFilename() << std::endl;
2116 std::vector<ossim_uint32> entryList;
2119 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2120 while ( i != entryList.end() )
2150 <<
"Could not get image center for: " << ih->
getFilename() << std::endl;
2168 std::vector<ossim_uint32> entryList;
2171 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2172 while ( i != entryList.end() )
2210 <<
"Could not get ground center for: " << ih->
getFilename() << std::endl;
2228 std::vector<ossim_uint32> entryList;
2231 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2232 while ( i != entryList.end() )
2282 <<
"Could not get image bounds for: " << ih->
getFilename() << std::endl;
2300 std::vector<ossim_uint32> entryList;
2303 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2304 while ( i != entryList.end() )
2351 kwl.
add(prefix,
"ground_point",
"nan",
true);
2361 <<
"Could not get ground center for: " << ih->
getFilename() << std::endl;
2379 std::vector<ossim_uint32> entryList;
2382 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2383 while ( i != entryList.end() )
2421 <<
"Could not get ground center for: " << ih->
getFilename() << std::endl;
2439 std::vector<ossim_uint32> entryList;
2442 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2443 while ( i != entryList.end() )
2465 bool result =
false;
2501 kwl.
add(prefix, UP_IS_UP_KW, upIsUp,
true);
2512 <<
"Could not get up is up angle for: " << ih->
getFilename() << std::endl;
2531 std::vector<ossim_uint32> entryList;
2534 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2535 while ( i != entryList.end() )
2557 bool result =
false;
2568 kwl.
add(prefix, NORTH_UP_KW, northUp,
true);
2578 <<
"Could not get north up angle for: " << ih->
getFilename() << std::endl;
2596 std::vector<ossim_uint32> entryList;
2599 std::vector<ossim_uint32>::const_iterator i = entryList.begin();
2600 while ( i != entryList.end() )
2611 bool result =
false;
2614 std::vector<ossim_uint32> bandList;
2616 if ( result && ( bandList.size() == 3 ) )
2619 ossim::toSimpleStringList<ossim_uint32>(os, bandList);
2624 kwl.
add(prefix,
"rgb_bands", os.
c_str(),
true);
2657 <<
"Could not get image rectangle for: " << ih->
getFilename() << std::endl;
2667 bool result =
false;
2677 bool result =
false;
2702 out <<
"\npreferences_keyword_file: " 2704 <<
"preferences_keyword_list:\n" 2712 std::vector<ossimString> typeList;
2714 for(
int i = 0; i < (int)typeList.size(); ++i)
2721 cout << typeList[i] << endl;
2722 cout <<
"______________________________________________________" << endl;
2725 cout << kwl << endl;
2726 cout <<
"______________________________________________________" << endl;
2732 cout << typeList[i] << endl;
2745 std::ios_base::fmtflags f = out.flags();
2747 std::vector<ossimString> datumList;
2750 std::vector<ossimString>::const_iterator i = datumList.begin();
2752 while ( i != datumList.end() )
2759 out << setiosflags(ios::left)
2773 out <<
"No ellipsoid for code: " << (*i) << std::endl;
2778 out <<
"No datum for code: " << (*i) << std::endl;
2797 std::vector<ossimFontInformation> fontInfoList;
2800 std::vector<ossimFontInformation>::const_iterator i = fontInfoList.begin();
2802 while ( i != fontInfoList.end() )
2804 out << *(i) << endl;
2810 if ( defaultFont.
valid() )
2812 out <<
"default_font: " << defaultFont->
getFamilyName() << std::endl;
2828 std::ios_base::fmtflags f = out.flags();
2830 out << std::setiosflags(std::ios::fixed) << std::setprecision(15)
2831 <<
"\n" << degrees <<
" degrees = " 2832 << radians <<
" radians.\n" << std::endl;
2842 out <<
"ECEF: " << ecefPoint.
toString() <<
"\n" 2858 std::ios_base::fmtflags f = out.flags();
2860 out << std::setiosflags(std::ios::fixed) << std::setprecision(15)
2861 <<
"\n" << radians <<
" radians = " 2862 << degrees <<
" degrees.\n" << std::endl;
2880 std::string conversionString;
2884 conversionString =
"0.3048006096";
2889 conversionString =
"0.3048";
2893 std::ios_base::fmtflags f = out.flags();
2895 out << setiosflags(ios::fixed) << setprecision(15)
2896 << feet <<
" * " << conversionString <<
" = " 2897 << meters <<
" meters." << std::endl;
2915 std::ios_base::fmtflags f = out.flags();
2918 std::string conversionString;
2923 conversionString =
"0.3048006096";
2928 conversionString =
"0.3048";
2931 out << setiosflags(ios::fixed) << setprecision(15)
2932 << meters <<
" / " << conversionString <<
" = " 2933 << feet <<
" feet." << std::endl;
2953 out << setiosflags(ios::fixed) << setprecision(15)
2954 <<
"Meters per degree and minute at latitude of " << latitude <<
":\n" 2955 <<
"Meters per degree latitude: " 2956 << setw(20) << mpd.
y <<
"\n" 2957 <<
"Meters per degree longitude: " 2958 << setw(20) << mpd.
x <<
"\n" 2959 <<
"Meters per minute latitude: " 2960 << setw(20) << arcLengthLat <<
"\n" 2961 <<
"Meters per minute longitude: " 2962 << setw(20) << arcLengthLon <<
"\n" 2963 <<
"Geodetic radius: " 2964 << setw(20) << radius <<
"\n" 2977 std::ios_base::fmtflags f = out.flags();
2995 mslOffset = hgtAboveEllipsoid - hgtAboveMsl;
2998 std::vector<ossimFilename> cellList;
3001 if (!cellList.empty())
3003 out <<
"Opened cell: " << cellList[0] <<
"\n";
3007 out <<
"Did not find cell for point: " << gpt <<
"\n";
3010 out <<
"MSL to ellipsoid delta: ";
3013 out << std::setprecision(15) << mslOffset;
3019 out <<
"\nHeight above MSL: ";
3022 out << std::setprecision(15) << hgtAboveMsl;
3028 out <<
"\nHeight above ellipsoid: ";
3031 out << std::setprecision(15) << hgtAboveEllipsoid <<
"\n";
3035 out <<
"nan" <<
"\n";
3037 out <<
"Geoid value: ";
3041 out << std::setprecision(15) << geoidOffset << std::endl;
3045 out <<
"nan" << std::endl;
3063 const vector<ossimString>& list = extList.
getList();
3067 out <<
"No image file extensions handled. This should never happen!" << std::endl;
3071 out<<
"\nImage Entensions Supported:"<< endl;
3072 for (
const auto& extension : list)
3073 out<<
" "<<extension<<endl;
3092 out <<
"No plugins loaded in the OSSIM core library" << std::endl;
3106 out <<
"Plugin loaded: " << plugin << std::endl;
3110 out <<
"Unable to load plugin: " << plugin << std::endl;
3122 out <<
"\nValid overview types: " << std::endl;
3124 std::vector<ossimString> outputType;
3127 std::copy(outputType.begin(),
3129 std::ostream_iterator<ossimString>(out,
"\t\n"));
3140 out <<
"Projections:\n";
3142 std::vector<ossimString> list;
3144 getAllTypeNamesFromRegistry(list);
3146 std::vector<ossimString>::const_iterator i = list.begin();
3147 while ( i != list.end() )
3174 std::vector<ossimString> list;
3177 std::vector<ossimString>::const_iterator i = list.begin();
3178 while ( i != list.end() )
3205 std::ios_base::fmtflags f = out.flags();
3207 out << setprecision(15)<< setiosflags(std::ios_base::fixed|std::ios_base::right);
3209 const int MAX_LEVEL = 24;
3210 const double TILE_SIZE = 256.0;
3211 const double EPSG_4326_BOUNDS = 180.0;
3212 const double EPSG_3857_BOUNDS = 40075016.685578488;
3215 const double MTRS_PER_DEGREE_AT_EQUATOR = 111319.490793273565941;
3218 <<
"tile size: 256\n" 3219 <<
"dpp = \"degrees per pixel\"\n" 3220 <<
"mpp = \"meters per pixel\"\n\n";
3223 double level_0_gsd = EPSG_4326_BOUNDS / TILE_SIZE;
3224 double level_gsd = 0.0;
3229 out <<
"EPSG:4326 level info:\n" 3230 <<
"Note: Assuming square pixels, level 0 having (2x1) tiles.\n" 3231 <<
"bounds: 360.0 X 180.0\n" 3232 <<
"level[" << std::setw(2) << std::setfill(
'0') << i <<
"] dpp:" 3233 << std::setw(18) << std::setfill(
' ') << level_0_gsd
3234 <<
" equivalent mpp:" << std::setw(22)
3235 << (level_0_gsd * MTRS_PER_DEGREE_AT_EQUATOR)
3236 <<
" (" << tilesX <<
"x" << tilesY <<
")" <<
"\n";
3238 for ( i = 1; i <= MAX_LEVEL; ++i )
3240 tilesX = tilesX << 1;
3241 tilesY = tilesY << 1;
3242 level_gsd = level_0_gsd / std::pow( 2.0, i );
3243 out <<
"level[" << std::setw(2) << std::setfill(
'0') << i <<
"] dpp:" 3244 << std::setw(18) << std::setfill(
' ') << level_gsd
3245 <<
" equivalent mpp:" << std::setw(22)
3246 << (level_gsd * MTRS_PER_DEGREE_AT_EQUATOR)
3247 <<
" (" << tilesX <<
"x" << tilesY <<
")"<<
"\n";
3252 level_0_gsd = EPSG_3857_BOUNDS / TILE_SIZE;
3257 out <<
"\n\nEPSG:3857 level info:\n" 3258 <<
"Note: Assuming square pixels, level 0 having (1x1) tile.\n" 3259 <<
"bounds: 40075016.685578488 X 40075016.685578488\n" 3260 <<
"level[" << std::setw(2) << std::setfill(
'0') << i <<
"] mpp:" 3261 << std::setw(23) << std::setfill(
' ') << level_0_gsd
3262 <<
" (" << tilesX <<
"x" << tilesX <<
")" <<
"\n";
3264 for ( i = 1; i <= MAX_LEVEL; ++i )
3266 tilesX = tilesX << 1;
3267 level_gsd = level_0_gsd / std::pow( 2.0, i );
3268 out <<
"level[" << std::setw(2) << std::setfill(
'0') << i <<
"] mpp:" 3269 << std::setw(23) << std::setfill(
' ') << level_gsd
3270 <<
" (" << tilesX <<
"x" << tilesX <<
")" <<
"\n";
3327 s =
"16-bit unsigned";
3332 s =
"16-bit signed";
3337 s =
"32-bit unsigned";
3342 s =
"32-bit signed";
3352 s =
"64-bit double float";
3357 s =
"normalized 32-bit float";
3362 s =
"normalized 64-bit double float";
3375 #ifdef OSSIM_BUILD_DATE 3384 #ifdef OSSIM_REVISION 3393 #ifdef OSSIM_VERSION 3411 document.
write( file );
3416 bool result =
false;
16 bit unsigned integer (15 bits used)
void mtrs2ft(const ossim_float64 &meters, bool us_survey) const
Converts meters to feet and outputs to stdout.
virtual void valueToString(ossimString &valueResult) const =0
static const char * DESCRIPTION
Used by ossimUtilityFactory.
void write(std::ostream &output, const UsageMap &um, unsigned int widthOfOutput=80)
std::string getApplicationName() const
return the application name, as specified by argv[0]
const ossimKeywordlist & preferencesKWL() const
void addCommandLineOption(const ossimString &option, const ossimString &explanation)
void printResamplerFilters() const
Prints resampler filters to stdout.
bool pointWithin(const ossimDpt &pt, double epsilon=0.0) const
static const char * DECIMAL_DEGREES_PER_PIXEL_LAT
virtual void getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList &extensionList) const
void getPropertyList(std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
virtual std::ostream & print(std::ostream &os) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
virtual void getFilterTypes(std::vector< ossimString > &filterTypes) const
void getUpIsUpAngle(ossimKeywordlist &kwl)
Populates keyword list with up_is_up_angle.
static ossimString upcase(const ossimString &aString)
void printReaderProps() const
Prints reader properties to stdout.
ossimInfo()
default constructor
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
bool isAffectedByElevation() const
Returns TRUE if this geometry is sensitive to elevation.
void getOpenCellList(std::vector< ossimFilename > &list) const
virtual ossimRefPtr< ossimNBandLutDataObject > getLut() const
ossim_float64 width() const
static const ossimFilename NIL
This was taken from Wx widgets for performing touch and access date stamps.
virtual void getPropertyList(std::vector< ossimRefPtr< ossimProperty > > &children) const
void printAllPluginInformation(std::ostream &out)
void getCenterGround(ossimKeywordlist &kwl)
Populates keyword list with image center ground point.
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
void printConfiguration() const
Dumps ossim preferences/configuration data.
double lond() const
Will convert the radian measure to degrees.
Represents serializable keyword/value map.
bool addFile(const char *file)
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
bool write(const ossimFilename &file)
static const char * LR_X_KW
static ossimDatumFactoryRegistry * instance()
instance method
void getNorthUpAngle(ossimKeywordlist &kwl)
Populates keyword list with north_up_angle.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
const char * find(const char *key) const
void addOptions(ossimArgumentParser &parser)
ossimRefPtr< ossimImageHandler > openImageHandler(const ossimFilename &file) const
Opens image.
ossimFilename expand() const
Method to do file name expansion.
virtual bool execute()
execute method.
void rad2deg(const ossim_float64 &radians) const
Converts radians to degrees and outputs to stdout.
virtual ossim_uint32 epsgCode() 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...
double nan()
Method to return ieee floating point double precision NAN.
void getBoundingRect(ossimIrect &bounding_rect) const
Get the bounding rect of (0, 0) to (imageSize.x-1, imageSize.y-1).
const ossimDpt & ul() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
bool keyIsTrue(const std::string &key) const
void openImageFromState(const ossimFilename &file)
Opens image handler and stores in m_img data member.
void mtrsPerDeg(const ossim_float64 &latitude) const
Get meters per degree for a given latitude and outputs to stdout.
virtual const ossimString & code() const
static ossimImageWriterFactoryRegistry * instance()
void getRadiometry(ossimScalarType scalar, std::string &s) const
Gets the radiometry string, i.e.
static ossimString toString(bool aValue)
Numeric to string methods.
static const char * NUMBER_LINES_KW
void openImage(const ossimFilename &file)
Opens image handler and stores in m_img data member.
static const char * TIE_POINT_LON_KW
virtual const ossimImageHandler * getOverview() const
static const char * NUMBER_INPUT_BANDS_KW
virtual const ossimString & name() const
void printOverviewTypes() const
Prints overview types to stdout.
std::shared_ptr< ossim::ImageHandlerState > getState()
virtual void getEntryName(ossim_uint32 entryIdx, std::string &name) const
Get the name of entry as a string.
static ossimObjectFactoryRegistry * instance()
void testPlugin(const ossimFilename &plugin) const
Test a plugin load and outputs to stdout.
static const char * NUMBER_ENTRIES_KW
16 bit unsigned integer (14 bits used)
virtual ossimString getClassName() const
std::ostream & ecef2llh(const ossimEcefPoint &ecefPoint, std::ostream &out) const
Converts ecef point to lat lon height.
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
16 bit unsigned integer (13 bits used)
void setCommandLineUsage(const ossimString &explanation)
void outputXml(const ossimKeywordlist &kwl) const
Convert keyword list to xml then outputs to standard out.
ossimApplicationUsage * getApplicationUsage()
ossimRefPtr< ossimImageHandler > getImageHandler()
double latd() const
Will convert the radian measure to degrees.
void wrap()
Wrap method to maintain longitude between -180 and +180 and latitude between -90 and +90...
virtual bool write(const char *file, const char *comment=0) const
Methods to dump the ossimKeywordlist to a file on disk.
std::ostream & printWriterProps(std::ostream &out) const
Prints list of writers from getImageTypeList.
virtual ossimString getShortName() const
const ossimDrect & expand(const ossimDpt &padding)
static const char * METERS_PER_PIXEL_Y_KW
void toPoint(const std::string &s)
Initializes this point from string.
void getImg2grd(ossimKeywordlist &kwl)
Populates keyword list with ground point for image point.
void ft2mtrs(const ossim_float64 &feet, bool us_survey) const
Converts feet to meters and outputs to stdout.
const ossimDatum * datum() const
datum().
ossimRefPtr< ossimImageHandler > m_img
Holds the open image.
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
virtual double getMinPixelValue(ossim_uint32 band=0) const
Retuns the min pixel value.
void getImageInfo(const ossimFilename &file, bool dumpFlag, bool dnoFlag, bool imageGeomFlag, bool imageInfoFlag, bool metaDataFlag, bool paletteFlag, ossimKeywordlist &kwl) const
getImageInfo Method to open image "file" and get image info in the form of a ossimKeywordlist.
void reportRemainingOptionsAsUnrecognized(ossimErrorSeverity severity=OSSIM_BENIGN)
for each remaining option report it as an unrecongnized.
ossimString toString() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
void printDatums() const
Dumps datum list to stdout.
void printFonts() const
Prints fonts list to stdout.
void outputHeight(const ossimGpt &gpt) const
Gets the height for ground point (latitude, longitude).
std::shared_ptr< ossimInfoBase > create(const ossimFilename &file) const
Create method.
bool getRgbBands(ossimImageHandler *ih, ossim_uint32 entry, ossimKeywordlist &kwl) const
Populates keyword list with rgb bands if available.
void getFontInformation(std::vector< ossimFontInformation > &informationList) const
static const char * LR_Y_KW
void getImageMetadata(ossimKeywordlist &kwl) const
Populates keyword list with metadata.
static ossimSharedPluginRegistry * instance()
static const char * UL_X_KW
bool errors(ossimErrorSeverity severity=OSSIM_BENIGN) const
void toPoint(const std::string &s)
Initializes this point from string.
void fromKwl(const ossimKeywordlist &kwl)
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual const ossimFilename & getFilename() const
Returns the filename.
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
void getRevisionNumber(std::string &s) const
Gets revision number.
virtual ossimString getFamilyName() const
virtual double getHeightAboveEllipsoid(const ossimGpt &gpt)
const ossimString & name() const
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
Method to populate a list of supported types of all factories registered to this registry.
bool toBool() const
String to numeric methods.
void deg2rad(const ossim_float64 °rees) const
Converts degrees to radians and outputs to stdout.
unsigned int ossim_uint32
virtual ~ossimInfo()
virtual destructor
virtual const ossimDatum * create(const ossimString &code) const
create method
32 bit normalized floating point
ossimDpt getMetersPerPixel() const
Returns the GSD associated with this image in the active projection.
void toPoint(const std::string &s)
Initializes this point from string.
virtual const ossimEllipsoid * ellipsoid() const
static const char * NUMBER_OUTPUT_BANDS_KW
static ossimGeoidManager * instance()
Implements singelton pattern:
ossim_float64 toFloat64() const
virtual bool getRgbBandList(std::vector< ossim_uint32 > &bandList) const
Convenience method to get the zero based rgb output band list.
virtual void getList(std::vector< ossimString > &list) const
getList method to return a combined list of all datums from registered datum factories.
ossim_uint32 executeImageOptions(const ossimFilename &file)
handles image options.
void closeImage()
Closes image if open.
static const char * DECIMAL_DEGREES_PER_PIXEL_LON
void prettyPrint(const ossimFilename &file) const
Dumps the image information from ossimInfoFactoryRegistry.
ossim_float32 toFloat32() const
static ossimString downcase(const ossimString &aString)
virtual bool initialize(ossimArgumentParser &ap)
Initial method.
ossimFont * getDefaultFont() const
static const char * UL_Y_KW
const std::vector< T > & getList() const
void printExtensions() const
Prints supported image file extensions to stdout.
virtual ossim_uint32 getNumberOfEntries() const
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
ossim_float64 height() const
void save(ossimKeywordlist &kwl, const char *prefix) const
Output list to the kwl.
bool isImageEntryOverview() const
void getGrd2img(ossimKeywordlist &kwl)
Populates keyword list with image point for grund point.
static ossimPreferences * instance()
void dumpImage(const ossimFilename &file, bool dnoFlag, ossimKeywordlist &kwl) const
Dumps the image information from ossimInfoFactoryRegistry to keyword list.
static ossimProjectionFactoryRegistry * instance()
void printWriters() const
Prints list of available writers to stdout.
void printZoomLevelGsds() const
Prints zoom levels to stdout.
static const char * ENTRY_KW
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
64 bit normalized floating point
static ossimOverviewBuilderFactoryRegistry * instance()
instance method for access to theInstance pointer.
16 bit unsigned integer (11 bits used)
ossimString toString(ossim_uint32 precision=15) const
virtual void setUsage(ossimArgumentParser &ap)
Adds application arguments to the argument parser.
static ossimFontFactoryRegistry * instance()
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual double getHeightAboveMSL(const ossimGpt &gpt)
Height access methods:
static ossimInfoFactoryRegistry * instance()
instance method
This class defines an abstract Handler which all image handlers(loaders) should derive from...
void getImageBounds(ossimKeywordlist &kwl)
Populates keyword list with edge to edge image bounds.
ossimDpt midPoint() const
void getVersion(std::string &s) const
Gets version.
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
void setDescription(const ossimString &desc)
void printProjections() const
Prints projections to stdout.
double geodeticRadius(const double &latitude) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
const ossimDpt & ur() const
virtual ossimObject * createObject(const ossimString &name) const
void printFactories(bool keywordListFlag) const
Prints factories.
ossim_uint32 getSize() const
void printPlugins() const
Prints loaded plugins to stdout.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
static std::shared_ptr< ImageHandlerStateRegistry > instance()
static ossimInit * instance()
ossim_float64 upIsUpAngle(const ossimDpt &) const
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
ossimDpt metersPerDegree() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the transform (if any) and projection (if any) states to the KWL.
void getCenterImage(ossimKeywordlist &kwl)
Populates keyword list with image center point.
static ossimImageHandlerRegistry * instance()
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
std::ostream & printImageTypeList(std::ostream &out) const
Prints list of writers from getImageTypeList.
std::ostream & printReaderProps(std::ostream &out) const
Prints list of readers and properties.
const ossimDpt & ll() const
static const char * TIE_POINT_LAT_KW
ossimString toString(ossim_uint32 precision=15) const
static ossimSupportFilesList * instance()
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
void getImagePalette(ossimKeywordlist &kwl)
Populates keyword list with palette data.
std::basic_istringstream< char > istringstream
Class for char input memory streams.
void getImageGeometryInfo(ossimKeywordlist &kwl, bool dnoFlag)
Populates keyword list with image geometry/projection information.
void printWriterProps() const
Prints writer properties to stdout.
virtual ossim_uint32 getNumberOfInputBands() const =0
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
ossim_float64 northUpAngle() const
virtual double offsetFromEllipsoid(const ossimGpt &gpt)
const ossimDpt & lr() const
void getImageRect(ossimKeywordlist &kwl)
Populates keyword list with image rectangle.
int & argc()
return the argument count.
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
static const char * METERS_PER_PIXEL_X_KW
static const char * NUMBER_SAMPLES_KW
void getBuildDate(std::string &s) const
Gets build date.
ossimFilename getPreferencesFilename() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
ossimString toString(ossim_uint32 precision=15) const
To string method.
void writeErrorMessages(std::ostream &output, ossimErrorSeverity sevrity=OSSIM_BENIGN)
write out error messages at an above specified .
const std::string & string() const
16 bit unsigned integer (12 bits used)
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.