39 static ossimTrace traceDebug(
"ossimH5Util:debug");
45 std::string groupName =
"/";
46 std::string prefix =
"hdf5";
49 std::vector<std::string> datasetNames;
57 for(;datasetNameIdx<datasetNames.size();++datasetNameIdx)
59 if(dataSetNamesStr.
empty())
61 dataSetNamesStr = datasetNames[datasetNameIdx];
65 dataSetNamesStr = dataSetNamesStr +
", " + datasetNames[datasetNameIdx];
68 if(!dataSetNamesStr.
empty())
70 out << prefix <<
".datasetnames: " << dataSetNamesStr <<
"\n";
80 const std::string& groupName,
81 const std::string& prefix,
85 if ( file && groupName.size() )
89 H5::Group* group =
new H5::Group( file->openGroup(groupName) );
93 for (
ossim_uint32 aIdx = 0; aIdx < ATTRS_COUNT; ++aIdx )
95 H5::Attribute attr( group->openAttribute( aIdx ) );
99 const hsize_t OBJ_COUNT = group->getNumObjs();
100 for ( hsize_t i = 0; i < OBJ_COUNT; ++i )
102 std::string objName = group->getObjnameByIdx(i);
104 if ( objName.size() )
106 char separator =
'/';
107 std::string combinedName;
108 combine( groupName, objName, separator, combinedName );
111 std::string combinedPrefix;
112 combine( prefix, objName, separator, combinedPrefix );
114 H5G_obj_t objType = group->getObjTypeByIdx(i);
117 std::cout <<
"combinedName: " << combinedName
118 <<
"\ncombinedPrefix: " << combinedPrefix
119 <<
"\ngetObjnameByIdx[" << i <<
"]: " << objName
120 <<
"\ngetObjTypeByIdx[" << i <<
"]: " << objType
124 if ( objType == H5G_GROUP )
130 file, combinedName, combinedPrefix, recursedCount, out );
135 <<
"ossim_hdf5::printIterative WARNING!" 136 <<
"\nMax iterations reached!" << std::endl;
139 else if ( objType == H5G_DATASET )
141 printObject( file, combinedName, combinedPrefix, out );
146 <<
"ossim_hdf5::printIterative WARNING!" 147 <<
"\nUnhandled object type: " << objType << std::endl;
162 const std::string& objectName,
163 const std::string& prefix,
167 std::cout <<
"printObject entered..." 168 <<
"\nobjectName: " << objectName
169 <<
"\nprefix: " << prefix
173 H5::DataSet dataset = file->openDataSet( objectName );
175 H5T_class_t type_class = dataset.getTypeClass();
176 out << prefix <<
".class_type: " 180 for (
ossim_uint32 aIdx = 0; aIdx < ATTRS_COUNT; ++aIdx )
182 H5::Attribute attr = dataset.openAttribute( aIdx );
195 H5::EnumType dataType = dataset.getEnumType();
202 out << prefix <<
".class_type: " 215 std::vector<ossim_uint32> extents;
220 std::string exStr =
".extent";
222 out << prefix << exStr <<
": " << extents[i] << std::endl;
230 H5::IntType dataType = dataset.getIntType();
231 bool isSigned = dataType.getSign() == H5T_SGN_NONE ? false :
true;
239 H5::FloatType dataType = dataset.getFloatType();
259 std::string byteOrderString =
"little_endian";
262 byteOrderString =
"big_endian";
265 << byteOrderString << std::endl;
271 int numberOfAttrs = dataset.getNumAttrs();
272 cout <<
"numberOfAttrs: " << numberOfAttrs << endl;
273 for (
ossim_int32 attrIdx = 0; attrIdx < numberOfAttrs; ++attrIdx )
275 H5::Attribute attribute = dataset.openAttribute( attrIdx );
276 cout <<
"attribute.from class: " << attribute.fromClass() << endl;
284 H5::EnumType& dataType,
285 const std::string& prefix,
291 if(dataType.getSize() == 4)
293 out << prefix <<
".class_type: H5T_ENUM\n";
294 for(;enumMemberIdx<nEnumMembers;++enumMemberIdx)
299 dataType.getMemberValue(enumMemberIdx, &value);
300 H5std_string name = dataType.nameOf(&value, 2048);
301 out << prefix <<
"." << name <<
": " <<value <<
"\n";
303 catch(H5::Exception& e)
311 H5::IntType& dataType,
313 const std::string& prefix,
319 bool isSigned = dataType.getSign() == H5T_SGN_NONE ? false :
true;
398 valueStr =
"<UNHANDLED SCALAR TYPE>";
402 out << prefix<<
": "<<valueStr<<
"\n";
406 H5::FloatType& dataType,
408 const std::string& prefix,
424 else if(floatSize == 8)
437 H5::StrType& dataType,
439 const std::string& prefix,
442 const char* startPtr = dataPtr;
443 const char* endPtr = dataPtr;
444 const char* maxPtr = dataPtr + dataType.getSize();
445 while((endPtr != maxPtr)&&(*endPtr!=
'\0')) ++endPtr;
447 out << prefix <<
": "<<value<<
"\n";
451 H5::ArrayType& dataType,
453 const std::string& prefix,
459 H5::DataType superType = dataType.getSuper();
463 std::vector<hsize_t> dims(arrayNdims);
464 dataType.getArrayDims(&dims.front());
471 std::copy(dims.begin(), --dims.end(),
472 std::ostream_iterator<hsize_t>(dimOut,
","));
473 for(;idx<dims.size();++idx)
475 nArrayElements*=dims[idx];
478 out << prefix <<
".dimensions: " << dimString <<
"\n";
480 switch(superType.getClass())
484 out<<prefix<<
".values: (";
485 const char* startPtr = 0;
486 const char* endPtr = 0;
490 for(idx=0;idx<nArrayElements;++idx)
492 mem = ((
const char*)dataPtr) + (idx * typeSize);
493 if(superType.isVariableStr())
495 startPtr = *(
char**) mem;
496 if(startPtr) strSize = std::strlen(startPtr);
507 for (; ((charIdx < strSize) && (*endPtr)); ++charIdx,++endPtr);
514 out <<
"\""<<value<<
"\"";
518 out <<
", \""<<value<<
"\"";
528 out<<prefix<<
".values: (";
529 for(idx=0;idx<nArrayElements;++idx)
538 if((idx + 1) <nArrayElements)
547 else if(typeSize == 4)
554 if((idx + 1) <nArrayElements)
570 out<<prefix<<
".values: (";
571 for(idx=0;idx<nArrayElements;++idx)
580 if((idx + 1) <nArrayElements)
589 else if(typeSize == 8)
596 if((idx + 1) <nArrayElements)
621 const std::string& prefix,
624 H5::CompType compound(dataset);
625 H5::DataSpace dataspace = dataset.getSpace();
626 ossim_uint32 dimensions = dataspace.getSimpleExtentNdims();
627 ossim_uint32 nElements = dataspace.getSimpleExtentNpoints();
632 H5::DataType compType = dataset.getDataType();
633 std::vector<char> compData(
size*nElements);
634 dataset.read((
void*)&compData.front(),compType);
635 char* compDataPtr = &compData.front();
642 for(;elementIdx<nElements;++elementIdx)
644 std::string elementPrefix = prefix;
646 for(memberIdx=0;memberIdx < nMembers;++memberIdx)
648 H5::DataType dataType = compound.getMemberDataType(memberIdx);
649 H5std_string memberName = compound.getMemberName(memberIdx);
650 ossim_uint32 memberOffset = compound.getMemberOffset(memberIdx) ;
651 std::string newPrefix = elementPrefix +
"."+ memberName;
652 switch(dataType.getClass())
661 H5::IntType dataType = compound.getMemberIntType(memberIdx);
667 H5::FloatType dataType = compound.getMemberFloatType(memberIdx);
674 H5::StrType dataType = compound.getMemberStrType(memberIdx);
680 out << newPrefix <<
": <H5T_BITFIELD NOT HANDLED>\n";
685 out << newPrefix <<
": <H5T_OPAQUE NOT HANDLED>\n";
690 out << newPrefix <<
": <H5T_REFERENCE NOT HANDLED>\n";
695 H5::EnumType dataType = compound.getMemberEnumType(memberIdx);
701 out << newPrefix <<
": <H5T_VLEN NOT HANDLED>\n";
706 H5::ArrayType dataType = compound.getMemberArrayType(memberIdx);
713 out<< newPrefix <<
".class_type: " 715 out << newPrefix <<
": <NOT HANDLED>\n";
726 const std::string& group,
727 const std::string& key,
730 static const char MODULE[] =
"ossim_hdf5::getGroupAttributeValue";
739 H5::Group* h5Group =
new H5::Group( file->openGroup( group ) );
742 H5::Attribute attr = h5Group->openAttribute( key );
743 std::string name = attr.getName();
744 H5::DataType type = attr.getDataType();
745 H5T_class_t typeClass = attr.getTypeClass();
747 if ( ( name == key ) && ( typeClass == H5T_STRING ) )
749 attr.read( type, value );
759 catch(
const H5::Exception& e )
764 << MODULE <<
" WARNING: Caught exception!\n" 765 << e.getDetailMsg() << std::endl;
771 << MODULE <<
" WARNING: Caught unknown exception!" << std::endl;
780 const std::string& objectName,
781 const std::string& key,
784 static const char MODULE[] =
"ossim_hdf5::getDatasetAttributeValue";
793 H5::DataSet dataset = file->openDataSet( objectName );
796 H5::Attribute attr = dataset.openAttribute( key );
798 std::string name = attr.getName();
799 H5::DataType type = attr.getDataType();
800 H5T_class_t typeClass = attr.getTypeClass();
802 if ( ( name == key ) && ( typeClass == H5T_STRING ) )
804 attr.read( type, value );
812 catch(
const H5::Exception& e )
815 << MODULE <<
" WARNING: Caught exception!\n" 816 << e.getDetailMsg() << std::endl;
821 << MODULE <<
" WARNING: Caught unknown exception!" << std::endl;
830 const std::string& prefix,
833 std::string name = attr.getName();
834 H5::DataType type = attr.getDataType();
835 H5T_class_t typeClass = attr.getTypeClass();
836 size_t size = type.getSize();
840 if ( ( typeClass == H5T_INTEGER ) || ( typeClass == H5T_FLOAT ) )
843 if ( typeClass == H5T_INTEGER )
845 H5::IntType intType = attr.getIntType();
846 isSigned = intType.getSign() == H5T_SGN_NONE ? false :
true;
857 if ( typeClass == H5T_INTEGER )
866 attr.read( type, (
void*)&i );
876 attr.read( type, (
void*)&i );
886 attr.read( type, (
void*)&i );
900 attr.read( type, (
void*)&i );
914 attr.read( type, (
void*)&i );
928 attr.read( type, (
void*)&i );
942 attr.read( type, (
void*)&i );
956 attr.read( type, (
void*)&i );
969 else if ( typeClass == H5T_FLOAT )
976 attr.read( type, (
void*)&f );
989 attr.read( type, (
void*)&f );
1005 else if ( typeClass == H5T_STRING )
1007 attr.read( type, value );
1019 out << prefix <<
"." << name <<
": " << value << std::endl;
1026 const std::string& right,
1028 std::string& result )
1030 if ( left.size() && right.size() )
1033 if ( ( left[ left.size()-1 ] != separator ) && ( right[0] != separator ) )
1035 result.push_back(separator);
1042 std::vector<std::string>& datasetNames )
1044 datasetNames.clear();
1048 std::string groupName =
"/";
1052 std::vector<std::string>::const_iterator i = datasetNames.begin();
1053 while ( i != datasetNames.end() )
1055 std::cout <<
"dataset: " << (*i) << std::endl;
1064 H5T_class_t classType = (H5T_class_t)type;
1067 switch ( classType )
1070 result =
"H5T_INTEGER";
1073 result =
"H5T_FLOAT";
1076 result =
"H5T_TIME";
1079 result =
"H5T_STRING";
1082 result =
"H5T_BITFIELD";
1085 result =
"H5T_OPAQUE";
1088 result =
"H5T_COMPOUND";
1091 result =
"H5T_REFERENCE";
1094 result =
"H5T_ENUM";
1097 result =
"H5T_VLEN";
1100 result =
"H5T_ARRAY";
1104 result =
"H5T_NO_CLASS";
1112 bool result =
false;
1115 if ( file && datasetName.size() )
1119 H5::DataSet dataset = file->openDataSet( datasetName );
1122 H5T_class_t type_class = dataset.getTypeClass();
1126 if ( ( type_class == H5T_INTEGER ) || ( type_class == H5T_FLOAT ) )
1132 std::vector<ossim_uint32> extents;
1135 if ( extents.size() >= 2 )
1137 if ( ( extents[0] > 1 ) && ( extents[1] > 1 ) )
1156 bool ossim_hdf5::isExcludedDataset(
const std::string& datasetName )
1158 bool result =
false;
1163 if ( f !=
"Radiance" )
1170 if ( ( f ==
"Latitude" ) ||
1171 ( f ==
"Longitude" ) ||
1172 ( f ==
"SCAttitude" ) ||
1173 ( f ==
"SCPosition" ) ||
1174 ( f ==
"SCVelocity" ) )
1185 const std::string& groupName,
1186 std::vector<std::string>& datasetNames,
1189 if ( file && groupName.size() )
1195 H5::Group* group =
new H5::Group( file->openGroup(groupName) );
1197 const hsize_t OBJ_COUNT = group->getNumObjs();
1199 for ( hsize_t i = 0; i < OBJ_COUNT; ++i )
1201 std::string objName = group->getObjnameByIdx(i);
1203 if ( objName.size() )
1205 char separator =
'/';
1206 std::string combinedName;
1207 combine( groupName, objName, separator, combinedName );
1209 H5G_obj_t objType = group->getObjTypeByIdx(i);
1212 std::cout <<
"combinedName: " << combinedName
1213 <<
"\ngetObjnameByIdx[" << i <<
"]: " << objName
1214 <<
"\ngetObjTypeByIdx[" << i <<
"]: " << objType
1218 if ( objType == H5G_GROUP )
1224 file, combinedName, datasetNames, recursedCount );
1229 <<
"ossim_hdf5::iterateGroupForDatasetNames WARNING!" 1230 <<
"\nMax iterations reached!" << std::endl;
1233 else if ( objType == H5G_DATASET )
1235 datasetNames.push_back( combinedName );
1240 <<
"ossim_hdf5::iterateGroupForDatasetNames WARNING!" 1241 <<
"\nUnhandled object type: " << objType << std::endl;
1256 std::vector<ossim_uint32>& extents )
1263 H5::DataSpace dataspace = dataset->getSpace();
1266 int ndims = dataspace.getSimpleExtentNdims();
1270 std::vector<hsize_t> dims_out(ndims);
1271 dataspace.getSimpleExtentDims( &dims_out.front(), 0 );
1274 extents.push_back(static_cast<ossim_uint32>(dims_out[i]));
1292 if ( ( typeClass == H5T_INTEGER ) || ( typeClass == H5T_FLOAT ) )
1295 hid_t mem_type_id = H5Dget_type( dataset->getId() );
1299 if( mem_type_id > -1 )
1301 hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
1304 if( H5Tequal(H5T_NATIVE_CHAR, native_type) )
1308 else if ( H5Tequal( H5T_NATIVE_UCHAR, native_type) )
1312 else if( H5Tequal( H5T_NATIVE_SHORT, native_type) )
1316 else if(H5Tequal(H5T_NATIVE_USHORT, native_type))
1320 else if(H5Tequal( H5T_NATIVE_INT, native_type))
1324 else if(H5Tequal( H5T_NATIVE_UINT, native_type ) )
1328 else if(H5Tequal( H5T_NATIVE_LONG, native_type))
1332 else if(H5Tequal( H5T_NATIVE_ULONG, native_type))
1336 else if(H5Tequal( H5T_NATIVE_LLONG, native_type))
1340 else if(H5Tequal( H5T_NATIVE_ULLONG, native_type))
1344 else if(H5Tequal( H5T_NATIVE_FLOAT, native_type))
1348 else if(H5Tequal( H5T_NATIVE_DOUBLE, native_type))
1368 H5T_class_t h5tClassType = (H5T_class_t)typeClass;
1370 if ( h5tClassType == H5T_INTEGER )
1383 else if (
size == 2 )
1394 else if (
size == 4 )
1405 else if (
size == 8 )
1419 <<
"unhandled scalar size: " <<
size << endl;
1422 else if ( h5tClassType == H5T_FLOAT )
1436 <<
"unhandled type class: " << h5tClassType << endl;
1447 std::cout <<
"ossim_hdf5::getScalarType: entered...................\n";
1450 H5T_class_t type_class = H5Tget_class(
id);
1451 size_t size = H5Tget_size(
id);
1452 H5T_sign_t
sign = H5Tget_sign(
id);
1454 if ( type_class == H5T_INTEGER )
1456 if (
size == 1 &&
sign == H5T_SGN_2)
1460 else if (
size == 2 &&
sign == H5T_SGN_2)
1464 else if (
size == 4 &&
sign == H5T_SGN_2)
1468 else if (
size == 8 &&
sign == H5T_SGN_2)
1472 else if (
size == 1 &&
sign == H5T_SGN_NONE)
1476 else if (
size == 2 &&
sign == H5T_SGN_NONE)
1480 else if (
size == 4 &&
sign == H5T_SGN_NONE)
1484 else if (
size == 8 &&
sign == H5T_SGN_NONE)
1489 else if ( type_class == H5T_FLOAT )
1495 else if (
size == 8)
1511 const H5::AtomType* atomType =
dynamic_cast<const H5::AtomType*
>(dataType);
1515 H5T_order_t h5order = atomType->getOrder();
1517 if(h5order == H5T_ORDER_LE)
1521 else if(h5order == H5T_ORDER_BE)
1537 H5T_class_t typeClass = obj->getTypeClass();
1539 H5T_order_t order = H5T_ORDER_NONE;
1541 if ( typeClass == H5T_INTEGER )
1543 H5::IntType intype = obj->getIntType();
1544 order = intype.getOrder();
1546 else if ( typeClass == H5T_FLOAT )
1548 H5::FloatType floatType = obj->getFloatType();
1549 order = floatType.getOrder();
1552 if ( order == H5T_ORDER_LE )
1556 else if ( order == H5T_ORDER_BE )
1565 const std::string& name,
1568 bool result =
false;
1569 H5::DataSpace imageDataspace = dataset.getSpace();
1570 const ossim_int32 IN_DIM_COUNT = imageDataspace.getSimpleExtentNdims();
1572 if ( IN_DIM_COUNT == 2 )
1575 std::vector<hsize_t> dimsOut(IN_DIM_COUNT);
1576 imageDataspace.getSimpleExtentDims( &dimsOut.front(), 0 );
1578 if ( dimsOut[0] && dimsOut[1] )
1586 static_cast<ossim_int32>( dimsOut[1]-1 ),
1587 static_cast<ossim_int32>( dimsOut[0]-1 ) );
1591 std::vector<hsize_t> inputCount(IN_DIM_COUNT);
1592 std::vector<hsize_t> inputOffset(IN_DIM_COUNT);
1598 inputCount[1] = WIDTH;
1602 std::vector<hsize_t> outputCount(OUT_DIM_COUNT);
1605 outputCount[2] = WIDTH;
1608 std::vector<hsize_t> outputOffset(OUT_DIM_COUNT);
1609 outputOffset[0] = 0;
1610 outputOffset[1] = 0;
1611 outputOffset[2] = 0;
1624 H5::DataType datatype = dataset.getDataType();
1627 H5::DataSpace bufferDataSpace( OUT_DIM_COUNT, &outputCount.front());
1628 bufferDataSpace.selectHyperslab( H5S_SELECT_SET,
1629 &outputCount.front(),
1630 &outputOffset.front() );
1643 const ossim_float32 NULL_VALUE2 = ( name ==
"/All_Data/VIIRS-DNB-SDR_All/Radiance" )
1644 ? -1.5e-9 : NULL_VALUE;
1648 std::vector<ossim_float32> values( WIDTH );
1655 while ( ulIpt.
y <= rect.
lr().
y )
1657 inputOffset[0] =
static_cast<hsize_t
>(ulIpt.
y);
1658 imageDataspace.selectHyperslab( H5S_SELECT_SET,
1659 &inputCount.front(),
1660 &inputOffset.front() );
1663 dataset.read( (
void*)&values.front(), datatype, bufferDataSpace, imageDataspace );
1668 endian->
swap( scalar, (
void*)&values.front(), WIDTH );
1672 ulIpt.
x = rect.
ul().
x;
1674 while ( ulIpt.
x <= rect.
lr().
x )
1677 ( values[index] > NULL_VALUE ) )
1701 while ( lrIpt.
y >= rect.
ul().
y )
1703 inputOffset[0] =
static_cast<hsize_t
>(lrIpt.
y);
1704 imageDataspace.selectHyperslab( H5S_SELECT_SET,
1705 &inputCount.front(),
1706 &inputOffset.front() );
1709 dataset.read( (
void*)&values.front(), datatype, bufferDataSpace, imageDataspace );
1714 endian->
swap( scalar, (
void*)&values.front(), WIDTH );
1718 lrIpt.
x = rect.
lr().
x;
1721 while ( lrIpt.
x >= rect.
ul().
x )
1724 ( values[index] > NULL_VALUE ) )
1758 <<
"ossim_hdf5::getBoundingRect WARNING!" 1759 <<
"\nUnhandled scalar type: " 1768 imageDataspace.close();
1776 bool result =
false;
1778 H5::DataSpace dataspace = dataset.getSpace();
1781 const ossim_int32 DIM_COUNT = dataspace.getSimpleExtentNdims();
1783 if ( DIM_COUNT == 2 )
1789 std::vector<hsize_t> dimsOut(DIM_COUNT);
1790 dataspace.getSimpleExtentDims( &dimsOut.front(), 0 );
1792 if ( (ROWS <= dimsOut[0]) && (COLS <= dimsOut[1]) )
1794 std::vector<hsize_t> inputCount(DIM_COUNT);
1795 std::vector<hsize_t> inputOffset(DIM_COUNT);
1798 inputCount[1] = COLS;
1802 std::vector<hsize_t> outputCount(OUT_DIM_COUNT);
1805 outputCount[2] = COLS;
1808 std::vector<hsize_t> outputOffset(OUT_DIM_COUNT);
1809 outputOffset[0] = 0;
1810 outputOffset[1] = 0;
1811 outputOffset[2] = 0;
1824 H5::DataType datatype = dataset.getDataType();
1827 H5::DataSpace bufferDataSpace( OUT_DIM_COUNT, &outputCount.front());
1828 bufferDataSpace.selectHyperslab( H5S_SELECT_SET,
1829 &outputCount.front(),
1830 &outputOffset.front() );
1839 std::vector<ossim_float32> lineBuffer(validRect.
width());
1842 inputOffset[0] =
static_cast<hsize_t
>(validRect.
ul().
y);
1843 inputOffset[1] =
static_cast<hsize_t
>(validRect.
ul().
x);
1844 dataspace.selectHyperslab( H5S_SELECT_SET,
1845 &inputCount.front(),
1846 &inputOffset.front() );
1847 dataset.read( &(lineBuffer.front()), datatype, bufferDataSpace, dataspace );
1852 endian->
swap( &(lineBuffer.front()), COLS );
1861 inputOffset[0] =
static_cast<hsize_t
>(validRect.
ll().
y);
1862 inputOffset[1] =
static_cast<hsize_t
>(validRect.
ll().
x);
1863 dataspace.selectHyperslab( H5S_SELECT_SET,
1864 &inputCount.front(),
1865 &inputOffset.front() );
1866 dataset.read( &(lineBuffer.front()), datatype, bufferDataSpace, dataspace );
1880 <<
"ossim_hdf5::crossesDateline WARNING!" 1881 <<
"\nUnhandled scalar type: " 1898 bool result =
false;
1901 bool found179 =
false;
1902 bool found181 =
false;
1911 if ( longitude == 179 )
1919 if ( longitude == 178 )
1923 else if ( longitude == -179 )
1933 if ( longitude == -179 )
1941 if ( longitude == -178 )
1945 else if ( longitude == 179 )
1958 H5::DataSet& latDataSet, H5::DataSet& lonDataSet,
const ossimIrect& validRect )
1963 H5::DataSpace latDataSpace = latDataSet.getSpace();
1964 H5::DataSpace lonDataSpace = lonDataSet.getSpace();
1967 const ossim_int32 DIM_COUNT = latDataSpace.getSimpleExtentNdims();
1969 if ( DIM_COUNT == 2 )
1972 std::vector<hsize_t> dimsOut(DIM_COUNT);
1973 latDataSpace.getSimpleExtentDims( &dimsOut.front(), 0 );
1975 if ( dimsOut[0] && dimsOut[1] )
1977 std::vector<hsize_t> inputCount(DIM_COUNT);
1978 std::vector<hsize_t> inputOffset(DIM_COUNT);
1988 std::vector<hsize_t> outputCount(OUT_DIM_COUNT);
1994 std::vector<hsize_t> outputOffset(OUT_DIM_COUNT);
1995 outputOffset[0] = 0;
1996 outputOffset[1] = 0;
1997 outputOffset[2] = 0;
2010 H5::DataType latDataType = latDataSet.getDataType();
2011 H5::DataType lonDataType = lonDataSet.getDataType();
2013 std::vector<ossimDpt> ipts;
2014 std::vector<ossimGpt> gpts;
2023 H5::DataSpace bufferDataSpace( OUT_DIM_COUNT, &outputCount.front());
2024 bufferDataSpace.selectHyperslab( H5S_SELECT_SET,
2025 &outputCount.front(),
2026 &outputOffset.front() );
2039 while ( ipt.
y <= validRect.
lr().
y )
2041 inputOffset[0] =
static_cast<hsize_t
>(ipt.
y);
2044 ipt.
x = validRect.
ul().
x;
2045 while ( ipt.
x <= validRect.
lr().
x )
2047 inputOffset[1] =
static_cast<hsize_t
>(ipt.
x);
2049 latDataSpace.selectHyperslab( H5S_SELECT_SET,
2050 &inputCount.front(),
2051 &inputOffset.front() );
2052 lonDataSpace.selectHyperslab( H5S_SELECT_SET,
2053 &inputCount.front(),
2054 &inputOffset.front() );
2057 latDataSet.read( &latValue, latDataType, bufferDataSpace, latDataSpace );
2058 lonDataSet.read( &lonValue, lonDataType, bufferDataSpace, lonDataSpace );
2063 endian->
swap( latValue );
2064 endian->
swap( lonValue );
2067 if ( ( latValue > NULL_VALUE ) && ( lonValue > NULL_VALUE ) )
2071 gpts.push_back( gpt );
2075 ipts.push_back( shiftedIpt );
2079 if ( ipt.
x < validRect.
lr().
x )
2082 if ( ipt.
x > validRect.
lr().
x )
2084 ipt.
x = validRect.
lr().
x;
2094 if ( ipt.
y < validRect.
lr().
y )
2097 if ( ipt.
y > validRect.
lr().
y )
2099 ipt.
y = validRect.
lr().
y;
2131 <<
"ossim_hdf5::getBilinearProjection WARNING!" 2132 <<
"\nUnhandled scalar type: " 2141 latDataSpace.close();
2142 lonDataSpace.close();
void printCompound(H5::DataSet &dataset, const std::string &prefix, std::ostream &out)
Prints a compound object.
static const char * BYTE_ORDER_KW
char ossim_int8
Previous DLL import export section.
std::basic_stringstream< char > stringstream
Class for char mixed input and output memory streams.
Real sign(Real x, Real y)
virtual ossimString getEntryString(ossim_int32 entry_number) const
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
void combine(const std::string &left, const std::string &right, char separator, std::string &result)
ossim_uint32 height() const
static ossimString toString(bool aValue)
Numeric to string methods.
ossimScalarType getScalarType(const H5::DataSet *dataset)
void printIntType(H5::DataSet &dataset, H5::IntType &dataType, const char *dataPtr, const std::string &prefix, std::ostream &out)
const ossimIpt & ul() const
static ossimH5Options * instance()
OSSIM_DLL ossimByteOrder byteOrder()
bool isLoadableAsImage(H5::H5File *file, const std::string &datasetName)
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
void printIterative(H5::H5File *file, const std::string &groupName, const std::string &prefix, ossim_uint32 &recursedCount, std::ostream &out)
Iterative print method.
unsigned short ossim_uint16
void printFloatType(H5::DataSet &dataset, H5::FloatType &dataType, const char *dataPtr, const std::string &prefix, std::ostream &out)
const ossimIpt & ll() const
void printAttribute(const H5::Attribute &attr, const std::string &prefix, std::ostream &out)
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
OSSIM_DLL bool isSigned(ossimScalarType scalarType)
signed short ossim_sint16
bool getDatasetAttributeValue(H5::H5File *file, const std::string &objectName, const std::string &key, std::string &value)
Gets string value for attribute key.
void printStrType(H5::DataSet &dataset, H5::StrType &dataType, const char *dataPtr, const std::string &prefix, std::ostream &out)
unsigned long long ossim_uint64
unsigned int ossim_uint32
void iterateGroupForDatasetNames(H5::H5File *file, const std::string &group, std::vector< std::string > &names, ossim_uint32 &recursedCount)
void printEnumType(H5::DataSet &dataset, H5::EnumType &dataType, const std::string &prefix, std::ostream &out)
OSSIM_DLL ossim_uint32 scalarSizeInBytes(ossimScalarType scalarType)
const ossimIpt & lr() const
virtual ossim_float64 setTiePoints(const std::vector< ossimDpt > &lsPt, const std::vector< ossimGpt > &geoPt)
ossim_uint32 width() const
ossimByteOrder getByteOrder(const H5::AbstractDs *dataset)
bool getValidBoundingRect(H5::DataSet &dataset, const std::string &name, ossimIrect &rect)
Gets the valid bounding rect of the dataset excluding nulls on front and back.
void printArrayType(H5::DataSet &dataset, H5::ArrayType &dataType, const char *dataPtr, const std::string &prefix, std::ostream &out)
bool getGroupAttributeValue(H5::H5File *file, const std::string &group, const std::string &key, std::string &value)
Gets string value for attribute key.
ossimRefPtr< ossimProjection > getBilinearProjection(H5::DataSet &latDataSet, H5::DataSet &lonDataSet, const ossimIrect &validRect)
Gets bilinear projection from Latitude, Longitude layer.
void getExtents(const H5::DataSet *dataset, std::vector< ossim_uint32 > &extents)
static const char * SCALAR_TYPE_KW
bool isDatasetRenderable(const std::string &datasetName) const
ossimFilename file() const
void getDatasetNames(H5::H5File *file, std::vector< std::string > &names)
bool crossesDateline(H5::DataSet &dataset, const ossimIrect &validRect)
Checks for dateline cross.
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void printObject(H5::H5File *file, const std::string &objectName, const std::string &prefix, std::ostream &out)
Prints an object.
std::basic_ostream< char > ostream
Base class for char output streams.
std::string getDatatypeClassType(ossim_int32 type)
const std::string & string() const