[Liblas-commits] laszip: switching on LASzip v2.0 with chunking

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Jun 23 18:46:20 EDT 2011


details:   http://hg.liblas.orglaszip/rev/3a95147cf872
changeset: 254:3a95147cf872
user:      isenburg
date:      Thu Jun 23 15:43:36 2011 -0700
description:
switching on LASzip v2.0 with chunking
Subject: laszip: formulation

details:   http://hg.liblas.orglaszip/rev/82caca9b9a7b
changeset: 255:82caca9b9a7b
user:      isenburg
date:      Thu Jun 23 15:45:21 2011 -0700
description:
formulation
Subject: laszip: merge

details:   http://hg.liblas.orglaszip/rev/ee32a166b79c
changeset: 256:ee32a166b79c
user:      isenburg
date:      Thu Jun 23 15:46:15 2011 -0700
description:
merge
Subject: laszip: switching on LASzip v2.0 with chunking

details:   http://hg.liblas.orglaszip/rev/4f8b0216c71b
changeset: 257:4f8b0216c71b
user:      isenburg
date:      Thu Jun 23 15:48:07 2011 -0700
description:
switching on LASzip v2.0 with chunking
Subject: laszip: updates test

details:   http://hg.liblas.orglaszip/rev/a5b6753ac08d
changeset: 258:a5b6753ac08d
user:      isenburg
date:      Thu Jun 23 15:48:49 2011 -0700
description:
updates test

diffstat:

 .hgtags                   |   1 +
 CMakeLists.txt            |   6 +++---
 HOWTORELEASE.txt          |  13 +++++++++----
 configure.ac              |   4 ++--
 docs/source/index.rst     |  12 ++++++------
 include/laszip/laszip.hpp |  45 ++++++++++++++++++++++++---------------------
 src/laszip.cpp            |  33 +++++++++++++++------------------
 tools/laszippertest.cpp   |  10 +++++-----
 8 files changed, 65 insertions(+), 59 deletions(-)

diffs (truncated from 347 to 300 lines):

diff -r 0bf6c8e259d1 -r a5b6753ac08d .hgtags
--- a/.hgtags	Wed Jun 22 09:13:09 2011 -0700
+++ b/.hgtags	Thu Jun 23 15:48:49 2011 -0700
@@ -1,2 +1,3 @@
 a216ab3ddb11e21d0db830e2f68f6a20cc64d3e0 1.0.1
 8144ee77b7704e0fe45a75fa33c777bb45335ffb 1.2.0
+037abfa227a0e8f16d3100f5d01ed91e16247b19 2.0.0
diff -r 0bf6c8e259d1 -r a5b6753ac08d CMakeLists.txt
--- a/CMakeLists.txt	Wed Jun 22 09:13:09 2011 -0700
+++ b/CMakeLists.txt	Thu Jun 23 15:48:49 2011 -0700
@@ -9,11 +9,11 @@
 project(laszip)
 
 
-SET(LASZIP_VERSION_MAJOR "1")
-SET(LASZIP_VERSION_MINOR "2")
+SET(LASZIP_VERSION_MAJOR "2")
+SET(LASZIP_VERSION_MINOR "0")
 SET(LASZIP_VERSION_PATCH "0")
 set(VERSION "${LASZIP_VERSION_MAJOR}.${LASZIP_VERSION_MINOR}.${LASZIP_VERSION_PATCH}")
-SET(LASZIP_LIB_SOVERSION "3.0.1")
+SET(LASZIP_LIB_SOVERSION "4.0.1")
 
 # Name of C++ library
 set(LASZIP_LIB_NAME laszip)
diff -r 0bf6c8e259d1 -r a5b6753ac08d HOWTORELEASE.txt
--- a/HOWTORELEASE.txt	Wed Jun 22 09:13:09 2011 -0700
+++ b/HOWTORELEASE.txt	Thu Jun 23 15:48:49 2011 -0700
@@ -19,16 +19,21 @@
  
   - CMakeLists.txt
    
-    * SET(LASZIP_VERSION_MAJOR "1")
+    * SET(LASZIP_VERSION_MAJOR "2")
     * SET(LASZIP_VERSION_MINOR "0")
-    * SET(LASZIP_VERSION_PATCH "0b1")
+    * SET(LASZIP_VERSION_PATCH "0")
     
   - include/laszip/laszip.hpp
 
-    * #define LASZIP_VERSION_MAJOR    1
+    * #define LASZIP_VERSION_MAJOR    2
     * #define LASZIP_VERSION_MINOR    0
-    * #define LASZIP_VERSION_REV      0b1
+    * #define LASZIP_VERSION_REV      0
 
+  - configure.ac
+    
+    * m4_define([laszip_version_major], [2])
+    * m4_define([laszip_version_minor], [0])
+    * m4_define([laszip_version_micro], [0])
 
 
 2) Update README to include any relevant info about the release that 
diff -r 0bf6c8e259d1 -r a5b6753ac08d configure.ac
--- a/configure.ac	Wed Jun 22 09:13:09 2011 -0700
+++ b/configure.ac	Thu Jun 23 15:48:49 2011 -0700
@@ -2,9 +2,9 @@
 dnl
 dnl This is main autoconf bootstrap script of libLAS project.
 dnl
