From aa685b30ec3dcbef3402354c08a8d46a75571f97 Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Mon, 2 Dec 2013 17:02:12 -0600 Subject: [PATCH] code de-crufting --- src/drivers/pgpointcloud/Writer.cpp | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/src/drivers/pgpointcloud/Writer.cpp b/src/drivers/pgpointcloud/Writer.cpp index a061dad960..d65b875668 100644 --- a/src/drivers/pgpointcloud/Writer.cpp +++ b/src/drivers/pgpointcloud/Writer.cpp @@ -486,43 +486,20 @@ boost::uint32_t Writer::writeBuffer(const PointBuffer& buffer) bool Writer::WriteBlock(PointBuffer const& buffer) { - boost::uint8_t* point_data; - - boost::uint32_t schema_byte_size; - - // PackPointData(buffer, &point_data, point_data_length, schema_byte_size); - PointBuffer output = buffer.pack(); pointbuffer::PointBufferByteSize point_data_length = output.getBufferByteLength(); - point_data = output.getData(0); - // - // - // - // log()->get(logDEBUG) << "point_data_length " << output.getSchema().getByteSize() * output.getNumPoints() << std::endl;; - // log()->get(logDEBUG) << "output.getSchema().getByteSize() " << output.getSchema().getByteSize() << std::endl;; - // log()->get(logDEBUG) << "output.getNumPoints() " << output.getNumPoints() << std::endl;; - // log()->get(logDEBUG) << "buffer.getNumPoints() " << buffer.getNumPoints() << std::endl;; - // - // log()->get(logDEBUG) << "buffer.getBufferByteCapacity() " << buffer.getBufferByteCapacity() << std::endl;; - // log()->get(logDEBUG) << "output.getBufferByteCapacity() " << output.getBufferByteCapacity() << std::endl;; - // log()->get(logDEBUG) << "buffer.getBufferByteLength() " << buffer.getBufferByteLength() << std::endl;; - // log()->get(logDEBUG) << "output.getBufferByteLength() " << output.getBufferByteLength() << std::endl;; - + boost::uint8_t* point_data = output.getData(0); boost::uint32_t num_points = static_cast(output.getNumPoints()); if (num_points > m_patch_capacity) { - // error here + throw pdal_error("drivers.pgpointcloud.writer num_points > m_patch_capacity!"); } std::vector block_data; block_data.resize(point_data_length); std::copy(point_data, point_data+point_data_length, block_data.begin()); - // for (boost::uint32_t i = 0; i < point_data_length; ++i) - // { - // block_data.push_back(point_data[i]); - // } /* We are always getting uncompressed bytes off the block_data */ /* so we always used compression type 0 (uncompressed) in writing our WKB */