Skip to content

Commit

Permalink
EPT update.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed May 6, 2020
1 parent 554898d commit 9f210e4
Show file tree
Hide file tree
Showing 13 changed files with 816 additions and 783 deletions.
2 changes: 1 addition & 1 deletion cmake/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ endif()
set(GOOGLETEST_VERSION 1.10.0)
add_subdirectory(vendor/gtest)

find_package(absl)
find_package(absl QUIET)
if (absl_FOUND)
cmake_policy(SET CMP0079 NEW)
target_compile_definitions(gtest PUBLIC GTEST_HAS_ABSL=1)
Expand Down
21 changes: 18 additions & 3 deletions io/EptAddonWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <arbiter/arbiter.hpp>
#include <nlohmann/json.hpp>

#include "private/EptSupport.hpp"
#include "private/ept/EptSupport.hpp"

namespace pdal
{
Expand Down Expand Up @@ -110,7 +110,8 @@ void EptAddonWriter::prepared(PointTableRef table)
const Dimension::Id id(layout.findDim(dimName));
if (id == Dimension::Id::Unknown)
throwError("Cannot find dimension '" + dimName + "'.");
m_addons.emplace_back(new Addon(layout, endpoint, id));
//ABELL
// m_addons.emplace_back(new Addon(layout, endpoint, id));
}
}

Expand All @@ -131,7 +132,8 @@ void EptAddonWriter::ready(PointTableRef table)
const auto keys(parse(meta.findChild("keys").value<std::string>()));

m_hierarchyStep = meta.findChild("step").value<uint64_t>();
m_info.reset(new EptInfo(info));
//ABELL
// m_info.reset(new EptInfo(info));

for (auto el : keys.items())
m_hierarchy[Key(el.key())] = el.value().get<uint64_t>();
Expand All @@ -146,8 +148,11 @@ void EptAddonWriter::write(const PointViewPtr view)
{
for (const auto& addon : m_addons)
{
//ABELL
/**
log()->get(LogLevel::Debug) << "Writing addon dimension " <<
addon->name() << " to " << addon->ep().prefixedRoot() << std::endl;
**/

writeOne(view, *addon);

Expand All @@ -161,10 +166,13 @@ void EptAddonWriter::writeOne(const PointViewPtr view, const Addon& addon) const
buffers.reserve(m_hierarchy.size());

// Create an addon buffer for each node we're going to write.
//ABELL
/**
for (const auto& p : m_hierarchy)
{
buffers.emplace_back(p.second * addon.size(), 0);
}
**/

// Fill in our buffers with the data from the view.
PointRef pr(*view);
Expand All @@ -182,13 +190,17 @@ void EptAddonWriter::writeOne(const PointViewPtr view, const Addon& addon) const
nodeId -= 1;
pointId = pr.getFieldAs<uint64_t>(m_pointIdDim);

/**
auto& buffer(buffers.at(nodeId));
assert(pointId * addon.size() + addon.size() <= buffer.size());
char* dst = buffer.data() + pointId * addon.size();
pr.getField(dst, addon.id(), addon.type());
**/
}

/**
const arbiter::Endpoint& ep(addon.ep());
const arbiter::Endpoint dataEp(ep.getSubEndpoint("ept-data"));
const arbiter::Endpoint hierEp(ep.getSubEndpoint("ept-hierarchy"));
Expand All @@ -213,8 +225,10 @@ void EptAddonWriter::writeOne(const PointViewPtr view, const Addon& addon) const
}
m_pool->await();
**/

// Write the addon hierarchy data.
/**
NL::json h;
Key key;
key.b = m_info->bounds();
Expand All @@ -231,6 +245,7 @@ void EptAddonWriter::writeOne(const PointViewPtr view, const Addon& addon) const
meta["dataType"] = "binary";
ep.put("ept-addon.json", meta.dump());
**/
}

void EptAddonWriter::writeHierarchy(NL::json& curr, const Key& key,
Expand Down

0 comments on commit 9f210e4

Please sign in to comment.