[Liblas-commits] hg: 3 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Sep 2 15:40:18 EDT 2010


changeset 777e2c1b8be4 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=777e2c1b8be4
summary: whitespace normalization

changeset 27908472dcc7 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=27908472dcc7
summary: write schema VLR into files that have a custom schema

changeset 4de090fb3f3e in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=4de090fb3f3e
summary: specify the length in case our file has funky, un-strlen'able characters

diffstat:

 apps/oci_util.cpp            |   2 +-
 src/detail/writer/header.cpp |  10 ++++++++--
 src/lasspatialreference.cpp  |   2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

diffs (51 lines):

diff -r d2fbecaa0842 -r 4de090fb3f3e apps/oci_util.cpp
--- a/apps/oci_util.cpp	Thu Sep 02 10:09:26 2010 -0500
+++ b/apps/oci_util.cpp	Thu Sep 02 14:39:31 2010 -0500
@@ -37,7 +37,7 @@
         infile->read (data, size);
         // infile->close();
 
-        std::string output = std::string(data);
+        std::string output = std::string(data, (std::size_t) size);
         delete[] data;
         delete infile;
         return output;
diff -r d2fbecaa0842 -r 4de090fb3f3e src/detail/writer/header.cpp
--- a/src/detail/writer/header.cpp	Thu Sep 02 10:09:26 2010 -0500
+++ b/src/detail/writer/header.cpp	Thu Sep 02 14:39:31 2010 -0500
@@ -107,6 +107,13 @@
         GetStream().seekp(0, ios::beg);
     }
 
+    // If we have a custom schema, add the VLR and write it into the 
+    // file.  
+    if (m_header.GetSchema().IsCustom()) {
+        VariableRecord v = m_header.GetSchema().GetVLR();
+        m_header.AddVLR(v);
+    }
+    
     // 1. File Signature
     std::string const filesig(m_header.GetFileSignature());
     assert(filesig.size() == 4);
@@ -251,8 +258,7 @@
     // offset is not large enough to contain the VLRs.  The value 
     // it returns is the number of bytes we must increase the header
     // by in order for it to contain the VLRs.
-    
-    m_header.AddVLR(m_header.GetSchema().GetVLR());
+
     int32_t difference = WriteVLRs();
     if (difference < 0) {
         m_header.SetDataOffset(m_header.GetDataOffset() + abs(difference) );
diff -r d2fbecaa0842 -r 4de090fb3f3e src/lasspatialreference.cpp
--- a/src/lasspatialreference.cpp	Thu Sep 02 10:09:26 2010 -0500
+++ b/src/lasspatialreference.cpp	Thu Sep 02 14:39:31 2010 -0500
@@ -379,7 +379,7 @@
 std::string SpatialReference::GetWKT(WKTModeFlag mode_flag , bool pretty) const 
 {
 #ifndef HAVE_GDAL
-	boost::ignore_unused_variable_warning(mode_flag);
+    boost::ignore_unused_variable_warning(mode_flag);
     boost::ignore_unused_variable_warning(pretty);
 
     return std::string();


More information about the Liblas-commits mailing list