Skip to content

Commit

Permalink
rename filters.expresion -> filters.mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Nov 5, 2018
1 parent f3b7c4e commit 2c9fc8a
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 61 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _filters.expression:
.. _filters.mongoexpression:

filters.expression
filters.emongoxpression
==================

.. contents::
Expand Down
4 changes: 4 additions & 0 deletions doc/stages/filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ the input. These filters will invalidate an existing KD-tree.
filters.iqr
filters.locate
filters.mad
filters.mongoexpression
filters.range
filters.sample
filters.tail
Expand All @@ -221,6 +222,9 @@ the input. These filters will invalidate an existing KD-tree.
Cull points falling outside the computed Median Absolute Deviation for a
given dimension.

:ref:`filters.mongoexpression`
Cull points using MongoDB-style expression syntax.

:ref:`filters.range`
Pass only points given a dimension/range.

Expand Down
22 changes: 11 additions & 11 deletions filters/ExpressionFilter.cpp → filters/MongoExpressionFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,39 @@
* OF SUCH DAMAGE.
****************************************************************************/

#include "ExpressionFilter.hpp"
#include "MongoExpressionFilter.hpp"

#include "private/expression/Expression.hpp"
#include "private/mongoexpression/Expression.hpp"

namespace pdal
{

static const StaticPluginInfo s_info
{
"filters.expression",
"filters.mongo",
"Pass only points that pass a logic filter.",
"http://pdal.io/stages/filters.logic.html"
};

CREATE_STATIC_STAGE(ExpressionFilter, s_info);
CREATE_STATIC_STAGE(MongoExpressionFilter, s_info);

std::string ExpressionFilter::getName() const
std::string MongoExpressionFilter::getName() const
{
return s_info.name;
}

ExpressionFilter::ExpressionFilter()
MongoExpressionFilter::MongoExpressionFilter()
{}

ExpressionFilter::~ExpressionFilter()
MongoExpressionFilter::~MongoExpressionFilter()
{}

void ExpressionFilter::addArgs(ProgramArgs& args)
void MongoExpressionFilter::addArgs(ProgramArgs& args)
{
args.add("expression", "Logical query expression", m_json).setPositional();
}

void ExpressionFilter::prepared(PointTableRef table)
void MongoExpressionFilter::prepared(PointTableRef table)
{
log()->get(LogLevel::Debug) << "Building expression from: " << m_json <<
std::endl;
Expand All @@ -75,7 +75,7 @@ void ExpressionFilter::prepared(PointTableRef table)
std::endl;
}

PointViewSet ExpressionFilter::run(PointViewPtr inView)
PointViewSet MongoExpressionFilter::run(PointViewPtr inView)
{
PointViewSet views;
PointViewPtr view(inView->makeNew());
Expand All @@ -93,7 +93,7 @@ PointViewSet ExpressionFilter::run(PointViewPtr inView)
return views;
}

bool ExpressionFilter::processOne(PointRef& pr)
bool MongoExpressionFilter::processOne(PointRef& pr)
{
return m_expression->check(pr);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ namespace pdal

class Expression;

class PDAL_DLL ExpressionFilter : public Filter, public Streamable
class PDAL_DLL MongoExpressionFilter : public Filter, public Streamable
{
public:
ExpressionFilter();
~ExpressionFilter();
MongoExpressionFilter();
~MongoExpressionFilter();

std::string getName() const override;
virtual bool processOne(PointRef& point) override;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
58 changes: 29 additions & 29 deletions scripts/conda/osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@ export CONDA_EXE=/Users/hobu/miniconda3/bin/conda
source /Users/hobu/miniconda3/bin/activate base


$CONDA_EXE remove pdal
$CONDA_EXE activate pdal
# $CONDA_EXE remove pdal
# $CONDA_EXE activate pdal
source /Users/hobu/miniconda3/bin/activate pdal
$CONDA_EXE config --add channels conda-forge
$CONDA_EXE create --name pdal -y
$CONDA_EXE install -y laz-perf \
laszip \
libunwind \
geotiff \
jsoncpp \
sqlite \
libxml2 \
nitro \
curl \
gdal=2.3.2 \
postgresql \
hdf5 \
pcl \
cmake \
clang_osx-64 \
clangxx_osx-64 \
libspatialite \
eigen \
ninja \
libgdal \
geos \
zstd \
python=3.7 \
numpy
#
# $CONDA_EXE config --add channels conda-forge
# $CONDA_EXE create --name pdal -y
# $CONDA_EXE install -y laz-perf \
# laszip \
# libunwind \
# geotiff \
# jsoncpp \
# sqlite \
# libxml2 \
# nitro \
# curl \
# gdal=2.3.2 \
# postgresql \
# hdf5 \
# pcl \
# cmake \
# clang_osx-64 \
# clangxx_osx-64 \
# libspatialite \
# eigen \
# ninja \
# libgdal \
# geos \
# zstd \
# python=3.7 \
# numpy
# #
BUILDDIR=conda-build

#export CC=/usr/bin/clang
Expand Down
4 changes: 2 additions & 2 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ PDAL_ADD_TEST(pdal_filters_crop_test
PDAL_ADD_TEST(pdal_filters_decimation_test FILES
filters/DecimationFilterTest.cpp)
PDAL_ADD_TEST(pdal_filters_divider_test FILES filters/DividerFilterTest.cpp)
PDAL_ADD_TEST(pdal_filters_expression_test
PDAL_ADD_TEST(pdal_filters_mongoexpression_test
FILES
filters/ExpressionFilterTest.cpp
filters/MongoExpressionFilterTest.cpp
LINK_WITH
${PDAL_JSONCPP_LIB_NAME}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

#include <pdal/PointView.hpp>
#include <pdal/StageFactory.hpp>
#include <filters/ExpressionFilter.hpp>
#include <filters/MongoExpressionFilter.hpp>

using namespace pdal;

Expand All @@ -60,34 +60,34 @@ std::unique_ptr<FixedPointTable> makeTable()
return table;
}

std::unique_ptr<ExpressionFilter> makeFilter(BasePointTable& table,
std::unique_ptr<MongoExpressionFilter> makeFilter(BasePointTable& table,
Json::Value expression)
{
Options o;
o.add("expression", expression.toStyledString());
std::unique_ptr<ExpressionFilter> filter(new ExpressionFilter());
std::unique_ptr<MongoExpressionFilter> filter(new MongoExpressionFilter());
filter->setOptions(o);
filter->prepare(table);
return filter;
}

} // unnamed namespace

TEST(ExpressionFilterTest, createStage)
TEST(MongoExpressionFilterTest, createStage)
{
StageFactory f;
Stage* filter(f.createStage("filters.expression"));
Stage* filter(f.createStage("filters.mongo"));
EXPECT_TRUE(filter);
}

TEST(ExpressionFilterTest, noExpression)
TEST(MongoExpressionFilterTest, noExpression)
{
ExpressionFilter filter;
MongoExpressionFilter filter;
PointTable table;
EXPECT_THROW(filter.prepare(table), pdal_error);
}

TEST(ExpressionFilterTest, missingDimension)
TEST(MongoExpressionFilterTest, missingDimension)
{
auto table(makeTable());
PointRef pr(*table, 0);
Expand All @@ -107,7 +107,7 @@ TEST(ExpressionFilterTest, missingDimension)
}
}

TEST(ExpressionFilterTest, invalidSingleComparisons)
TEST(MongoExpressionFilterTest, invalidSingleComparisons)
{
auto table(makeTable());
PointRef pr(*table, 0);
Expand All @@ -127,7 +127,7 @@ TEST(ExpressionFilterTest, invalidSingleComparisons)
}
}

TEST(ExpressionFilterTest, singleComparisons)
TEST(MongoExpressionFilterTest, singleComparisons)
{
auto table(makeTable());
PointRef pr(*table, 0);
Expand Down Expand Up @@ -338,7 +338,7 @@ TEST(ExpressionFilterTest, singleComparisons)
}
}

TEST(ExpressionFilterTest, inValidMultiComparisons)
TEST(MongoExpressionFilterTest, inValidMultiComparisons)
{
auto table(makeTable());
PointRef pr(*table, 0);
Expand All @@ -363,7 +363,7 @@ TEST(ExpressionFilterTest, inValidMultiComparisons)
}
}

TEST(ExpressionFilterTest, multiComparisons)
TEST(MongoExpressionFilterTest, multiComparisons)
{
auto table(makeTable());
PointRef pr(*table, 0);
Expand Down Expand Up @@ -445,7 +445,7 @@ TEST(ExpressionFilterTest, multiComparisons)
}
}

TEST(ExpressionFilterTest, invalidLogicalOperators)
TEST(MongoExpressionFilterTest, invalidLogicalOperators)
{
auto table(makeTable());
PointRef pr(*table, 0);
Expand Down Expand Up @@ -494,7 +494,7 @@ TEST(ExpressionFilterTest, invalidLogicalOperators)
}
}

TEST(ExpressionFilterTest, logicalOperators)
TEST(MongoExpressionFilterTest, logicalOperators)
{
auto table(makeTable());
PointRef pr(*table, 0);
Expand Down

0 comments on commit 2c9fc8a

Please sign in to comment.