-m4_define([laszip_version_major], [1])
+m4_define([laszip_version_major], [2])
 m4_define([laszip_version_minor], [0])
-m4_define([laszip_version_micro], [b1])
+m4_define([laszip_version_micro], [0])
 m4_define([laszip_version],
           [laszip_version_major.laszip_version_minor.laszip_version_micro])
 
diff -r 0bf6c8e259d1 -r a5b6753ac08d docs/source/index.rst
--- a/docs/source/index.rst	Wed Jun 22 09:13:09 2011 -0700
+++ b/docs/source/index.rst	Thu Jun 23 15:48:49 2011 -0700
@@ -14,13 +14,13 @@
 Source
 ..............................................................................
 
-* **2011-04-05** 
+* **2011-06-23** 
 
-  - `laszip-1.2.0-src.tar.gz <http://download.osgeo.org/laszip/laszip-1.2.0.tar.gz>`_ 
-    `(md5) <http://download.osgeo.org/laszip/laszip-1.2.0.tar.gz.md5>`__ 
+  - `laszip-2.0.0-src.tar.gz <http://download.osgeo.org/laszip/laszip-2.0.0.tar.gz>`_ 
+    `(md5) <http://download.osgeo.org/laszip/laszip-2.0.0.tar.gz.md5>`__ 
 
-  - `laszip-1.2.0-src.zip <http://download.osgeo.org/laszip/laszip-1.2.0.zip>`_ 
-    `(md5) <http://download.osgeo.org/liblas/laszip-1.2.0.zip.md5>`__
+  - `laszip-2.0.0-src.zip <http://download.osgeo.org/laszip/laszip-2.0.0.zip>`_ 
+    `(md5) <http://download.osgeo.org/liblas/laszip-2.0.0.zip.md5>`__
 
 Binaries
 ..............................................................................
@@ -29,7 +29,7 @@
     include files to compile LASzip into your own application. `libLAS`_ 
     binaries through `OSGeo4W`_ also link LASzip.
 
-  - A Windows binary `laszip.exe`_ and a simple makefile to build `laszip`_ are
+  - A Windows binary `laszip.exe`_ and a Linux makefile to build `laszip`_ are
     available for explicit compression (decompression) of LAS (LAZ) files.    
 
 
diff -r 0bf6c8e259d1 -r a5b6753ac08d include/laszip/laszip.hpp
--- a/include/laszip/laszip.hpp	Wed Jun 22 09:13:09 2011 -0700
+++ b/include/laszip/laszip.hpp	Thu Jun 23 15:48:49 2011 -0700
@@ -1,13 +1,13 @@
-/*
-===============================================================================
-
-  FILE:  laszip.hpp
-  
-  CONTENTS:
-  
+/*
+===============================================================================
+
+  FILE:  laszip.hpp
+  
+  CONTENTS:
+  
     Contains LASitem and LASchunk structs as well as the IDs of the currently
-    supported entropy coding scheme
-
+    supported entropy coding scheme
+
   PROGRAMMERS:
   
     martin.isenburg at gmail.com
@@ -25,16 +25,17 @@
   
   CHANGE HISTORY:
   
+    23 June 2011 -- turned on LASzip version 2.0 compressor with chunking 
     8 May 2011 -- added an option for variable chunking via chunk()
     23 April 2011 -- changed interface for simplicity and chunking support
     20 March 2011 -- incrementing LASZIP_VERSION to 1.2 for improved compression
     10 January 2011 -- licensing change for LGPL release and liblas integration
     12 December 2010 -- refactored from lasdefinitions after movies with silke
-  
-===============================================================================
-*/
-#ifndef LASZIP_HPP
-#define LASZIP_HPP
+  
+===============================================================================
+*/
+#ifndef LASZIP_HPP
+#define LASZIP_HPP
 
 #if defined(_MSC_VER) && (_MSC_VER < 1300)
 #define LZ_WIN32_VC6
@@ -43,8 +44,8 @@
 typedef long long SIGNED_INT64;
 #endif
 
-#define LASZIP_VERSION_MAJOR    1
-#define LASZIP_VERSION_MINOR    2
+#define LASZIP_VERSION_MAJOR    2
+#define LASZIP_VERSION_MINOR    0
 #define LASZIP_VERSION_REVISION 0
 
 #define LASZIP_COMPRESSOR_NONE              0
@@ -52,8 +53,10 @@
 #define LASZIP_COMPRESSOR_POINTWISE_CHUNKED 2
 #define LASZIP_COMPRESSOR_TOTAL_NUMBER_OF   3
 
-#define LASZIP_COMPRESSOR_DEFAULT LASZIP_COMPRESSOR_POINTWISE
 #define LASZIP_COMPRESSOR_CHUNKED LASZIP_COMPRESSOR_POINTWISE_CHUNKED
