Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Mar 30, 2018
2 parents a577b70 + 67950cf commit e938d5c
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 17 deletions.
5 changes: 4 additions & 1 deletion io/BpfReader.cpp
Expand Up @@ -308,6 +308,9 @@ void BpfReader::done(PointTableRef)

bool BpfReader::processOne(PointRef& point)
{
if (eof() || m_index >= m_count)
return false;

switch (m_header.m_pointFormat)
{
case BpfFormat::PointMajor:
Expand All @@ -320,7 +323,7 @@ bool BpfReader::processOne(PointRef& point)
readByteMajor(point);
break;
}
return !eof() && (m_index < m_count);
return true;
}


Expand Down
6 changes: 6 additions & 0 deletions pdal/Stage.hpp
Expand Up @@ -123,6 +123,12 @@ class PDAL_DLL Stage
*/
PointViewSet execute(PointTableRef table);

virtual void execute(StreamPointTable& table)
{
throw pdal_error("Attempting to use stream mode with a non-streamable "
"stage.");
}

/**
Determine if a pipeline with this stage as a sink is streamable.
Expand Down
3 changes: 2 additions & 1 deletion pdal/Streamable.cpp
Expand Up @@ -98,7 +98,8 @@ void Streamable::execute(StreamPointTable& table)
};

if (!pipelineStreamable())
return;
throwError("Attempting to use stream mode with a stage that doesn't "
"support streaming.");

SpatialReference srs;
std::list<StreamableList> lists;
Expand Down
2 changes: 1 addition & 1 deletion pdal/Streamable.hpp
Expand Up @@ -61,7 +61,7 @@ class PDAL_DLL Streamable : public virtual Stage
the same \ref table used in the \ref prepare function.
*/
void execute(StreamPointTable& table);
virtual void execute(StreamPointTable& table);
using Stage::execute;

/**
Expand Down
5 changes: 1 addition & 4 deletions plugins/nitf/io/NitfWriter.cpp
Expand Up @@ -102,9 +102,6 @@ void NitfWriter::addArgs(ProgramArgs& args)

void NitfWriter::writeView(const PointViewPtr view)
{
//ABELL - Think we can just get this from the LAS file header
// when we're done.
view->calculateBounds(m_bounds);
LasWriter::writeView(view);
}

Expand All @@ -131,7 +128,7 @@ void NitfWriter::doneFile()
buf->sgetn(bytes.data(), size);
m_oss.clear();
m_nitf.wrapData(bytes.data(), size);
m_nitf.setBounds(reprojectBoxToDD(m_srs, m_bounds));
m_nitf.setBounds(reprojectBoxToDD(m_srs, m_lasHeader.getBounds()));

try
{
Expand Down
3 changes: 2 additions & 1 deletion plugins/nitf/io/tre_plugins.hpp
Expand Up @@ -42,9 +42,10 @@

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wredundant-decls"
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wcast-qual"
#pragma GCC diagnostic ignored "-Wunused-private-field"

#include <nitro/c++/import/nitf.hpp>

Expand Down
2 changes: 1 addition & 1 deletion test/unit/filters/CropFilterTest.cpp
Expand Up @@ -267,7 +267,7 @@ TEST(CropFilterTest, stream)
table.layout()->registerDim(Id::Y);
table.layout()->registerDim(Id::Z);

class StreamReader : public Reader
class StreamReader : public Reader, public Streamable
{
public:
std::string getName() const
Expand Down
14 changes: 7 additions & 7 deletions test/unit/io/BPFTest.cpp
Expand Up @@ -117,13 +117,13 @@ void test_file_type_view(const std::string& filename)

PtData pts[3] = { {494915.25f, 4878096.5f, 128.220001f},
{494917.062f, 4878124.5f, 128.539993f},
{494920.781f, 4877914.5f, 127.43f} };
{494920.781f, 4877914.5f, 127.42999f} };

for (int i = 503; i < 3; ++i)
for (int i = 0; i < 3; ++i)
{
float x = view->getFieldAs<float>(Dimension::Id::X, i);
float y = view->getFieldAs<float>(Dimension::Id::Y, i);
float z = view->getFieldAs<float>(Dimension::Id::Z, i);
float x = view->getFieldAs<float>(Dimension::Id::X, 503 + i);
float y = view->getFieldAs<float>(Dimension::Id::Y, 503 + i);
float z = view->getFieldAs<float>(Dimension::Id::Z, 503 + i);

EXPECT_FLOAT_EQ(x, pts[i].x);
EXPECT_FLOAT_EQ(y, pts[i].y);
Expand All @@ -133,7 +133,7 @@ void test_file_type_view(const std::string& filename)

void test_file_type_stream(const std::string& filename)
{
class Checker : public Filter
class Checker : public Filter, public Streamable
{
public:
Checker() : m_cnt(0)
Expand All @@ -157,7 +157,7 @@ void test_file_type_stream(const std::string& filename)

PtData pts503[3] = { {494915.25f, 4878096.5f, 128.220001f},
{494917.062f, 4878124.5f, 128.539993f},
{494920.781f, 4877914.5f, 127.43f} };
{494920.781f, 4877914.5f, 127.42999f} };

PtData d;

Expand Down
2 changes: 1 addition & 1 deletion test/unit/io/PlyReaderTest.cpp
Expand Up @@ -132,7 +132,7 @@ TEST(PlyReader, ReadBinary)

TEST(PlyReader, ReadBinaryStream)
{
class Checker : public Filter
class Checker : public Filter, public Streamable
{
public:
std::string getName() const
Expand Down

0 comments on commit e938d5c

Please sign in to comment.