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

Method finalize

io/private/GDALGrid.cpp:506–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504
505
506void GDALGrid::finalize()
507{
508 // See
509 // https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
510 // https://en.wikipedia.org/wiki/Inverse_distance_weighting
511 if (m_stdDev)
512 for (size_t i = 0; i < m_count->size(); ++i)
513 if (!empty(i))
514 (*m_stdDev)[i] = sqrt((*m_stdDev)[i] / (*m_count)[i]);
515
516 if (m_idw)
517 for (size_t i = 0; i < m_count->size(); ++i)
518 if (!empty(i))
519 {
520 double& distSum = (*m_idwDist)[i];
521 if (!std::isnan(distSum))
522 (*m_idw)[i] /= distSum;
523 }
524
525 if (m_pctls.size())
526 for (auto& it : m_valBins)
527 {
528 size_t idx = it.first;
529 if (!empty(idx))
530 fillPercentiles(idx, it.second);
531 }
532
533 if (m_windowSize > 0)
534 windowFill();
535 else
536 {
537 for (int i = 0; i < m_count->width(); ++i)
538 for (int j = 0; j < m_count->height(); ++j)
539 if (empty(i, j))
540 fillNodata(i, j);
541 }
542}
543
544
545void GDALGrid::fillNodata(int i, int j)

Callers 3

inspectMethod · 0.45
doneFileMethod · 0.45
initializeMethod · 0.45

Calls 4

emptyFunction · 0.50
sizeMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected