Skip to content

Points lost when where_merge is true and filter returns no points #4572

@tom-neara

Description

@tom-neara

Describe the bug

In StageRunner.cpp there's this code:

    if (m_stage->mergeMode() == Filter::WhereMergeMode::True)
    {
        if (m_viewSet.size())
            (*m_viewSet.begin())->append(*m_skips);
                return;
    }

At a glance this looks like the return is always executed after the call to append, but in reality it should be indented like this:

    if (m_stage->mergeMode() == Filter::WhereMergeMode::True)
    {
        if (m_viewSet.size())
            (*m_viewSet.begin())->append(*m_skips);
        return;
    }

Because of the way it is written, a filters.outlier with a where clause that matches 0 points and "where_merge": true will return an empty ViewSet, which will result in an empty view set being passed to all subsequent filters.

See the early return code in filters.outlier:

    PointViewSet viewSet;
    if (!inView->size())
        return viewSet;

Expected behavior
I'm not sure if the bug is in filters.outlier or StageRunner.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions