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

Method initialize

plugins/spz/io/SpzReader.cpp:68–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void SpzReader::initialize()
69{
70 // copy the file to local if it's remote
71 m_isRemote = Utils::isRemote(m_filename);
72 if (m_isRemote)
73 {
74 std::string remoteFilename = Utils::tempFilename(m_filename);
75 // swap m_filename to temp file, remoteFilename to original
76 std::swap(remoteFilename, m_filename);
77
78 arbiter::Arbiter a;
79 a.put(m_filename, a.getBinary(remoteFilename));
80 }
81
82 ILeStream stream(m_filename);
83 if (!stream)
84 throwError("Unable to open file '" + m_filename + "'");
85 stream.seek(0, std::ios::end);
86 std::vector<uint8_t> data(stream.position());
87 stream.seek(0, std::ios::beg);
88 stream.get(reinterpret_cast<char *>(data.data()), data.size());
89 stream.close();
90
91 m_data.reset(new spz::PackedGaussians(spz::loadSpzPacked(data)));
92
93 extractHeaderData();
94}
95
96void SpzReader::addDimensions(PointLayoutPtr layout)
97{

Callers

nothing calls this directly

Calls 12

isRemoteFunction · 0.85
tempFilenameFunction · 0.85
swapFunction · 0.85
getBinaryMethod · 0.80
putMethod · 0.45
seekMethod · 0.45
positionMethod · 0.45
getMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
closeMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected