[Liblas-commits] hg-main-tree: virtualize Stage::getNumPoints

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Apr 13 15:39:32 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/c1baddc14070
changeset: 556:c1baddc14070
user:      Howard Butler <hobu.inc at gmail.com>
date:      Wed Apr 13 14:38:55 2011 -0500
description:
virtualize Stage::getNumPoints
Subject: hg-main-tree: use liblas writer for reader test because it matches our fixed schema right now

details:   http://hg.libpc.orghg-main-tree/rev/4cf975b57ed4
changeset: 557:4cf975b57ed4
user:      Howard Butler <hobu.inc at gmail.com>
date:      Wed Apr 13 14:39:20 2011 -0500
description:
use liblas writer for reader test because it matches our fixed schema right now

diffstat:

 include/libpc/Stage.hpp              |   2 +-
 include/libpc/drivers/oci/Reader.hpp |   2 +-
 test/unit/OCITest.cpp                |  10 ++++++++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r a1448c371ec4 -r 4cf975b57ed4 include/libpc/Stage.hpp
--- a/include/libpc/Stage.hpp	Wed Apr 13 13:28:49 2011 -0500
+++ b/include/libpc/Stage.hpp	Wed Apr 13 14:39:20 2011 -0500
@@ -66,7 +66,7 @@
 
     // core properties of all stages
     const Schema& getSchema() const;
-    boost::uint64_t getNumPoints() const;
+    virtual boost::uint64_t getNumPoints() const;
     PointCountType getPointCountType() const;
     const Bounds<double>& getBounds() const;
     const SpatialReference& getSpatialReference() const;
diff -r a1448c371ec4 -r 4cf975b57ed4 include/libpc/drivers/oci/Reader.hpp
--- a/include/libpc/drivers/oci/Reader.hpp	Wed Apr 13 13:28:49 2011 -0500
+++ b/include/libpc/drivers/oci/Reader.hpp	Wed Apr 13 14:39:20 2011 -0500
@@ -64,7 +64,7 @@
         return false;
     }
 
-
+    boost::uint64_t getNumPoints() { return 0; }
     
     libpc::SequentialIterator* createSequentialIterator() const;
     Connection getConnection () const { return m_connection;}
diff -r a1448c371ec4 -r 4cf975b57ed4 test/unit/OCITest.cpp
--- a/test/unit/OCITest.cpp	Wed Apr 13 13:28:49 2011 -0500
+++ b/test/unit/OCITest.cpp	Wed Apr 13 14:39:20 2011 -0500
@@ -48,6 +48,7 @@
 #include <libpc/drivers/faux/Reader.hpp>
 #include <libpc/drivers/faux/Writer.hpp>
 
+#include <libpc/drivers/liblas/Writer.hpp>
 
 #include "support.hpp"
 
@@ -134,9 +135,14 @@
 
     libpc::drivers::oci::Reader reader(options);
     const boost::uint64_t numPoints = reader.getNumPoints();
-
-    libpc::drivers::faux::Writer writer(reader);
+    
+    BOOST_CHECK_EQUAL(numPoints, 14);
+    std::ostream* ofs = Utils::createFile("temp.las");
+    
+    libpc::drivers::liblas::LiblasWriter writer(reader, *ofs);
     writer.write(0);
+    
+    Utils::closeFile(ofs);
 
     
 }


More information about the Liblas-commits mailing list