[Liblas-commits] r1060 - in trunk: apps include/liblas include/liblas/capi python/liblas python/tests src src/detail

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Feb 20 17:44:51 EST 2009


Author: hobu
Date: Fri Feb 20 17:44:51 2009
New Revision: 1060
URL: http://liblas.org/changeset/1060

Log:
remove LASHeader::[G|S]etProj4 #97

Modified:
   trunk/apps/lascommon.c
   trunk/include/liblas/capi/liblas.h
   trunk/include/liblas/lasheader.hpp
   trunk/python/liblas/core.py
   trunk/python/liblas/header.py
   trunk/python/tests/Header.txt
   trunk/src/detail/reader.cpp
   trunk/src/las_c_api.cpp
   trunk/src/lasheader.cpp

Modified: trunk/apps/lascommon.c
==============================================================================
--- trunk/apps/lascommon.c	(original)
+++ trunk/apps/lascommon.c	Fri Feb 20 17:44:51 2009
@@ -398,7 +398,7 @@
     uint16_t nVLRRecordId = 0;
     
     LASVLRH pVLR = NULL;
-
+    LASSRSH pSRS = NULL;
     uint32_t nVLR = 0;
     int i = 0;
     
@@ -406,7 +406,9 @@
     pszProjectId = LASHeader_GetProjectId(header);
     pszSystemId = LASHeader_GetSystemId(header);
     pszSoftwareId = LASHeader_GetSoftwareId(header);
-    pszProj4 = LASHeader_GetProj4(header);
+    
+    pSRS = LASHeader_GetSRS(header);
+    pszProj4 = LASSRS_GetProj4(pSRS);
     
     nVLR = LASHeader_GetRecordsCount(header);
     

Modified: trunk/include/liblas/capi/liblas.h
==============================================================================
--- trunk/include/liblas/capi/liblas.h	(original)
+++ trunk/include/liblas/capi/liblas.h	Fri Feb 20 17:44:51 2009
@@ -786,21 +786,6 @@
 */
 LAS_DLL LASError LASHeader_SetMax(LASHeaderH hHeader, double x, double y, double z);
 
