39 if ( ((aValue < 0.0) && (
size < 8)) ||
40 ((aValue >= 0.0) && (
size < 7)) )
45 <<
"ossimNitfCommon::convertToScientificString DEBUG:" 46 <<
"\nsize range error!" 63 s1 << std::setiosflags(std::ios_base::scientific|std::ios_base::internal)
66 << std::setprecision(precision)
79 <<
"ossimNitfCommon::convertToScientificString DEBUG:" 80 <<
"\nIncorrect output size!" 81 <<
"\nValue: " << aValue
82 <<
"\nString: " << result
97 s1 << std::setiosflags(std::ios_base::fixed|
98 std::ios_base::internal)
99 << std::setprecision(precision)
109 <<
"ossimNitfCommon::convertToDoubleString DEBUG:" 110 <<
"\nresult: " << result << std::endl;
115 <<
"ossimNitfCommon::convertToDoubleString DEBUG:" 116 <<
"\nIncorrect output size!" 129 s1 << std::setiosflags(std::ios_base::fixed|
130 std::ios_base::internal)
142 <<
"ossimNitfCommon::convertToUIntString DEBUG:" 143 <<
"\nIncorrect output size!" 144 <<
"\nValue: " << aValue
145 <<
"\nString: " << result
158 s1 << std::setiosflags(std::ios_base::fixed|
159 std::ios_base::internal)
171 <<
"ossimNitfCommon::convertToIntString DEBUG:" 172 <<
"\nIncorrect output size!" 173 <<
"\nValue: " << aValue
174 <<
"\nString: " << result
210 <<
"ossimNitfCommon::convertToDdLatLonLocString DEBUG:" 211 <<
"\nresult: " << result
220 std::streamsize width,
221 std::ios_base::fmtflags ioflags,
225 out << std::setw(width)
226 << std::setfill(fill)
227 << std::setiosflags(ioflags)
230 memcpy(fieldDestination, out.str().c_str(), width);
244 std::string s =
"ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUTM zone greate than 60!";
249 throw std::out_of_range(s);
257 std::string s =
"ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left easting too large for NITF field!";
262 throw std::out_of_range(s);
267 std::string s =
"ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left northing too large for NITF field!";
272 throw std::out_of_range(s);
291 std::string s =
"ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right easting too large for NITF field!";
296 throw std::out_of_range(s);
301 std::string s =
"ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right northing too large for NITF field!";
306 throw std::out_of_range(s);
323 std::string s =
"ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right easting too large for NITF field!";
328 throw std::out_of_range(s);
333 std::string s =
"ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right northing too large for NITF field!";
338 throw std::out_of_range(s);
356 std::string s =
"ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left easting too large for NITF field!";
361 throw std::out_of_range(s);
366 std::string s =
"ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left northing too large for NITF field!";
371 throw std::out_of_range(s);
384 return out.str().c_str();
413 out << (ul.
lat >= 0.0?
"+":
"")
416 << std::setprecision(3)
417 << std::setiosflags(std::ios::fixed)
419 << (ul.
lon >= 0.0?
"+":
"")
422 << std::setprecision(3)
423 << std::setiosflags(std::ios::fixed)
425 out << (ur.
lat >= 0.0?
"+":
"")
428 << std::setprecision(3)
429 << std::setiosflags(std::ios::fixed)
431 << (ur.
lon >= 0.0?
"+":
"")
434 << std::setprecision(3)
435 << std::setiosflags(std::ios::fixed)
437 out << (lr.
lat >= 0.0?
"+":
"")
440 << std::setprecision(3)
441 << std::setiosflags(std::ios::fixed)
443 << (lr.
lon >= 0.0?
"+":
"")
446 << std::setprecision(3)
447 << std::setiosflags(std::ios::fixed)
449 out << (ll.
lat >= 0.0?
"+":
"")
452 << std::setprecision(3)
453 << std::setiosflags(std::ios::fixed)
455 << (ll.
lon >= 0.0?
"+":
"")
458 << std::setprecision(3)
459 << std::setiosflags(std::ios::fixed)
499 << __FILE__ <<
":" << __LINE__
500 <<
"\nUnhandled scalar type: " << scalarType << std::endl;
536 else if (s.
size() == 2)
16 bit unsigned integer (15 bits used)
static ossimString upcase(const ossimString &aString)
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
ossim_uint32 height() const
static ossimString getNitfPixelType(ossimScalarType scalarType)
Get the nitf pixel type string from scalar type.
static ossimString toString(bool aValue)
Numeric to string methods.
16 bit unsigned integer (14 bits used)
static ossimString encodeUtm(ossim_uint32 zone, const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
This will encode a 60 character IGEOLO field.
16 bit unsigned integer (13 bits used)
ossimNitfCommon()
default constructor
static ossimString getCompressionRate(const ossimIrect &rect, ossim_uint32 bands, ossimScalarType scalar, ossim_uint64 lengthInBytes)
Get compression rate (COMRAT) which is bits perpixel per band.
static ossimString convertToDoubleString(const ossim_float64 &aValue, ossim_uint32 precision, ossim_uint32 size)
This method takes a value and converts to a string of size with requested precision with a '0' fill...
static ossimString convertToDdLatLonLocString(const ossimDpt &pt, ossim_uint32 precision)
Converts pt to a decimal degrees latitude longitude location string.
static ossimString convertToScientificString(const ossim_float64 &aValue, ossim_uint32 size)
This method takes a value and a size(or width) and converts it to a scientific notation sting in the ...
std::string::size_type size() const
unsigned long long ossim_uint64
unsigned int ossim_uint32
32 bit normalized floating point
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
~ossimNitfCommon()
destructor
OSSIM_DLL ossim_uint32 scalarSizeInBytes(ossimScalarType scalarType)
ossim_uint32 width() const
OSSIM_DLL ossim_uint32 getBitsPerPixel(ossimScalarType scalarType)
Get bits per pixel for a given scalar type.
static ossimString convertToUIntString(ossim_uint32 aValue, ossim_uint32 size)
This method takes a value and converts to a string of size with with a '0' fill.
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
static ossimString encodeGeographicDms(const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
static ossimString convertToIntString(ossim_int32 aValue, ossim_uint32 size)
Just like convertToUIntString only takes a signed value.
static ossimString encodeGeographicDecimalDegrees(const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimString toString(const ossimString &formatString=ossimString("")) const
You can specify a number of different formats.
16 bit unsigned integer (12 bits used)