[Liblas-commits] hg: remove unused variable

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Jan 11 11:55:56 EST 2011


details:   http://hg.liblas.orghg/rev/361da5835f89
changeset: 2722:361da5835f89
user:      Howard Butler <hobu.inc at gmail.com>
date:      Tue Jan 11 10:50:24 2011 -0600
description:
remove unused variable
Subject: hg: add filtering to ts2las

details:   http://hg.liblas.orghg/rev/2dd81ebc17b3
changeset: 2723:2dd81ebc17b3
user:      Howard Butler <hobu.inc at gmail.com>
date:      Tue Jan 11 10:55:37 2011 -0600
description:
add filtering to ts2las

diffstat:

 apps/ts2las.cpp |  18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diffs (53 lines):

diff -r 47ff872c9d5b -r 2dd81ebc17b3 apps/ts2las.cpp
--- a/apps/ts2las.cpp	Tue Jan 11 10:49:21 2011 -0600
+++ b/apps/ts2las.cpp	Tue Jan 11 10:55:37 2011 -0600
@@ -289,12 +289,11 @@
 
 int main(int argc, char* argv[])
 {
-    int rc = 0;
-
     std::string input;
     std::string output;
     bool verbose = false;
-
+    std::vector<liblas::FilterPtr> filters;
+    
     po::options_description ts2las_options("ts2las options");
     po::options_description filtering_options = GetFilteringOptions();
     po::positional_options_description p;
@@ -324,7 +323,16 @@
         return 1;
     }
     
+    if (input.empty())
+    {
+        std::cerr << "No input TerraSolid .bin file was specfied!" << std::endl;
+        OutputHelp(std::cout, options);
+        return 1;
+    }
     
+    
+    filters = GetFilters(vm, verbose);
+
     if (verbose)
         std::cout << "input: " << input<<  " output: " <<output<<std::endl;
     
@@ -334,7 +342,7 @@
     bool opened = liblas::Open(istrm, input);
     if (!opened)
     {
-        std::cerr << "Could not open file " << input << " to read TerraSolid .bin data! " << std::endl;
+        std::cerr << "Could not open file '" << input << "' to read TerraSolid .bin data! " << std::endl;
         return 1;
     }
     
@@ -358,6 +366,8 @@
     liblas::Header header = CreateHeader(hdr, verbose);
     liblas::Writer writer(ostrm, header);
     
+    writer.SetFilters(filters);
+    
     success = WritePoints(writer, istrm, hdr, verbose);
 
     if (verbose)


More information about the Liblas-commits mailing list