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

Method initialize

io/EsriReader.cpp:144–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142
143
144void EsriReader::initialize(PointTableRef table)
145{
146 //create proper density if min was set but max wasn't
147 if (m_args->min_density >= 0 && m_args->max_density < 0)
148 m_args->max_density = (std::numeric_limits<double>::max)();
149
150 m_pool.reset(new ThreadPool(m_args->threads));
151
152 for (std::string& s : m_args->dimensions)
153 s = Utils::toupper(s);
154
155 //adjust filename string
156 const std::string pre("i3s://");
157 if (Utils::startsWith(m_filename, pre))
158 m_filename = m_filename.substr(pre.size());
159
160 if (m_filename.back() == '/')
161 m_filename.pop_back();
162
163 log()->get(LogLevel::Debug) << "Fetching info from " << m_filename <<
164 std::endl;
165
166 //personalize for slpk or i3s
167 try
168 {
169 m_interface->initInfo();
170 }
171 catch (std::exception& e)
172 {
173 throwError(std::string("Failed to fetch info: ") + e.what());
174 }
175
176 //create const for looking into
177 const NL::json jsonBody = m_interface->getInfo();
178
179 //find version
180 if (jsonBody["store"].contains("version"))
181 {
182 std::string verName = jsonBody["store"]["version"].get<std::string>();
183 m_version = Version(verName);
184 }
185
186 if (m_version > Version("2.0") || m_version < Version("1.6"))
187 log()->get(LogLevel::Warning) << "This version may not work with "
188 "the current implementation of i3s/slpk reader" << std::endl;
189
190 //find number of nodes per nodepage
191 if (jsonBody["store"]["index"].contains("nodesPerPage"))
192 m_nodeCap = jsonBody["store"]["index"]["nodesPerPage"].get<int>();
193 else if (jsonBody["store"]["index"].contains("nodePerIndexBlock"))
194 m_nodeCap = jsonBody["store"]["index"]["nodePerIndexBlock"].get<int>();
195 else
196 {
197 log()->get(LogLevel::Warning) <<
198 "Number of nodes per page not specified. Default is 64." <<
199 std::endl;
200 m_nodeCap = 64;
201 }

Callers

nothing calls this directly

Calls 14

toupperFunction · 0.85
startsWithFunction · 0.85
VersionClass · 0.85
logFunction · 0.50
setSpatialReferenceFunction · 0.50
resetMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
initInfoMethod · 0.45
whatMethod · 0.45
getInfoMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected