[Liblas-commits] hg: 8 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Dec 17 23:24:54 EST 2010


changeset e84404c6c036 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=e84404c6c036
summary: VS2010 lint

changeset 9c11fbfb9f9d in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=9c11fbfb9f9d
summary: trying to add -WITH_LZIP

changeset 72240c1575a0 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=72240c1575a0
summary: pull-merge

changeset adb2962dee50 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=adb2962dee50
summary: pull-merge

changeset 9e1b6454bae1 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=9e1b6454bae1
summary: pull-merge

changeset 79ab406474a5 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=79ab406474a5
summary: liblas, meet liblaszip -- start of implementation of laszipreader factory

changeset 4c6fd0db6a54 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=4c6fd0db6a54
summary: pull-merge

changeset 0d9e89f22e0f in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=0d9e89f22e0f
summary: c/p typo

diffstat:

 .hgignore                                      |     7 +
 CMakeLists.txt                                 |    17 +-
 apps/CMakeLists.txt                            |     3 +-
 apps/las2las.cpp                               |    14 +-
 apps/las2oci.cpp                               |     7 +-
 apps/lasblock.cpp                              |   288 ++-
 apps/lasinfo.cpp                               |     6 +-
 apps/laskernel.cpp                             |    35 +-
 cmake/modules/BuildOSGeo4W.cmake               |     1 +
 doc/development/buildbot.txt                   |    55 +-
 doc/development/rfc/index.txt                  |     1 +
 doc/development/rfc/rfc_1_verticalcs.txt       |     4 +-
 doc/development/rfc/rfc_2_spatialreference.txt |   188 ++
 doc/download.txt                               |    43 +-
 doc/start.txt                                  |   107 +-
 doc/utilities/las2las.txt                      |    10 +-
 doc/utilities/las2txt.txt                      |   154 +-
 include/liblas/capi/las_version.h              |     2 +-
 include/liblas/capi/liblas.h                   |    13 +-
 include/liblas/detail/fwd.hpp                  |     4 +
 include/liblas/detail/reader/reader.hpp        |    11 -
 include/liblas/detail/reader/zipreader.hpp     |   115 +
 include/liblas/detail/writer/base.hpp          |     5 +-
 include/liblas/detail/writer/writer.hpp        |    22 +-
 include/liblas/factory.hpp                     |   104 +
 include/liblas/lasheader.hpp                   |   882 +++++-----
 include/liblas/lasreader.hpp                   |    21 +-
 include/liblas/lasspatialreference.hpp         |    65 +-
 include/liblas/lastransform.hpp                |     1 +
 include/liblas/lasversion.hpp                  |    58 +-
 include/liblas/laswriter.hpp                   |    22 +-
 include/liblas/liblas.hpp                      |    15 +-
 include/liblas/utility.hpp                     |     2 +-
 liblas-osgeo4w-init.bat                        |     2 -
 liblas-osgeo4w-start.bat.tmpl                  |     4 +-
 python/tests/SRS-GDAL.txt                      |     2 +-
 src/CMakeLists.txt                             |     9 +-
 src/detail/reader/header.cpp                   |   913 ++++++-----
 src/detail/reader/reader.cpp                   |   562 +++---
 src/detail/reader/zipreader.cpp                |   264 +++
 src/detail/writer/base.cpp                     |     1 +
 src/detail/writer/writer.cpp                   |    66 +-
 src/factory.cpp                                |   117 +
 src/las_c_api.cpp                              |    22 +-
 src/lasheader.cpp                              |  1835 ++++++++++++-----------
 src/lasindex.cpp                               |     2 +-
 src/laspoint.cpp                               |   142 +-
 src/lasreader.cpp                              |    42 +-
 src/lasspatialreference.cpp                    |   216 ++-
 src/lastransform.cpp                           |     2 +-
 src/lasversion.cpp                             |   113 +
 src/laswriter.cpp                              |   100 +-
 test/unit/lasspatialreference_test.cpp         |   149 +-
 test/unit/laswriter_test.cpp                   |    38 +-
 54 files changed, 4263 insertions(+), 2620 deletions(-)

