[Liblas-commits] r1090 - in trunk: include/liblas include/liblas/capi src

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Mar 9 14:07:57 EDT 2009


Author: hobu
Date: Mon Mar  9 14:07:57 2009
New Revision: 1090
URL: http://liblas.org/changeset/1090

Log:
 fix #102, add LASSRS::SetGTIFF

Modified:
   trunk/include/liblas/capi/liblas.h
   trunk/include/liblas/lassrs.hpp
   trunk/src/las_c_api.cpp
   trunk/src/lassrs.cpp

Modified: trunk/include/liblas/capi/liblas.h
==============================================================================
--- trunk/include/liblas/capi/liblas.h	(original)
+++ trunk/include/liblas/capi/liblas.h	Mon Mar  9 14:07:57 2009
@@ -66,6 +66,7 @@
 /* Fake out the compiler if we don't have libgeotiff */
 #ifndef HAVE_LIBGEOTIFF
     typedef struct GTIFS * GTIF;
+    typedef struct TIFFS * TIFF;
 #else
 #include <geotiff.h>
 #endif

Modified: trunk/include/liblas/lassrs.hpp
==============================================================================
--- trunk/include/liblas/lassrs.hpp	(original)
+++ trunk/include/liblas/lassrs.hpp	Mon Mar  9 14:07:57 2009
@@ -116,6 +116,8 @@
     /// Returns a pointer to the internal GTIF*.  Only available if 
     /// you have libgeotiff linked in.
     const GTIF* GetGTIF();
+    
+    void SetGTIF(const GTIF* gtiff, const TIFF* tiff);
 
     /// Returns the OGC WKT describing Spatial Reference System.
     /// If GDAL is linked, it uses GDAL's operations and methods to determine 

Modified: trunk/src/las_c_api.cpp
==============================================================================
--- trunk/src/las_c_api.cpp	(original)
+++ trunk/src/las_c_api.cpp	Mon Mar  9 14:07:57 2009
@@ -1681,6 +1681,21 @@
     }
 }
 
+LAS_DLL LASErrorEnum LASSRS_SetGTIF(LASSRSH hSRS, const GTIF* gtiff, const TIFF* tiff)
+{
+    VALIDATE_POINTER1(hSRS, "LASSRS_SetGTIF", LE_Failure);
+    VALIDATE_POINTER1(gtiff, "LASSRS_SetGTIF", LE_Failure);
+    VALIDATE_POINTER1(tiff, "LASSRS_SetGTIF", LE_Failure);
+    try {
+        ((LASSRS*) hSRS)->SetGTIF(gtiff, tiff);
+    }
+    catch (std::exception const& e) {
+        LASError_PushError(LE_Failure, e.what(), "LASSRS_SetGTIF");
+        return LE_Failure;
+    }
+
+    return LE_None;    
+}
 LAS_DLL char* LASSRS_GetProj4(LASSRSH hSRS) 
 {
     VALIDATE_POINTER1(hSRS, "LASSRS_GetProj4", NULL);

Modified: trunk/src/lassrs.cpp
==============================================================================
--- trunk/src/lassrs.cpp	(original)
+++ trunk/src/lassrs.cpp	Mon Mar  9 14:07:57 2009
@@ -302,6 +302,14 @@
 #endif // ndef HAVE_LIBGEOTIFF
 }
 
+void LASSRS::SetGTIF(const GTIF* gtiff, const TIFF* tiff) 
+{
+    m_gtiff = (GTIF*)gtiff;
+    m_tiff = (ST_TIFF*)tiff;
+    ResetVLRs();
+    m_gtiff = NULL;
+    m_tiff = NULL;
+}
 const GTIF* LASSRS::GetGTIF()
 {
 #ifndef HAVE_LIBGEOTIFF


More information about the Liblas-commits mailing list