Skip to content

Commit

Permalink
Eliminate some hardcoded values in SMRF (#3105)
Browse files Browse the repository at this point in the history
* Fix row/column calculation. (#3070)

Close #3069

* Track window size being set.
  • Loading branch information
abellgithub committed May 27, 2020
1 parent b985749 commit 1f00a7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 6 additions & 2 deletions filters/SMRFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ struct SMRArgs
std::vector<DimRange> m_ignored;
StringList m_returns;
Segmentation::PointClasses m_classbits;
Arg *m_windowArg;
};

SMRFilter::SMRFilter() : m_args(new SMRArgs) {}
Expand All @@ -106,7 +107,6 @@ void SMRFilter::addArgs(ProgramArgs& args)
{
args.add("cell", "Cell size?", m_args->m_cell, 1.0);
args.add("slope", "Percent slope?", m_args->m_slope, 0.15);
args.add("window", "Max window size?", m_args->m_window, 18.0);
args.add("scalar", "Elevation scalar?", m_args->m_scalar, 1.25);
args.add("threshold", "Elevation threshold?", m_args->m_threshold, 0.5);
args.add("cut", "Cut net size?", m_args->m_cut, 0.0);
Expand All @@ -116,6 +116,8 @@ void SMRFilter::addArgs(ProgramArgs& args)
{"last", "only"});
args.add("classbits", "Ignore synthetic|keypoint|withheld "
"classification bits?", m_args->m_classbits);
m_args->m_windowArg = &args.add("window", "Max window size?",
m_args->m_window);
}

void SMRFilter::addDimensions(PointLayoutPtr layout)
Expand Down Expand Up @@ -156,6 +158,8 @@ void SMRFilter::prepared(PointTableRef table)
m_args->m_returns.clear();
}
}
if (!m_args->m_windowArg->set())
m_args->m_window = 18 * m_args->m_cell;
}

void SMRFilter::ready(PointTableRef table)
Expand Down Expand Up @@ -389,7 +393,7 @@ std::vector<int> SMRFilter::createLowMask(std::vector<double> const& ZImin)
std::vector<double> negZImin;
std::transform(ZImin.begin(), ZImin.end(), std::back_inserter(negZImin),
[](double v) { return -v; });
std::vector<int> LowV = progressiveFilter(negZImin, 5.0, 1.0);
std::vector<int> LowV = progressiveFilter(negZImin, 5.0, m_args->m_cell);

if (!m_args->m_dir.empty())
{
Expand Down
2 changes: 0 additions & 2 deletions io/EptReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ void EptReader::initialize()
{
throwError(e.what());
}
debug << "Got EPT info" << std::endl;
debug << "SRS: " << m_info->srs() << std::endl;

setSpatialReference(m_info->srs());

Expand Down

0 comments on commit 1f00a7e

Please sign in to comment.