diffs (truncated from 8227 to 300 lines):

diff -r b45eee7c24ab -r 0d9e89f22e0f .hgignore
--- a/.hgignore	Fri Dec 10 14:55:24 2010 -0600
+++ b/.hgignore	Fri Dec 17 20:24:35 2010 -0800
@@ -98,3 +98,10 @@
 osgeo4w/
 test/data/Autzen_Stadium/
 DartConfiguration.tcl
+
+# stuff generated by VS2010
+*.ipch
+*.vcxproj
+*.vcxproj.filters
+libLAS.opensdf
+libLAS.sdf
diff -r b45eee7c24ab -r 0d9e89f22e0f CMakeLists.txt
--- a/CMakeLists.txt	Fri Dec 10 14:55:24 2010 -0600
+++ b/CMakeLists.txt	Fri Dec 17 20:24:35 2010 -0800
@@ -272,6 +272,15 @@
   endif()
 endif()
 
+# LASZIP support - optional, default=OFF
+set(WITH_LASZIP FALSE CACHE BOOL "Choose if LASZIP support should be built")
+if(WITH_LASZIP)
+  include_directories(${LASZIP_INCLUDE_DIR})
+  add_definitions(-DHAVE_LASZIP=1)
+  mark_as_advanced(CLEAR LASZIP_INCLUDE_DIR) 
+  mark_as_advanced(CLEAR LASZIP_LIBRARY) 
+endif()
+
 ###############################################################################
 # Installation settings
 
@@ -376,7 +385,7 @@
 list(APPEND CPACK_SOURCE_IGNORE_FILES ".hg")
 list(APPEND CPACK_SOURCE_IGNORE_FILES "README")
 list(APPEND CPACK_SOURCE_IGNORE_FILES "HOWTORELEASE.txt")
-list(APPEND CPACK_SOURCE_IGNORE_FILES "doc")
+list(APPEND CPACK_SOURCE_IGNORE_FILES "/doc/_static/files")
 
 list(APPEND CPACK_SOURCE_IGNORE_FILES "CMakeCache.txt")
 
@@ -390,6 +399,6 @@
 
 add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
 
-if (WIN32)
-    include(BuildOSGeo4W)
-endif(WIN32)
+#if (WIN32)
+#    include(BuildOSGeo4W)
+#endif(WIN32)
diff -r b45eee7c24ab -r 0d9e89f22e0f apps/CMakeLists.txt
--- a/apps/CMakeLists.txt	Fri Dec 10 14:55:24 2010 -0600
+++ b/apps/CMakeLists.txt	Fri Dec 17 20:24:35 2010 -0800
@@ -79,6 +79,7 @@
     ${GEOTIFF_LIBRARY}
     ${GDAL_LIBRARY}
     ${SPATIALINDEX_LIBRARY}
+	${LASZIP_LIBRARY}
     ${Boost_LIBRARIES})
 
 link_directories(${Boost_LIBRARY_DIRS})
@@ -144,7 +145,7 @@
 
 # Build lasblock
 if(LASBLOCK)
-    set(LASBLOCK_SRC lasblock.cpp )
+    set(LASBLOCK_SRC lasblock.cpp laskernel.cpp)
     add_executable(${LASBLOCK} ${LASBLOCK_SRC})
     target_link_libraries(${LASBLOCK} ${APPS_CPP_DEPENDENCIES} )
 endif()
diff -r b45eee7c24ab -r 0d9e89f22e0f apps/las2las.cpp
--- a/apps/las2las.cpp	Fri Dec 10 14:55:24 2010 -0600
+++ b/apps/las2las.cpp	Fri Dec 17 20:24:35 2010 -0800
@@ -205,6 +205,12 @@
         RepairHeader(*summary, hnew);
         RewriteHeader(hnew, output);
     }
