[Liblas-commits] r1108 - trunk/src/detail

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Mar 17 13:12:31 EDT 2009


Author: hobu
Date: Tue Mar 17 13:12:30 2009
New Revision: 1108
URL: http://liblas.org/changeset/1108

Log:
oops #108

Modified:
   trunk/src/detail/writer.cpp

Modified: trunk/src/detail/writer.cpp
==============================================================================
--- trunk/src/detail/writer.cpp	(original)
+++ trunk/src/detail/writer.cpp	Tue Mar 17 13:12:30 2009
@@ -151,15 +151,14 @@
 #endif
 }
 
-void Writer::Project(LASPoint& point)
+void Writer::Project(PointRecord& point)
 {
 #ifdef HAVE_GDAL
     
-    // FIXME: This needs to ensure it is projecting scaled points
     int ret = 0;
-    double x = point.GetX();
-    double y = point.GetY();
-    double z = point.GetZ();
+    double x = point.x;
+    double y = point.y;
+    double z = point.z;
     
     ret = OCTTransform(m_transform, 1, &x, &y, &z);
     
@@ -170,54 +169,6 @@
         throw std::runtime_error(message);
     }
     
-
-    point.SetX(x);
-    point.SetY(y);
-    point.SetZ(z);
-#else
-    UNREFERENCED_PARAMETER(point);
-#endif
-}
-
-void Writer::SetSRS(const LASSRS& srs)
-{
-    m_out_srs = srs;
-#ifdef HAVE_GDAL
-    OGRSpatialReferenceH in_ref = OSRNewSpatialReference(0);
-    OGRSpatialReferenceH out_ref = OSRNewSpatialReference(0);
-
-    const char* in_wkt = m_in_srs.GetWKT().c_str();
-    if (OSRImportFromWkt(in_ref, (char**) &in_wkt) != OGRERR_NONE) 
-    {
-        throw std::runtime_error("Could not import input spatial reference for Reader::");
-    }
-    
-    const char* out_wkt = m_out_srs.GetWKT().c_str();
-    if (OSRImportFromWkt(out_ref, (char**) &out_wkt) != OGRERR_NONE) 
-    {
-        throw std::runtime_error("Could not import output spatial reference for Reader::");
-    }
-
-    m_transform = OCTNewCoordinateTransformation( in_ref, out_ref);
-    
-#endif
-}
-
-void Writer::Project(PointRecord& point)
-{
-#ifdef HAVE_GDAL
-    
-    int ret = 0;
-    double x = point.x;
-    double y = point.y;
-    double z = point.z;
-    
-    ret = OCTTransform(m_transform, 1, &x, &y, &z);
-    
-    if (ret != OGRERR_NONE) {
-        throw std::runtime_error("could not project point!");
-    }
-    
     // FIXME: PointRecords need to be descaled
     point.x = x;
     point.y = y;


More information about the Liblas-commits mailing list