[Liblas-commits] hg: 4 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Nov 18 16:13:43 EST 2010


changeset 8d36443861b5 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=8d36443861b5
summary: clean up error messages

changeset 25d25c77b060 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=25d25c77b060
summary: SetHeaderPtr must trigger a rescale.  For now, we always do it, but the headers could be compared and the data only rescaled when necessary

changeset 05fbfd790cfd in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=05fbfd790cfd
summary: don't trap the last out_of_range error.  I don't know why this was there Matuesz.

changeset 8d0a1e312bb6 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=8d0a1e312bb6
summary: don't open readers with custom headers.  There's no need for this.

diffstat:

 apps/las2las.cpp            |   4 ++--
 apps/las2oci.cpp            |   4 ++--
 apps/lasinfo.cpp            |   4 ++--
 src/detail/reader/point.cpp |  16 ++++++++--------
 src/laspoint.cpp            |  10 ++++++++++
 5 files changed, 24 insertions(+), 14 deletions(-)

diffs (105 lines):

diff -r bede54b045bc -r 8d0a1e312bb6 apps/las2las.cpp
--- a/apps/las2las.cpp	Thu Nov 18 11:35:32 2010 -0600
+++ b/apps/las2las.cpp	Thu Nov 18 15:13:09 2010 -0600
@@ -56,7 +56,7 @@
     std::ifstream ifs;
     if (!liblas::Open(ifs, input.c_str()))
     {
-        std::cerr << "Cannot open " << input << "for read.  Exiting...";
+        std::cerr << "Cannot open " << input << " for read.  Exiting..." << std::endl;
         return false;
     }
 
@@ -288,7 +288,7 @@
             std::ifstream ifs;
             if (!liblas::Open(ifs, input.c_str()))
             {
-                std::cerr << "Cannot open " << input << "for read.  Exiting..." << std::endl;
+                std::cerr << "Cannot open " << input << " for read.  Exiting..." << std::endl;
                 return 1;
             }
             // set_ifstream_buffer(ifs, default_buffer_size);
diff -r bede54b045bc -r 8d0a1e312bb6 apps/las2oci.cpp
--- a/apps/las2oci.cpp	Thu Nov 18 11:35:32 2010 -0600
+++ b/apps/las2oci.cpp	Thu Nov 18 15:13:09 2010 -0600
@@ -1112,9 +1112,9 @@
         
         liblas::Reader* reader2 = 0;
         if (bCachedReader)
-            reader2 = new liblas::Reader(*istrm2,0, header);
+            reader2 = new liblas::Reader(*istrm2,0);
         else
-            reader2 = new liblas::Reader(*istrm2, header);
+            reader2 = new liblas::Reader(*istrm2);
 
         reader2->SetFilters(filters);
         reader2->SetTransforms(transforms);
diff -r bede54b045bc -r 8d0a1e312bb6 apps/lasinfo.cpp
--- a/apps/lasinfo.cpp	Thu Nov 18 11:35:32 2010 -0600
+++ b/apps/lasinfo.cpp	Thu Nov 18 15:13:09 2010 -0600
@@ -168,7 +168,7 @@
                 std::cout << "Opening " << input << " to fetch Header" << std::endl;
             if (!liblas::Open(ifs, input.c_str()))
             {
-                std::cerr << "Cannot open " << input << "for read.  Exiting...";
+                std::cerr << "Cannot open " << input << " for read.  Exiting..." << std::endl;
                 return 1;
             }
             liblas::Reader reader(ifs);
@@ -185,7 +185,7 @@
         std::ifstream ifs;
         if (!liblas::Open(ifs, input.c_str()))
         {
-            std::cerr << "Cannot open " << input << "for read.  Exiting...";
+            std::cerr << "Cannot open " << input << " for read.  Exiting..." << std::endl;
             return false;
         }
     
diff -r bede54b045bc -r 8d0a1e312bb6 src/detail/reader/point.cpp
--- a/src/detail/reader/point.cpp	Thu Nov 18 11:35:32 2010 -0600
+++ b/src/detail/reader/point.cpp	Thu Nov 18 15:13:09 2010 -0600
@@ -78,15 +78,15 @@
     assert(m_point.GetHeaderPtr());
     assert(m_raw_data.size() > 0);
 
-    try
-    {
+    // try
+    // {
         detail::read_n(m_raw_data.front(), m_ifs, m_raw_data.size());
-    }
-    catch (std::out_of_range const& e) // we reached the end of the file
-    {
-        // FIXME: Why do we kill the error? It cause setting m_point with invali data, doesn't it? --mloskot
-        std::cerr << e.what() << std::endl;
-    }    
+    // }
+    // catch (std::out_of_range const& e) // we reached the end of the file
+    // {
+    //     // FIXME: Why do we kill the error? It cause setting m_point with invali data, doesn't it? --mloskot
+    //     std::cerr << e.what() << std::endl;
+    // }    
     
     m_point.SetData(m_raw_data);
 }
diff -r bede54b045bc -r 8d0a1e312bb6 src/laspoint.cpp
--- a/src/laspoint.cpp	Thu Nov 18 11:35:32 2010 -0600
+++ b/src/laspoint.cpp	Thu Nov 18 15:13:09 2010 -0600
@@ -241,7 +241,17 @@
         // headerptr can be catastrophic in a lot of cases.  
     }
     
+    double x = GetX();
+    double y = GetY();
+    double z = GetZ();
+    
+    // The header's scale/offset can change the raw storage of xyz.  
+    // SetHeaderPtr can result in a rescaling of the data.
     m_header = header;
+    
+    SetX(x);
+    SetY(y);
+    SetZ(z);
 }
 
 HeaderPtr Point::GetHeaderPtr() const


More information about the Liblas-commits mailing list