[Liblas-commits] hg-main-tree: set scale and offset
liblas-commits at liblas.org
liblas-commits at liblas.org
Mon Apr 11 15:43:51 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/dda3f9a45049
changeset: 527:dda3f9a45049
user: Howard Butler <hobu.inc at gmail.com>
date: Mon Apr 11 14:43:45 2011 -0500
description:
set scale and offset
diffstat:
src/drivers/las/Writer.cpp | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r 47d7359c8e7e -r dda3f9a45049 src/drivers/las/Writer.cpp
--- a/src/drivers/las/Writer.cpp Mon Apr 11 14:41:22 2011 -0500
+++ b/src/drivers/las/Writer.cpp Mon Apr 11 14:43:45 2011 -0500
@@ -64,8 +64,21 @@
{
// need to set properties of the header here, based on prev->getHeader() and on the user's preferences
m_lasHeader.setBounds( getPrevStage().getBounds() );
- m_lasHeader.SetOffset(0,0,0);
- m_lasHeader.SetScale(1,1,1);
+
+ const Schema& schema = getPrevStage().getSchema();
+
+ int indexX = schema.getDimensionIndex(Dimension::Field_X, Dimension::Int32);
+ int indexY = schema.getDimensionIndex(Dimension::Field_Y, Dimension::Int32);
+ int indexZ = schema.getDimensionIndex(Dimension::Field_Z, Dimension::Int32);
+ const Dimension& dimX = schema.getDimension(indexX);
+ const Dimension& dimY = schema.getDimension(indexY);
+ const Dimension& dimZ = schema.getDimension(indexZ);
+
+ m_lasHeader.SetScale(dimX.getNumericScale(), dimY.getNumericScale(), dimZ.getNumericScale());
+ m_lasHeader.SetOffset(dimX.getNumericOffset(), dimY.getNumericOffset(), dimZ.getNumericOffset());
+
+
+
boost::uint32_t cnt = static_cast<boost::uint32_t>(m_targetNumPointsToWrite);
m_lasHeader.SetPointRecordsCount(cnt);
More information about the Liblas-commits
mailing list