[Liblas-commits] hg-main-tree: no longer need to bogusly set the point count

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Apr 1 17:02:14 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/27148150df02
changeset: 493:27148150df02
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Apr 01 16:01:19 2011 -0500
description:
no longer need to bogusly set the point count
Subject: hg-main-tree: if ::write(0) is called, we just write until the iteratore reads 0 points for us

details:   http://hg.libpc.orghg-main-tree/rev/2b5fb0845fb4
changeset: 494:2b5fb0845fb4
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Apr 01 16:02:02 2011 -0500
description:
if ::write(0) is called, we just write until the iteratore reads 0 points for us

diffstat:

 src/Writer.cpp             |  10 +++++++++-
 src/drivers/oci/Reader.cpp |   2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r b2d9c7ff4041 -r 2b5fb0845fb4 src/Writer.cpp
--- a/src/Writer.cpp	Fri Apr 01 15:48:16 2011 -0500
+++ b/src/Writer.cpp	Fri Apr 01 16:02:02 2011 -0500
@@ -103,7 +103,15 @@
     
     if (targetNumPointsToWrite == 0)
     {
-        
+        PointBuffer buffer(m_prevStage.getSchema(), m_chunkSize);
+        boost::uint32_t numPointsReadThisChunk = iter->read(buffer);
+        boost::uint32_t numPointsWrittenThisChunk = 0;
+        while (numPointsReadThisChunk != 0)
+        {
+            numPointsWrittenThisChunk = writeBuffer(buffer);
+            m_actualNumPointsWritten += numPointsWrittenThisChunk;
+            numPointsReadThisChunk = iter->read(buffer);
+        }
     } else 
     {
 
diff -r b2d9c7ff4041 -r 2b5fb0845fb4 src/drivers/oci/Reader.cpp
--- a/src/drivers/oci/Reader.cpp	Fri Apr 01 15:48:16 2011 -0500
+++ b/src/drivers/oci/Reader.cpp	Fri Apr 01 16:02:02 2011 -0500
@@ -56,7 +56,7 @@
     
     registerFields();
     
-    setNumPoints(1000);
+    // setNumPoints(1000);
 }    
 
 bool Reader::isVerbose() const


More information about the Liblas-commits mailing list