MCPcopy Create free account
hub / github.com/PDAL/PDAL / initialize

Method initialize

plugins/hdf/io/Hdf5Handler.cpp:50–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49
50void Handler::initialize(
51 const std::string& filename,
52 const std::map<std::string,std::string>& map)
53{
54 try
55 {
56 m_h5File.reset(new H5::H5File(filename, H5F_ACC_RDONLY));
57 }
58 catch (const H5::FileIException&)
59 {
60 throw pdal_error("Could not open HDF5 file '" + filename + "'.");
61 }
62
63 // Create our vector of dimensions and associated data
64 for( auto const& entry : map) {
65 std::string const& dimName = entry.first;
66 std::string const& datasetName = entry.second;
67 m_dimInfos.emplace_back(DimInfo(dimName, datasetName, m_h5File.get()));
68 }
69
70 // Check that all dimensions have equal lengths
71 m_numPoints = m_dimInfos.at(0).getNumPoints();
72 for( DimInfo& info : m_dimInfos) {
73 if(m_numPoints != info.getNumPoints()) {
74 throw pdal_error("All given datasets must have the same length");
75 }
76 }
77}
78
79
80void Handler::close()

Callers

nothing calls this directly

Calls 5

atMethod · 0.80
DimInfoClass · 0.70
resetMethod · 0.45
getMethod · 0.45
getNumPointsMethod · 0.45

Tested by

no test coverage detected