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

Method initInfo

io/SlpkReader.cpp:94–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92{}
93
94void SlpkInterface::initInfo()
95{
96 // un-archive the slpk archive
97 unarchive();
98
99 size_t fileSize = FileUtils::fileSize(m_filename);
100 if (fileSize == 0)
101 throw pdal_error("Empty or invalid SLPK file '" + m_filename + "'.");
102 m_ctx = FileUtils::mapFile(m_filename, true, 0 , fileSize);
103 if (m_ctx.addr() == nullptr)
104 throw pdal_error("Error mapping file SLPK file '" + m_filename +
105 "': " + m_ctx.what() + ".");
106
107 std::string json = fetchJson("3dSceneLayer");
108 m_info = i3s::parse(json, "Invalid JSON in '3dSceneLayer.json.gz'.");
109
110 if (m_info.empty())
111 throw pdal_error(std::string("Incorrect Json object"));
112}
113
114
115void SlpkInterface::unarchive()

Callers

nothing calls this directly

Calls 6

mapFileFunction · 0.85
addrMethod · 0.80
fileSizeFunction · 0.50
parseFunction · 0.50
whatMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected