Skip to content

Commit

Permalink
convertAndSet doesn't work on int8_t/uint8_t
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Oct 3, 2014
1 parent 1bb9fc3 commit 5060aee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/pdal/PointBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void PointBuffer::setField(Dimension::Id::Enum dim, PointId idx, T val)
convertAndSet<T, double>(dim, idx, val);
break;
case Dimension::Type::Signed8:
convertAndSet<T, int8_t>(dim, idx, val);
setFieldInternal(dim, idx, &val);
break;
case Dimension::Type::Signed16:
convertAndSet<T, int16_t>(dim, idx, val);
Expand All @@ -308,7 +308,7 @@ void PointBuffer::setField(Dimension::Id::Enum dim, PointId idx, T val)
convertAndSet<T, int64_t>(dim, idx, val);
break;
case Dimension::Type::Unsigned8:
convertAndSet<T, uint8_t>(dim, idx, val);
setFieldInternal(dim, idx, &val);
break;
case Dimension::Type::Unsigned16:
convertAndSet<T, uint16_t>(dim, idx, val);
Expand Down
2 changes: 2 additions & 0 deletions src/drivers/oci/OciReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ void OciReader::readBlob(Statement stmt, BlockPtr block)
// All of the schemas should be the same with regard to actual dimension
// name, order, etc, but each cloud may have its own scaling for X, Y and Z.
// Store it away so that it can be applied later if necessary.
// HOBU -- nope. Each Block/cloud combo could potentially have a different
// schema, with same names but different composition.
schema::XMLSchema* OciReader::findSchema(Statement stmt, BlockPtr block)
{
int32_t cloudId = stmt->GetInteger(&block->pc->pc_id);
Expand Down
7 changes: 7 additions & 0 deletions src/drivers/oci/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <pdal/Bounds.hpp>
#include <pdal/Dimension.hpp>
#include <pdal/Utils.hpp>
#include <pdal/FileUtils.hpp>

namespace pdal
{
Expand Down Expand Up @@ -103,6 +104,12 @@ schema::XMLSchema fetchSchema(Statement stmt, BlockPtr block)
pc_schema_xml = pc_schema;
CPLFree(pc_schema);
}
std::ostringstream fname;
int cloudId = stmt->GetInteger(&(block->pc->pc_id)) ;
fname << "schema-" << cloudId <<".xml";
std::ostream* out = FileUtils::createFile(fname.str());
out->write(pc_schema_xml.c_str(), pc_schema_xml.size());
FileUtils::closeFile(out);
return schema::Reader(pc_schema_xml).schema();
}

Expand Down

0 comments on commit 5060aee

Please sign in to comment.