Skip to content

Commit

Permalink
wip, testing draco reader
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemann16 committed Jan 15, 2021
1 parent 4f75616 commit 3f86ab2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/draco/io/DracoWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ void DracoWriter::write(const PointViewPtr view)

void DracoWriter::done(PointTableRef table)
{

m_stream.reset();
}

} // namespace pdal
24 changes: 24 additions & 0 deletions plugins/draco/test/DracoReaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

#include "Support.hpp"

#include <pdal/PipelineManager.hpp>
#include "../io/DracoReader.hpp"
#include "../io/DracoWriter.hpp"

Expand Down Expand Up @@ -88,5 +89,28 @@ TEST(DracoReaderTest, test_sequential)

}

TEST(DracoReaderTest, accuracy)
{
//create pipeline that reads draco file and transforms it via
//filters.transformation. Then apply the offset from RTC_CENTER from
//the pnts file. Check that the results of this fall within the bounds of
//red-rocks.laz

// RTC_CENTER: [ -0.015410084428367554, -0.35363949998281896, 92.70944035355933 ]
PipelineManager pipeline;

Options readOptions;
std::string path = Support::datapath("draco/redrocks.drc");
Stage& reader = pipeline.makeReader(path, "readers.draco");

Options filterOptions;
filterOptions.add("matrix", "0.9649933973123795 -0.26227417551774335 0 0 0.16741023360918053 0.6159575938289551 0.7697857210207032 0 -0.20189491530603648 -0.742838138130328 0.6383023920624428 0 -1289846.4516338364 -4745771.507684133 4050624.605121021 1");
Stage& filter = pipeline.makeFilter("filters.transformation", reader);
filter.setOptions(filterOptions);

point_count_t count = pipeline.execute();
std::cout << "Point count " << count << std::endl;

}

}
6 changes: 1 addition & 5 deletions plugins/draco/test/DracoWriterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,10 @@ namespace pdal

writer.prepare(table);
writer.execute(table);
}

TEST_F(DracoWriterTest, compare)
{
std::string inFile = Support::datapath("las/1.2-with-color.las");
std::string outFile = Support::temppath("draco_test.drc");
compareFiles(inFile, outFile);
}

void testDimensions(NL::json dimensions, bool pass)
{
std::string inFile = Support::datapath("las/1.2-with-color.las");
Expand Down
Binary file added test/data/draco/red-rocks.laz
Binary file not shown.
Binary file added test/data/draco/redrocks.drc
Binary file not shown.

0 comments on commit 3f86ab2

Please sign in to comment.