[Liblas-commits] hg-main-tree: put the try/except globally for oracle-write and o...

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Jul 25 16:29:54 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/5933f9408d44
changeset: 929:5933f9408d44
user:      Howard Butler <hobu.inc at gmail.com>
date:      Mon Jul 25 15:29:48 2011 -0500
description:
put the try/except globally for oracle-write and oracle-read

diffstat:

 apps/pc2pc.cpp |  24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diffs (60 lines):

diff -r fabdd7bfc930 -r 5933f9408d44 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp	Mon Jul 25 15:08:00 2011 -0500
+++ b/apps/pc2pc.cpp	Mon Jul 25 15:29:48 2011 -0500
@@ -138,6 +138,7 @@
     else if (hasOption("oracle-writer"))
     {
 #ifdef PDAL_HAVE_ORACLE
+        try{
         pdal::drivers::las::LasReader reader(m_inputFile);
     
         const boost::uint64_t numPoints = reader.getNumPoints();
@@ -183,19 +184,20 @@
         // pdal::filters::ByteSwapFilter swapper(descalingFilter);
         pdal::drivers::oci::Writer writer(descalingFilter, options);
 
-        try{
-            writer.write(numPoints);
+
+        writer.write(numPoints);
             
+
+
+        boost::property_tree::ptree output_tree;
+        // output_tree.put_child(writer.getName(), options.GetPTree());
+        // boost::property_tree::write_xml(m_xml, output_tree);
+
         } catch (pdal::pdal_error& e)
         {
             std::cerr << "Error writing oracle: " << e.what() << std::endl;
             
-        }
-
-        boost::property_tree::ptree output_tree;
-        // output_tree.put_child(writer.getName(), options.GetPTree());
-        // boost::property_tree::write_xml(m_xml, output_tree);
-                    
+        }                    
 #else
         throw configuration_error("PDAL not compiled with Oracle support");
 #endif
@@ -203,7 +205,7 @@
         else if (hasOption("oracle-reader"))
         {
     #ifdef PDAL_HAVE_ORACLE
-
+        try{
         boost::property_tree::ptree load_tree;
         
         boost::property_tree::read_xml(m_xml, load_tree);
@@ -249,8 +251,8 @@
         writer.setChunkSize(oracle_options.get<boost::uint32_t>("capacity"));
         writer.setPointFormat(pdal::drivers::las::PointFormat3);
         
-        try{
-            writer.write(0);
+
+        writer.write(0);
             
         } catch (pdal::pdal_error& e)
         {


More information about the Liblas-commits mailing list