+
+    // cheap hackery.  We need the Writer to disappear before the stream.  
+    // Fix this up to not suck so bad.
+    writer = WriterPtr();   
+    ofs = OStreamPtr();
+    
     return true;
 }
 
@@ -216,9 +222,9 @@
 
     oss << options;
 
-    oss <<"\nFor more information, see the full documentation for las2las2 at:\n";
+    oss <<"\nFor more information, see the full documentation for las2las at:\n";
     
-    oss << " http://liblas.org/utilities/las2las2.html\n";
+    oss << " http://liblas.org/utilities/las2las.html\n";
     oss << "----------------------------------------------------------\n";
 
 }
@@ -241,7 +247,7 @@
 
     try {
 
-        po::options_description file_options("las2las2 options");
+        po::options_description file_options("las2las options");
         po::options_description filtering_options = GetFilteringOptions();
         po::options_description header_options = GetHeaderOptions();
         po::options_description transform_options = GetTransformationOptions() ;
@@ -346,4 +352,4 @@
 
 }
 
-//las2las2 -i lt_srs_rt.las  -o foo.las -c 1,2 -b 2483590,366208,2484000,366612
+//las2las -i lt_srs_rt.las  -o foo.las -c 1,2 -b 2483590,366208,2484000,366612
diff -r b45eee7c24ab -r 0d9e89f22e0f apps/las2oci.cpp
--- a/apps/las2oci.cpp	Fri Dec 10 14:55:24 2010 -0600
+++ b/apps/las2oci.cpp	Fri Dec 17 20:24:35 2010 -0800
@@ -1112,7 +1112,12 @@
         
         liblas::Reader* reader2 = 0;
         if (bCachedReader)
-            reader2 = new liblas::Reader(*istrm2,0);
+        {
+            liblas::ReaderFactory rf;
+            liblas::Reader r = rf.CreateCached(*istrm2, 0);
+            reader2 = new liblas::Reader(r);
+            // reader2 = new liblas::Reader(*istrm2,0);
+        }
         else
             reader2 = new liblas::Reader(*istrm2);
 
diff -r b45eee7c24ab -r 0d9e89f22e0f apps/lasblock.cpp
--- a/apps/lasblock.cpp	Fri Dec 10 14:55:24 2010 -0600
+++ b/apps/lasblock.cpp	Fri Dec 17 20:24:35 2010 -0800
@@ -11,6 +11,7 @@
 //
 #include <liblas/liblas.hpp>
 #include <liblas/chipper.hpp>
+#include "laskernel.hpp"
 
 // std
 #include <fstream>
@@ -36,127 +37,127 @@
 #define compare_no_case(a,b,n)  strncasecmp( (a), (b), (n) )
 #endif
 
-bool term_progress(std::ostream& os, double complete)
+typedef boost::shared_ptr<liblas::Writer> WriterPtr;
+typedef boost::shared_ptr<liblas::Summary> SummaryPtr;
+typedef boost::shared_ptr<std::ofstream> OStreamPtr;
+
+WriterPtr start_writer(   OStreamPtr strm, 
+                          std::string const& output, 
+                          liblas::Header const& header)
 {
-    static int lastTick = -1;
-    int tick = static_cast<int>(complete * 40.0);
-
-    tick = std::min(40, std::max(0, tick));
-
-    // Have we started a new progress run?  
-    if (tick < lastTick && lastTick >= 39)
-        lastTick = -1;
-
-    if (tick <= lastTick)
-        return true;
-
-    while (tick > lastTick)
+    
+    if (!liblas::Create(*strm, output.c_str()))
     {
-        lastTick++;
-        if (lastTick % 4 == 0)
-            os << (lastTick / 4) * 10;
-        else
-            os << ".";
+        std::ostringstream oss;
+        oss << "Cannot create " << output << "for write.  Exiting...";
+        throw std::runtime_error(oss.str());
     }
 
-    if( tick == 40 )
-        os << " - done.\n";
-    else
-        os.flush();
-
-    return true;
+    WriterPtr writer( new liblas::Writer(*strm, header));
+    return writer;
+    
 }
 
 
 using namespace liblas;
 
