[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Oct 7 14:20:00 EDT 2009


changeset 0c5a055942d2 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=0c5a055942d2
summary: clean up SRSs if they exist

changeset 7f8db4b0b402 in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=7f8db4b0b402
summary: revert a bit

diffstat:

 apps/las2las.c              |   8 +++++++-
 src/lasspatialreference.cpp |  12 +++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r 5089f650f470 -r 7f8db4b0b402 apps/las2las.c
--- a/apps/las2las.c	Wed Oct 07 11:27:24 2009 -0500
+++ b/apps/las2las.c	Wed Oct 07 13:17:21 2009 -0500
@@ -947,7 +947,13 @@
     LASWriter_Destroy(writer);
     writer = NULL;
     LASHeader_Destroy(header);
-    header = NULL;   
+    header = NULL;
+    
+    if (out_srs != NULL)
+        LASSRS_Destroy(out_srs);
+    
+    if (in_srs != NULL)
+        LASSRS_Destroy(in_srs);
 
     if (verbose) ptime("done.");
 
diff -r 5089f650f470 -r 7f8db4b0b402 src/lasspatialreference.cpp
--- a/src/lasspatialreference.cpp	Wed Oct 07 11:27:24 2009 -0500
+++ b/src/lasspatialreference.cpp	Wed Oct 07 13:17:21 2009 -0500
@@ -61,8 +61,7 @@
 {
     if (&rhs != this)
     {
-        std::vector<LASVariableRecord> vlrs = rhs.GetVLRs();
-        SetVLRs(vlrs);
+        SetVLRs(rhs.GetVLRs());
         GetGTIF();
     }
     return *this;
@@ -102,7 +101,10 @@
 
 /// Keep a copy of the VLRs that are related to GeoTIFF SRS information.
 void LASSpatialReference::SetVLRs(std::vector<LASVariableRecord> const& vlrs)
-{ 
+{
+    
+    std::string const uid("LASF_Projection");
+    
     // Wipe out any existing VLRs that might exist on the LASSpatialReference
     m_vlrs.clear();
     
@@ -306,13 +308,13 @@
     // If we already have m_gtiff and m_tiff, that is because we have 
     // already called GetGTIF once before.  VLRs ultimately drive how the 
     // LASSpatialReference is defined, not the GeoTIFF keys.  
-    if (m_tiff != 0)
+    if (m_tiff)
     {
         ST_Destroy(m_tiff);
         m_tiff = 0;
     }
 
-    if (m_gtiff != 0)
+    if (m_gtiff)
     {
         GTIFFree(m_gtiff);
         m_gtiff = 0;


More information about the Liblas-commits mailing list