| 92 | {} |
| 93 | |
| 94 | void 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 | |
| 115 | void SlpkInterface::unarchive() |