-/** Returns the proj.4 string describing the spatial reference of the 
- *  header if it is available
- *  @param hHeader LASHeaderH instance
- *  @return the proj.4 string or NULL if none is available.  The caller
- *  owns the string.
-*/
-LAS_DLL char* LASHeader_GetProj4(LASHeaderH hHeader);
-
-/** Sets the proj4 stirng describing the spatial reference of the header.
- *  @param hHeader LASHeaderH instance
- *  @param value the proj4 string to set for the header
- *  @return LASError enum
-*/
-LAS_DLL LASError LASHeader_SetProj4(LASHeaderH hHeader, const char* value);
-
 /** Returns the VLR record for the given index.  Use LASHeader_GetRecordsCount to 
  *  determine the number of VLR records available on the header.
  *  @param hHeader the LASHeaderH instance

Modified: trunk/include/liblas/lasheader.hpp
==============================================================================
--- trunk/include/liblas/lasheader.hpp	(original)
+++ trunk/include/liblas/lasheader.hpp	Fri Feb 20 17:44:51 2009
@@ -322,13 +322,7 @@
     /// Removes a VLR from the the header.
     void DeleteVLR(uint32_t index);
 
-    /// Fetch the georeference as a PROJ.4 definition string.
-    std::string GetProj4() const;
-    
-    /// Set the georeference as a proj.4 string
-    void SetProj4(std::string const& v);
-    
-	/// Rewrite variable-length record with georeference infomation, if available.
+    /// Rewrite variable-length record with georeference infomation, if available.
     void SetGeoreference();
     
     /// Fetch the georeference

Modified: trunk/python/liblas/core.py
==============================================================================
--- trunk/python/liblas/core.py	(original)
+++ trunk/python/liblas/core.py	Fri Feb 20 17:44:51 2009
@@ -430,12 +430,6 @@
 las.LASHeader_SetMax.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.c_double, ctypes.c_double]
 las.LASHeader_SetMax.errcheck = check_return
 
-las.LASHeader_GetProj4.argtypes = [ctypes.c_void_p]
-las.LASHeader_GetProj4.errcheck = check_value_free
-las.LASHeader_SetProj4.restype = ctypes.c_int
-las.LASHeader_SetProj4.argtypes = [ctypes.c_void_p, ctypes.c_char_p]
-las.LASHeader_SetProj4.errcheck = check_return
-
 las.LASHeader_GetVLR.argtypes = [ctypes.c_void_p, ctypes.c_int]
 las.LASHeader_GetVLR.errcheck = check_void
 las.LASHeader_GetVLR.restype = ctypes.c_void_p

Modified: trunk/python/liblas/header.py
==============================================================================
--- trunk/python/liblas/header.py	(original)
+++ trunk/python/liblas/header.py	Fri Feb 20 17:44:51 2009
@@ -360,12 +360,7 @@
         return core.las.LASHeader_SetMax(self.handle, value[0], value[1], value[2])
     max = property(get_max, set_max)
 
-    def get_proj4(self):
-        return core.las.LASHeader_GetProj4(self.handle)
-    def set_proj4(self, value):
-        return core.las.LASHeader_SetProj4(self.handle, value)
-    proj4 = property(get_proj4, set_proj4)
-    
+
     def GetVLR(self, value):
         return vlr.VLR(handle=core.las.LASHeader_GetVLR(self.handle, value))
 

Modified: trunk/python/tests/Header.txt
==============================================================================
--- trunk/python/tests/Header.txt	(original)
+++ trunk/python/tests/Header.txt	Fri Feb 20 17:44:51 2009
@@ -90,12 +90,6 @@
   >>> h.header_size
   227
   
-  >>> h.proj4
-  ''
-  >>> h.proj4 = '+proj=utm +zone=17 +ellps=WGS84 +units=m'
-  >>> h.proj4
-  '+proj=utm +zone=17 +ellps=WGS84 +units=m'
-
   >>> s = h.srs
   >>> s.proj4
   ''
\ No newline at end of file

Modified: trunk/src/detail/reader.cpp
==============================================================================
--- trunk/src/detail/reader.cpp	(original)
+++ trunk/src/detail/reader.cpp	Fri Feb 20 17:44:51 2009
@@ -154,11 +154,6 @@
     // on the way out.
     m_in_srs = srs;
     
-    if (vlrs.size()) {
-        if (srs.GetProj4().size())
-            header.SetProj4(srs.GetProj4());
-    }
-    
     return true;
 
 }

Modified: trunk/src/las_c_api.cpp
==============================================================================
--- trunk/src/las_c_api.cpp	(original)
+++ trunk/src/las_c_api.cpp	Fri Feb 20 17:44:51 2009
@@ -1183,30 +1183,6 @@
     return LE_None;
 }
 
-LAS_DLL char* LASHeader_GetProj4(LASHeaderH hHeader) 
-{
-    VALIDATE_POINTER1(hHeader, "LASHeader_GetProj4", NULL);
-    LASHeader* header = (LASHeader*)hHeader;
-
-    return strdup((header)->GetProj4().c_str());
-    
-}
-LAS_DLL LASErrorEnum LASHeader_SetProj4(LASHeaderH hHeader, const char* value)
-{
-    VALIDATE_POINTER1(hHeader, "LASHeader_SetProj4", LE_Failure);
-    VALIDATE_POINTER1(value, "LASHeader_SetProj4", LE_Failure);
-
-    try {
-         ((LASHeader*) hHeader)->SetProj4(value);
-    }
-    catch (std::exception const& e) {
-        LASError_PushError(LE_Failure, e.what(), "LASHeader_SetProj4");
-        return LE_Failure;
-    }
-
-    return LE_None;
-}
-
 
 LAS_DLL LASWriterH LASWriter_Create(const char* filename, const LASHeaderH hHeader, int mode) {
     VALIDATE_POINTER1(hHeader, "LASWriter_Create", NULL); 

Modified: trunk/src/lasheader.cpp
==============================================================================
--- trunk/src/lasheader.cpp	(original)
+++ trunk/src/lasheader.cpp	Fri Feb 20 17:44:51 2009
@@ -605,17 +605,6 @@
     
 }
 
-/// Fetch the Georeference as a proj.4 string
-std::string LASHeader::GetProj4() const 
-{
-    return m_proj4;
-}
-
-       
-void LASHeader::SetProj4(std::string const& v)
-{
-    m_proj4 = v;
-}
 
 void LASHeader::Init()
 {


More information about the Liblas-commits mailing list