diff --git a/include/pdal/drivers/oci/Writer.hpp b/include/pdal/drivers/oci/Writer.hpp index a737119051..02bf8976a7 100644 --- a/include/pdal/drivers/oci/Writer.hpp +++ b/include/pdal/drivers/oci/Writer.hpp @@ -126,13 +126,6 @@ class PDAL_DLL Writer : public pdal::Writer, pdal::drivers::oci::OracleDriver return getOptions().getValueOrDefault(option_name, default_value); } - void PackPointData( PointBuffer const& buffer, - boost::uint8_t** point_data, - boost::uint32_t& point_data_len, - boost::uint32_t& schema_byte_size); - - - bool is3d() const; bool isSolid() const; boost::int32_t getPCID() const; diff --git a/src/drivers/oci/Writer.cpp b/src/drivers/oci/Writer.cpp index 84f2c34791..752756ab49 100644 --- a/src/drivers/oci/Writer.cpp +++ b/src/drivers/oci/Writer.cpp @@ -1118,48 +1118,6 @@ pdal::Bounds Writer::CalculateBounds(PointBuffer const& buffer) } -void Writer::PackPointData(PointBuffer const& buffer, - boost::uint8_t** point_data, - boost::uint32_t& point_data_len, - boost::uint32_t& schema_byte_size) - -{ - // Creates a new buffer that has the ignored dimensions removed from - // it. - - schema::index_by_index const& idx = buffer.getSchema().getDimensions().get(); - - schema_byte_size = 0; - schema::index_by_index::size_type i(0); - for (i = 0; i < idx.size(); ++i) - { - if (! idx[i].isIgnored()) - schema_byte_size = schema_byte_size+idx[i].getByteSize(); - } - - log()->get(logDEBUG) << "Packed schema byte size " << schema_byte_size; - - point_data_len = buffer.getNumPoints() * schema_byte_size; - *point_data = new boost::uint8_t[point_data_len]; - - boost::uint8_t* current_position = *point_data; - - for (boost::uint32_t i = 0; i < buffer.getNumPoints(); ++i) - { - boost::uint8_t* data = buffer.getData(i); - for (boost::uint32_t d = 0; d < idx.size(); ++d) - { - if (! idx[d].isIgnored()) - { - memcpy(current_position, data, idx[d].getByteSize()); - current_position = current_position+idx[d].getByteSize(); - } - data = data + idx[d].getByteSize(); - - } - } -} - bool Writer::WriteBlock(PointBuffer const& buffer) { bool bUsePartition = m_block_table_partition_column.size() != 0; @@ -1216,10 +1174,15 @@ bool Writer::WriteBlock(PointBuffer const& buffer) boost::uint8_t* point_data; boost::uint32_t point_data_length; boost::uint32_t schema_byte_size; - + PointBuffer* output_buffer(0); + bool pack = getOptions().getValueOrDefault("pack_ignored_fields", true); if (pack) - PackPointData(buffer, &point_data, point_data_length, schema_byte_size); + { + output_buffer = buffer.pack(); + point_data = output_buffer->getData(0); + point_data_length = output_buffer->getSchema().getByteSize() * output_buffer->getNumPoints(); + } else { point_data = buffer.getData(0);