+void OutputHelp( std::ostream & oss, po::options_description const& options)
+{
+    oss << "--------------------------------------------------------------------\n";
+    oss << "    lasblock (" << GetFullVersion() << ")\n";
+    oss << "--------------------------------------------------------------------\n";
 
-int main(int argc, char* argv[])
+    oss << options;
+
+    oss <<"\nFor more information, see the full documentation for lasblock at:\n";
+    
+    oss << " http://liblas.org/utilities/block.html\n";
+    oss << "----------------------------------------------------------\n";
+
+}
+
+
+void write_tiles(std::string& output, 
+                 liblas::chipper::Chipper& c, 
+                 liblas::Reader& reader, 
+                 bool verbose)
 {
-    std::string input;
-    std::string output;
-    
-    long capacity = 3000;
-    long precision = 8;
-    bool verbose = false;
 
 
-    po::options_description desc("Allowed lasblock options");
-    po::positional_options_description p;
-    p.add("input", 1);
-    p.add("output", 1);
-
-    desc.add_options()
-        ("help,h", "Produce this help message")
-        ("capacity,c", po::value<long>(&capacity)->default_value(3000), "Number of points to nominally put into each block (note that this number will not be exact)")
-        ("precision,p", po::value<long>(&precision)->default_value(8), "Number of decimal points to write for each bbox")
-        ("input,i", po::value< std::string >(), "input LAS file")
-        ("output,o", po::value< std::string >(&output)->default_value(""), "The output .kdx file (defaults to input filename + .kdx)")
-        ("verbose,v", po::value<bool>(&verbose)->zero_tokens(), "Verbose message output")
-
-    ;
-    
-    po::variables_map vm;        
-    po::store(po::command_line_parser(argc, argv).
-      options(desc).positional(p).run(), vm);
-
-    po::notify(vm);
-
-    if (vm.count("help")) 
-    {
-        std::cout << desc << "\n";
-            std::cout <<"\nFor more information, see the full documentation for lasblock at:\n";
-            
-            std::cout << " http://liblas.org/utilities/block.html\n";
-            std::cout << "----------------------------------------------------------\n";
-        return 1;
-    }
-        
-    if (vm.count("input")) 
-    {
-        input = vm["input"].as< std::string >();
-        std::ifstream ifs;
-
-        if (!liblas::Open(ifs, input.c_str()))
-        {
-            std::cerr << "Cannot open file '" << input << "'for read.  Exiting...";
-            return 1;
-        }
-    } 
+    std::string out = output;
     
 
-    if (output.empty())
+
+    
+    liblas::Header header = reader.GetHeader();
+    
+    std::string::size_type dot_pos = output.find_first_of(".");
+    out = output.substr(0, dot_pos);
+    
+
+    if (verbose)
+        std::cout << "Writing " << c.GetBlockCount() << " blocks to " << output << std::endl;
+
+    boost::uint32_t prog = 0;
+    
+    for ( boost::uint32_t i = 0; i < c.GetBlockCount(); ++i )
     {
-        output = std::string(input) + ".kdx";
+        OStreamPtr ofs(new std::ofstream);
+        SummaryPtr summary(new::liblas::Summary);
+
+        std::ostringstream name;
+        name << out << "-" << i <<".las";
+
+        const liblas::chipper::Block& b = c.GetBlock(i);
+        header.SetExtent(b.GetBounds());
+
+        WriterPtr writer = start_writer(ofs, name.str(), header);
+
+        


More information about the Liblas-commits mailing list