+#define LASZIP_COMPRESSOR_NOT_CHUNKED LASZIP_COMPRESSOR_POINTWISE
+
+#define LASZIP_COMPRESSOR_DEFAULT LASZIP_COMPRESSOR_CHUNKED
 
 #define LASZIP_CODER_ARITHMETIC             0
 #define LASZIP_CODER_TOTAL_NUMBER_OF        1
@@ -85,8 +88,8 @@
 
   // go back and forth between item array and point type & size
   bool setup(unsigned short* num_items, LASitem** items, const unsigned char point_type, const unsigned short point_size, const unsigned short compressor=LASZIP_COMPRESSOR_NONE);
-  bool is_standard(const unsigned short num_items, const LASitem* items, unsigned char* point_type=0, unsigned short* record_length=0) const;
-  bool is_standard(unsigned char* point_type=0, unsigned short* record_length=0) const;
+  bool is_standard(const unsigned short num_items, const LASitem* items, unsigned char* point_type=0, unsigned short* record_length=0);
+  bool is_standard(unsigned char* point_type=0, unsigned short* record_length=0);
 
   // pack to and unpack from VLR
   unsigned char* bytes;
@@ -95,7 +98,7 @@
 
   // setup
   bool setup(const unsigned char point_type, const unsigned short point_size, const unsigned short compressor=LASZIP_COMPRESSOR_DEFAULT);
-  bool setup(const unsigned short num_items, const LASitem* items, const unsigned short compressor=LASZIP_COMPRESSOR_DEFAULT);
+  bool setup(const unsigned short num_items, const LASitem* items, const unsigned short compressor);
   bool set_chunk_size(const unsigned int chunk_size);             /* for compressor only */
   bool request_version(const unsigned short requested_version);   /* for compressor only */
 
@@ -123,4 +126,4 @@
   char* error_string;
 };
 
-#endif
+#endif
diff -r 0bf6c8e259d1 -r a5b6753ac08d src/laszip.cpp
--- a/src/laszip.cpp	Wed Jun 22 09:13:09 2011 -0700
+++ b/src/laszip.cpp	Thu Jun 23 15:48:49 2011 -0700
@@ -45,7 +45,7 @@
   version_revision = LASZIP_VERSION_REVISION;
   options = 0;
   num_items = 0;
-  chunk_size = 0;
+  chunk_size = LASZIP_CHUNK_SIZE_DEFAULT;
   num_points = -1;
   num_bytes = -1;
   error_string = 0;
@@ -362,10 +362,6 @@
     return return_error(error);
   }
 
-  // choose version
-  U16 version = 0;
-  if (compressor) version = 1;
-
   // create item description
 
   (*num_items) = 1 + !!(have_gps_time) + !!(have_rgb) + !!(have_wavepacket) + !!(extra_bytes_number);
@@ -374,35 +370,36 @@
   U16 i = 1;
   (*items)[0].type = LASitem::POINT10;
   (*items)[0].size = 20;
-  (*items)[0].version = version;
+  (*items)[0].version = 0;
   if (have_gps_time)
   {
     (*items)[i].type = LASitem::GPSTIME11;
     (*items)[i].size = 8;
-    (*items)[i].version = version;
+    (*items)[i].version = 0;
     i++;
   }
   if (have_rgb)
   {
     (*items)[i].type = LASitem::RGB12;
     (*items)[i].size = 6;
-    (*items)[i].version = version;
+    (*items)[i].version = 0;
     i++;
   }
   if (have_wavepacket)
   {
     (*items)[i].type = LASitem::WAVEPACKET13;
     (*items)[i].size = 29;
-    (*items)[i].version = version;
+    (*items)[i].version = 0;
     i++;
   }
   if (extra_bytes_number)
   {
     (*items)[i].type = LASitem::BYTE;
     (*items)[i].size = extra_bytes_number;
-    (*items)[i].version = version;
+    (*items)[i].version = 0;
     i++;
   }
+  if (compressor) request_version(2);
   assert(i == *num_items);
   return true;
 }
@@ -445,20 +442,20 @@
         items[i].version = 1; // no version 2
         break;
     default:
-        return false;
+        return return_error("itrm type not supported");
     }
   }
   return true;
 }
 
-bool LASzip::is_standard(U8* point_type, U16* record_length) const
+bool LASzip::is_standard(U8* point_type, U16* record_length)
 {
   return is_standard(num_items, items, point_type, record_length);
 }
 
-bool LASzip::is_standard(const U16 num_items, const LASitem* items, U8* point_type, U16* record_length) const
+bool LASzip::is_standard(const U16 num_items, const LASitem* items, U8* point_type, U16* record_length)
 {
-  if (items == 0) return false;
+  if (items == 0) return return_error("LASitem array is zero");
 
   // this is always true
   if (point_type) *point_type = 127;
@@ -473,12 +470,12 @@
   }
 
   // the minimal number of items is 1
-  if (num_items < 1) return false;
+  if (num_items < 1) return return_error("less than one LASitem entries");
   // the maximal number of items is 5
-  if (num_items > 5) return false;
+  if (num_items > 5) return return_error("more than five LASitem entries");
 
   // all standard point types start with POINT10
-  if (!items[0].is_type(LASitem::POINT10)) return false;


More information about the Liblas-commits mailing list