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

Method createGrid

filters/HexBinFilter.cpp:192–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190
191
192bool HexBin::createGrid()
193{
194 try
195 {
196 if (m_grid->sampling())
197 {
198 // If we ran out of points while sampling, process the points in the sample buffer:
199 // in stream mode, we can't check this until we've gone through all the points
200 if (m_sampleSize > m_count)
201 {
202 m_grid->flushSamples();
203 // Setting this so it gets written to metadata correctly
204 m_sampleSize = m_count;
205 }
206 else
207 throwError("Sampling for hexbin auto-edge length calculation failed!");
208 }
209
210 m_grid->findShapes();
211 m_grid->findParentPaths();
212 }
213 catch (hexer::hexer_error& e)
214 {
215 m_metadata.add("error", e.what(),
216 "Hexer threw an error and was unable to compute a boundary");
217 m_metadata.add("boundary", "MULTIPOLYGON EMPTY",
218 "Empty polygon -- unable to compute boundary");
219 return false;
220 }
221 return true;
222}
223
224void HexBin::done(PointTableRef table)
225{

Callers

nothing calls this directly

Calls 5

flushSamplesMethod · 0.80
findShapesMethod · 0.80
findParentPathsMethod · 0.80
addMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected