[Liblas-commits] r1032 - in trunk: python/tests src src/detail

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Feb 16 23:13:52 EST 2009


Author: hobu
Date: Mon Feb 16 23:13:52 2009
New Revision: 1032
URL: http://liblas.org/changeset/1032

Log:
fix up so tests can pass

Modified:
   trunk/python/tests/VLR.txt
   trunk/src/detail/reader.cpp
   trunk/src/lasheader.cpp
   trunk/src/lassrs.cpp

Modified: trunk/python/tests/VLR.txt
==============================================================================
--- trunk/python/tests/VLR.txt	(original)
+++ trunk/python/tests/VLR.txt	Mon Feb 16 23:13:52 2009
@@ -60,7 +60,7 @@
   >>> h.records_count
   3L
   >>> h.proj4
-  '+proj=utm +zone=17 +ellps=WGS84 +units=m '
+  '+proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m +no_defs '
   >>> v = h.GetVLR(0)
   >>> v.recordid
   34735

Modified: trunk/src/detail/reader.cpp
==============================================================================
--- trunk/src/detail/reader.cpp	(original)
+++ trunk/src/detail/reader.cpp	Mon Feb 16 23:13:52 2009
@@ -144,7 +144,9 @@
     
     header.SetSRS(srs);
     
-    header.SetProj4(srs.GetProj4());
+    if (vlrs.size()) {
+        header.SetProj4(srs.GetProj4());
+    }
     
     // std::cout << srs.GetWKT() << std::endl;
     

Modified: trunk/src/lasheader.cpp
==============================================================================
--- trunk/src/lasheader.cpp	(original)
+++ trunk/src/lasheader.cpp	Mon Feb 16 23:13:52 2009
@@ -749,6 +749,8 @@
 // #else
 //     
     m_srs.SetVLRs(m_vlrs);
+    if (!m_srs.GetVLRs().size())
+        return;
     m_srs.ResetVLRs();
     
     std::vector<LASVLR> vlrs;

Modified: trunk/src/lassrs.cpp
==============================================================================
--- trunk/src/lassrs.cpp	(original)
+++ trunk/src/lassrs.cpp	Mon Feb 16 23:13:52 2009
@@ -138,8 +138,10 @@
     int ktype = 0;
     int kcount = 0;
     
-    m_vlrs.clear();
-    
+    // if (m_vlrs.size())
+    //     m_vlrs.clear();
+    // else
+    //     return;
     if (!m_tiff) throw std::invalid_argument("m_tiff was null");
     if (!m_gtiff) throw std::invalid_argument("m_gtiff was null");
 
@@ -298,6 +300,7 @@
 #ifdef HAVE_GDAL
     GTIFDefn sGTIFDefn;
     char* pszWKT = NULL;
+    if (!m_gtiff) return std::string("");
     if( GTIFGetDefn( m_gtiff, &sGTIFDefn ) ) {
         pszWKT = GTIFGetOGISDefn( m_gtiff, &sGTIFDefn );
         if (pszWKT) {


More information about the Liblas-commits mailing list