[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Dec 20 10:45:22 EST 2010


changeset 016e9f285315 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=016e9f285315
summary: turn off .laz detection, this is busted for me

changeset 02ae167e373f in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=02ae167e373f
summary: add non-const GetData method to liblas::Point to help eliminate data copying

diffstat:

 apps/las2las.cpp                       |  19 ++++++++++---------
 include/liblas/detail/reader/point.hpp |   2 +-
 include/liblas/laspoint.hpp            |   1 +
 src/detail/reader/point.cpp            |   8 ++++----
 4 files changed, 16 insertions(+), 14 deletions(-)

diffs (80 lines):

diff -r a23105c5fa8b -r 02ae167e373f apps/las2las.cpp
--- a/apps/las2las.cpp	Sun Dec 19 14:45:17 2010 -0600
+++ b/apps/las2las.cpp	Mon Dec 20 09:45:02 2010 -0600
@@ -323,15 +323,16 @@
         
         // Transforms alter our header as well.  Setting scales, offsets, etc.
         transforms = GetTransforms(vm, verbose, header);
-        
-        if (output.compare(output.length()-4,4,".laz")==0)
-        {
-#ifdef HAVE_LASZIP
-            header.SetIsCompressed(true);
-#else
-            throw std::runtime_error("Compression support not enabled in liblas configuration");
-#endif
-        }
+
+        // This is quite busted for me on OS X...        
+//         if (output.compare(output.length()-4,4,".laz")==0)
+//         {
+// #ifdef HAVE_LASZIP
+//             header.SetIsCompressed(true);
+// #else
+//             throw std::runtime_error("Compression support not enabled in liblas configuration");
+// #endif
+//         }
 
         bool op = process(  input, 
                             output,
diff -r a23105c5fa8b -r 02ae167e373f include/liblas/detail/reader/point.hpp
--- a/include/liblas/detail/reader/point.hpp	Sun Dec 19 14:45:17 2010 -0600
+++ b/include/liblas/detail/reader/point.hpp	Mon Dec 20 09:45:02 2010 -0600
@@ -79,7 +79,7 @@
     std::istream& m_ifs;
     HeaderPtr m_header;
     liblas::Point m_point;
-    std::vector<boost::uint8_t> m_raw_data;
+    std::vector<boost::uint8_t>::size_type m_record_size;
 };
 
 
diff -r a23105c5fa8b -r 02ae167e373f include/liblas/laspoint.hpp
--- a/include/liblas/laspoint.hpp	Sun Dec 19 14:45:17 2010 -0600
+++ b/include/liblas/laspoint.hpp	Mon Dec 20 09:45:02 2010 -0600
@@ -198,6 +198,7 @@
 
 
     std::vector<boost::uint8_t> const& GetData() const {return m_data; }
+    std::vector<boost::uint8_t> & GetData() {return m_data; }
     void SetData(std::vector<boost::uint8_t> const& v) { m_data = v;}
     
     void SetHeaderPtr(HeaderPtr header);
diff -r a23105c5fa8b -r 02ae167e373f src/detail/reader/point.cpp
--- a/src/detail/reader/point.cpp	Sun Dec 19 14:45:17 2010 -0600
+++ b/src/detail/reader/point.cpp	Mon Dec 20 09:45:02 2010 -0600
@@ -59,7 +59,7 @@
     : m_ifs(ifs)
     , m_header(header)
     , m_point(m_header)
-    , m_raw_data(m_header->GetSchema().GetByteSize())
+    , m_record_size(m_header->GetSchema().GetByteSize())
 {
 }
 
@@ -71,12 +71,12 @@
 {
     assert(m_header);
     assert(m_point.GetHeaderPtr());
-    assert(m_raw_data.size() > 0);
+    assert(m_record_size > 0);
     
     m_point.SetHeaderPtr(m_header);
-    detail::read_n(m_raw_data.front(), m_ifs, m_raw_data.size());
+    
+    detail::read_n(m_point.GetData().front(), m_ifs, m_record_size);
 
-    m_point.SetData(m_raw_data);
 }
 
 }}} // namespace liblas::detail::reader


More information about the Liblas-commits mailing list