Skip to content
Commits on Source (2)
21 February 2019 -- bug fix when writing 4,294,967,296 or more points uncompressed to LAS
28 December 2018 -- fix for LASzip v4 decompression of WavePacket part of PRDF 9 and 10
27 December 2018 -- upped to 3.2 r9 for bug fix in multi-channel NIR decompression
7 November 2018 -- laszip DLL: upped to 3.2 r8 for identical legacy and extended flags check
20 October 2018 -- fixed rare bug in LASinterval::merge_intervals()
5 October 2018 -- laszip DLL: upped to 3.2 r6 for corrected 'is_empty' return value in laszip_inside_rectangle()
......
......@@ -7,7 +7,7 @@ set(ROOT_DIR "${PROJECT_SOURCE_DIR}")
# the next line is the ONLY place in the entire laszip system where
# the version info is hard-coded
set(LASZIP_API_VERSION_STRING "3.2.8" CACHE STRING "LASzip version" FORCE)
set(LASZIP_API_VERSION_STRING "3.3.0" CACHE STRING "LASzip version" FORCE)
include (CheckIncludeFileCXX)
include(${ROOT_DIR}/cmake/common.cmake NO_POLICY_SCOPE)
......@@ -41,7 +41,7 @@ set(LASZIP_API_VERSION ${LASZIP_API_VERSION_MAJOR}.${LASZIP_API_VERSION_MINOR}.$
# libtool SO version naming
# 8.0.0 for 3.2.1
# 9.0.0 for 4.0+
set(LASZIP_SO_VERSION "8.0.1")
set(LASZIP_SO_VERSION "8.0.3")
set(LASZIP_COMPATIBILITY_VERSION 8)
check_include_file_cxx ("unordered_map" HAVE_UNORDERED_MAP)
......
......@@ -2,6 +2,12 @@
LASzip
================================================================================
3.2.9 27-DEC-18
--------------------------------------------------------------------------------
* Decompression bug for PRDF 8 or 10 when the scanner channel and the NIR field are populated.
3.2.8 19-NOV-18
--------------------------------------------------------------------------------
......
LASzip
--------------------------------------------------------
https://www.laszip.org/
https://laszip.org/
Testing
........................................................
......
......@@ -48,9 +48,9 @@ copyright = u'2018, Martin Isenburg'
# built documents.
#
# The short X.Y version.
version = '3.2.3'
version = '3.2.8'
# The full version, including alpha/beta/rc tags.
release = '3.2.3'
release = '3.2.8'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -9,15 +9,21 @@ LASzip - a free open source product of `rapidlasso GmbH <http://rapidlasso.com/>
Source
..............................................................................
* **2018-11-19**
* **2018-12-27**
- `laszip-3.2.8.tar.gz <https://github.com/LASzip/LASzip/releases/download/3.2.8/laszip-src-3.2.8.tar.gz>`_
`(md5) <https://github.com/LASzip/LASzip/releases/download/3.2.8/laszip-src-3.2.8.tar.gz.md5>`__
- `laszip-3.2.9.tar.gz <https://github.com/LASzip/LASzip/releases/download/3.2.9/laszip-src-3.2.9.tar.gz>`_
`(md5) <https://github.com/LASzip/LASzip/releases/download/3.2.9/laszip-src-3.2.9.tar.gz.md5>`__
Past Release(s)
~~~~~~~~~~~~~~~~~~~~~~~~~
* **2018-11-19**
- `laszip-3.2.8.tar.gz <https://github.com/LASzip/LASzip/releases/download/3.2.8/laszip-src-3.2.8.tar.gz>`_
`(md5) <https://github.com/LASzip/LASzip/releases/download/3.2.8/laszip-src-3.2.8.tar.gz.md5>`__
* **2018-03-27**
- `laszip-3.2.2.tar.gz <https://github.com/LASzip/LASzip/releases/download/3.2.2/laszip-src-3.2.2.tar.gz>`_
......
......@@ -145,6 +145,9 @@ public:
inline BOOL set_scale(F64 scale) { if (data_type) { this->scale[0] = scale; options |= 0x08; return TRUE; } return FALSE; };
inline BOOL set_offset(F64 offset) { if (data_type) { this->offset[0] = offset; options |= 0x10; return TRUE; } return FALSE; };
inline BOOL unset_scale() { if (data_type) { options &= (~0x08); return TRUE; } return FALSE; };
inline BOOL unset_offset() { if (data_type) { options &= (~0x10); return TRUE; } return FALSE; };
inline BOOL has_no_data() const { return options & 0x01; };
inline BOOL has_min() const { return options & 0x02; };
inline BOOL has_max() const { return options & 0x04; };
......@@ -156,8 +159,9 @@ public:
if (data_type)
{
const U32 size_table[10] = { 1, 1, 2, 2, 4, 4, 8, 8, 4, 8 };
U32 type = get_type();
return size_table[type];
I32 type = get_type();
I32 dim = get_dim();
return size_table[type] * dim;
}
else
{
......@@ -165,31 +169,100 @@ public:
}
};
inline F64 get_value_as_float(U8* value) const
inline F64 get_value_as_float(U8* pointer) const
{
F64 cast_value;
I32 type = get_type();
if (type == 0)
cast_value = (F64)*((U8*)pointer);
else if (type == 1)
cast_value = (F64)*((I8*)pointer);
else if (type == 2)
cast_value = (F64)*((U16*)pointer);
else if (type == 3)
cast_value = (F64)*((I16*)pointer);
else if (type == 4)
cast_value = (F64)*((U32*)pointer);
else if (type == 5)
cast_value = (F64)*((I32*)pointer);
else if (type == 6)
cast_value = (F64)(I64)*((U64*)pointer);
else if (type == 7)
cast_value = (F64)*((I64*)pointer);
else if (type == 8)
cast_value = (F64)*((F32*)pointer);
else
cast_value = *((F64*)pointer);
if (options & 0x08)
{
if (options & 0x10)
{
return offset[0]+scale[0]*cast_value;
}
else
{
return scale[0]*cast_value;
}
}
else
{
if (options & 0x10)
{
return offset[0]+cast_value;
}
else
{
return cast_value;
}
}
};
inline void set_value_as_float(U8* pointer, F64 value) const
{
F64 unoffset_and_unscaled_value;
if (options & 0x08)
{
if (options & 0x10)
{
unoffset_and_unscaled_value = (value - offset[0])/scale[0];
}
else
{
unoffset_and_unscaled_value = value/scale[0];
}
}
else
{
if (options & 0x10)
{
F64 casted_value;
unoffset_and_unscaled_value = value - offset[0];
}
else
{
unoffset_and_unscaled_value = value;
}
}
I32 type = get_type();
if (type == 0)
casted_value = (F64)*((U8*)value);
*((U8*)pointer) = U8_QUANTIZE(unoffset_and_unscaled_value);
else if (type == 1)
casted_value = (F64)*((I8*)value);
*((I8*)pointer) = I8_QUANTIZE(unoffset_and_unscaled_value);
else if (type == 2)
casted_value = (F64)*((U16*)value);
*((U16*)pointer) = U16_QUANTIZE(unoffset_and_unscaled_value);
else if (type == 3)
casted_value = (F64)*((I16*)value);
*((I16*)pointer) = I16_QUANTIZE(unoffset_and_unscaled_value);
else if (type == 4)
casted_value = (F64)*((U32*)value);
*((U32*)pointer) = U32_QUANTIZE(unoffset_and_unscaled_value);
else if (type == 5)
casted_value = (F64)*((I32*)value);
*((I32*)pointer) = U32_QUANTIZE(unoffset_and_unscaled_value);
else if (type == 6)
casted_value = (F64)(I64)*((U64*)value);
*((U64*)pointer) = U64_QUANTIZE(unoffset_and_unscaled_value);
else if (type == 7)
casted_value = (F64)*((I64*)value);
*((I64*)pointer) = I64_QUANTIZE(unoffset_and_unscaled_value);
else if (type == 8)
casted_value = (F64)*((F32*)value);
*((F32*)pointer) = (F32)unoffset_and_unscaled_value;
else
casted_value = *((F64*)value);
return offset[0]+scale[0]*casted_value;
*((F64*)pointer) = unoffset_and_unscaled_value;
};
private:
......@@ -197,35 +270,35 @@ private:
{
return ((I32)data_type - 1)%10;
};
inline I32 get_dim() const
inline I32 get_dim() const // compute dimension of deprecated tuple and triple attributes
{
return 1;
return ((I32)data_type - 1)/10 + 1;
};
inline U64I64F64 cast(U8* value) const
inline U64I64F64 cast(U8* pointer) const
{
I32 type = get_type();
U64I64F64 casted_value;
U64I64F64 cast_value;
if (type == 0)
casted_value.u64 = *((U8*)value);
cast_value.u64 = *((U8*)pointer);
else if (type == 1)
casted_value.i64 = *((I8*)value);
cast_value.i64 = *((I8*)pointer);
else if (type == 2)
casted_value.u64 = *((U16*)value);
cast_value.u64 = *((U16*)pointer);
else if (type == 3)
casted_value.i64 = *((I16*)value);
cast_value.i64 = *((I16*)pointer);
else if (type == 4)
casted_value.u64 = *((U32*)value);
cast_value.u64 = *((U32*)pointer);
else if (type == 5)
casted_value.i64 = *((I32*)value);
cast_value.i64 = *((I32*)pointer);
else if (type == 6)
casted_value.u64 = *((U64*)value);
cast_value.u64 = *((U64*)pointer);
else if (type == 7)
casted_value.i64 = *((I64*)value);
cast_value.i64 = *((I64*)pointer);
else if (type == 8)
casted_value.f64 = *((F32*)value);
cast_value.f64 = *((F32*)pointer);
else
casted_value.f64 = *((F64*)value);
return casted_value;
cast_value.f64 = *((F64*)pointer);
return cast_value;
};
inline U64I64F64 smallest(U64I64F64 a, U64I64F64 b) const
{
......@@ -431,6 +504,15 @@ public:
return -1;
}
const CHAR* get_attribute_name(I32 index) const
{
if (index < number_attributes)
{
return attributes[index].name;
}
return 0;
}
BOOL remove_attribute(I32 index)
{
if (index < 0 || index >= number_attributes)
......
......@@ -455,11 +455,11 @@ BOOL LASindex::append(const char* file_name) const
lax_evlr.record_id = 30;
sprintf(lax_evlr.description, "LAX spatial indexing (LASindex)");
bytestreamout->put16bitsLE((U8*)&(lax_evlr.reserved));
bytestreamout->putBytes((U8*)lax_evlr.user_id, 16);
bytestreamout->put16bitsLE((U8*)&(lax_evlr.record_id));
bytestreamout->put64bitsLE((U8*)&(lax_evlr.record_length_after_header));
bytestreamout->putBytes((U8*)lax_evlr.description, 32);
bytestreamout->put16bitsLE((const U8*)&(lax_evlr.reserved));
bytestreamout->putBytes((const U8*)lax_evlr.user_id, 16);
bytestreamout->put16bitsLE((const U8*)&(lax_evlr.record_id));
bytestreamout->put64bitsLE((const U8*)&(lax_evlr.record_length_after_header));
bytestreamout->putBytes((const U8*)lax_evlr.description, 32);
if (!write(bytestreamout))
{
......@@ -474,15 +474,15 @@ BOOL LASindex::append(const char* file_name) const
lax_evlr.record_length_after_header = bytestreamout->tell() - offset_to_special_evlrs - 60;
bytestreamout->seek(offset_to_special_evlrs + 20);
bytestreamout->put64bitsLE((U8*)&(lax_evlr.record_length_after_header));
bytestreamout->put64bitsLE((const U8*)&(lax_evlr.record_length_after_header));
// maybe update LASzip VLR
if (number_of_special_evlrs != -1)
{
bytestreamout->seek(offset_laz_vlr + 54 + 16);
bytestreamout->put64bitsLE((U8*)&number_of_special_evlrs);
bytestreamout->put64bitsLE((U8*)&offset_to_special_evlrs);
bytestreamout->put64bitsLE((const U8*)&number_of_special_evlrs);
bytestreamout->put64bitsLE((const U8*)&offset_to_special_evlrs);
}
// close writer
......@@ -590,13 +590,13 @@ BOOL LASindex::read(ByteStreamIn* stream)
BOOL LASindex::write(ByteStreamOut* stream) const
{
if (!stream->putBytes((U8*)"LASX", 4))
if (!stream->putBytes((const U8*)"LASX", 4))
{
fprintf(stderr,"ERROR (LASindex): writing signature\n");
return FALSE;
}
U32 version = 0;
if (!stream->put32bitsLE((U8*)&version))
if (!stream->put32bitsLE((const U8*)&version))
{
fprintf(stderr,"ERROR (LASindex): writing version\n");
return FALSE;
......
......@@ -659,20 +659,20 @@ BOOL LASinterval::read(ByteStreamIn* stream)
BOOL LASinterval::write(ByteStreamOut* stream) const
{
if (!stream->putBytes((U8*)"LASV", 4))
if (!stream->putBytes((const U8*)"LASV", 4))
{
fprintf(stderr,"ERROR (LASinterval): writing signature\n");
return FALSE;
}
U32 version = 0;
if (!stream->put32bitsLE((U8*)&version))
if (!stream->put32bitsLE((const U8*)&version))
{
fprintf(stderr,"ERROR (LASinterval): writing version\n");
return FALSE;
}
// write number of cells
U32 number_cells = (U32)((my_cell_hash*)cells)->size();
if (!stream->put32bitsLE((U8*)&number_cells))
if (!stream->put32bitsLE((const U8*)&number_cells))
{
fprintf(stderr,"ERROR (LASinterval): writing number of cells %d\n", number_cells);
return FALSE;
......@@ -692,19 +692,19 @@ BOOL LASinterval::write(ByteStreamOut* stream) const
}
// write index of cell
I32 cell_index = (*hash_element).first;
if (!stream->put32bitsLE((U8*)&cell_index))
if (!stream->put32bitsLE((const U8*)&cell_index))
{
fprintf(stderr,"ERROR (LASinterval): writing cell index %d\n", cell_index);
return FALSE;
}
// write number of intervals in cell
if (!stream->put32bitsLE((U8*)&number_intervals))
if (!stream->put32bitsLE((const U8*)&number_intervals))
{
fprintf(stderr,"ERROR (LASinterval): writing number of intervals %d in cell\n", number_intervals);
return FALSE;
}
// write number of points in cell
if (!stream->put32bitsLE((U8*)&number_points))
if (!stream->put32bitsLE((const U8*)&number_points))
{
fprintf(stderr,"ERROR (LASinterval): writing number of points %d in cell\n", number_points);
return FALSE;
......@@ -714,13 +714,13 @@ BOOL LASinterval::write(ByteStreamOut* stream) const
while (cell)
{
// write start of interval
if (!stream->put32bitsLE((U8*)&(cell->start)))
if (!stream->put32bitsLE((const U8*)&(cell->start)))
{
fprintf(stderr,"ERROR (LASinterval): writing start %d of interval\n", cell->start);
return FALSE;
}
// write end of interval
if (!stream->put32bitsLE((U8*)&(cell->end)))
if (!stream->put32bitsLE((const U8*)&(cell->end)))
{
fprintf(stderr,"ERROR (LASinterval): writing end %d of interval\n", cell->end);
return FALSE;
......
......@@ -694,6 +694,14 @@ public:
return 0.0;
};
inline void set_attribute_as_float(U32 index, F64 value) const
{
if (has_attribute(index))
{
attributer->attributes[index].set_value_as_float(extra_bytes + attributer->attribute_starts[index], value);
}
};
// typed and offset functions for attributes in extra bytes (more efficient)
inline void get_attribute(I32 start, U8 &data) const { data = extra_bytes[start]; };
......
......@@ -405,7 +405,7 @@ U32 LASquadtree::get_cell_index(const F64 x, const F64 y) const
}
// returns the indices of parent and siblings for the specified cell index
BOOL LASquadtree::coarsen(const I32 cell_index, I32* coarser_cell_index, U32* num_cell_indices, I32** cell_indices) const
BOOL LASquadtree::coarsen(const I32 cell_index, I32* coarser_cell_index, U32* num_cell_indices, I32** cell_indices)
{
if (cell_index < 0) return FALSE;
U32 level = get_level((U32)cell_index);
......@@ -680,7 +680,7 @@ BOOL LASquadtree::write(ByteStreamOut* stream) const
// F32 max_y 4 bytes
// which totals 28 bytes
if (!stream->putBytes((U8*)"LASS", 4))
if (!stream->putBytes((const U8*)"LASS", 4))
{
fprintf(stderr,"ERROR (LASquadtree): writing LASspatial signature\n");
return FALSE;
......@@ -693,52 +693,52 @@ BOOL LASquadtree::write(ByteStreamOut* stream) const
return FALSE;
}
if (!stream->putBytes((U8*)"LASQ", 4))
if (!stream->putBytes((const U8*)"LASQ", 4))
{
fprintf(stderr,"ERROR (LASquadtree): writing signature\n");
return FALSE;
}
U32 version = 0;
if (!stream->put32bitsLE((U8*)&version))
if (!stream->put32bitsLE((const U8*)&version))
{
fprintf(stderr,"ERROR (LASquadtree): writing version\n");
return FALSE;
}
if (!stream->put32bitsLE((U8*)&levels))
if (!stream->put32bitsLE((const U8*)&levels))
{
fprintf(stderr,"ERROR (LASquadtree): writing levels %u\n", levels);
return FALSE;
}
U32 level_index = 0;
if (!stream->put32bitsLE((U8*)&level_index))
if (!stream->put32bitsLE((const U8*)&level_index))
{
fprintf(stderr,"ERROR (LASquadtree): writing level_index %u\n", level_index);
return FALSE;
}
U32 implicit_levels = 0;
if (!stream->put32bitsLE((U8*)&implicit_levels))
if (!stream->put32bitsLE((const U8*)&implicit_levels))
{
fprintf(stderr,"ERROR (LASquadtree): writing implicit_levels %u\n", implicit_levels);
return FALSE;
}
if (!stream->put32bitsLE((U8*)&min_x))
if (!stream->put32bitsLE((const U8*)&min_x))
{
fprintf(stderr,"ERROR (LASquadtree): writing min_x %g\n", min_x);
return FALSE;
}
if (!stream->put32bitsLE((U8*)&max_x))
if (!stream->put32bitsLE((const U8*)&max_x))
{
fprintf(stderr,"ERROR (LASquadtree): writing max_x %g\n", max_x);
return FALSE;
}
if (!stream->put32bitsLE((U8*)&min_y))
if (!stream->put32bitsLE((const U8*)&min_y))
{
fprintf(stderr,"ERROR (LASquadtree): writing min_y %g\n", min_y);
return FALSE;
}
if (!stream->put32bitsLE((U8*)&max_y))
if (!stream->put32bitsLE((const U8*)&max_y))
{
fprintf(stderr,"ERROR (LASquadtree): writing max_y %g\n", max_y);
return FALSE;
......
......@@ -60,7 +60,7 @@ public:
U32 get_cell_index(const F64 x, const F64 y) const;
// map cells to coarser cells
BOOL coarsen(const I32 cell_index, I32* coarser_cell_index, U32* num_cell_indices, I32** cell_indices) const;
BOOL coarsen(const I32 cell_index, I32* coarser_cell_index, U32* num_cell_indices, I32** cell_indices);
// describe cells
void get_cell_bounding_box(const I32 cell_index, F32* min, F32* max) const;
......
......@@ -1697,7 +1697,7 @@ inline void LASreadItemCompressed_RGBNIR14_v3::read(U8* item, U32& context)
}
}
// dempress
// decompress
////////////////////////////////////////
// decompress RGB layer
......@@ -1807,11 +1807,11 @@ inline void LASreadItemCompressed_RGBNIR14_v3::read(U8* item, U32& context)
{
((U16*)item)[3] |= (last_item[3]&0xFF00);
}
contexts[current_context].last_item[3] = ((U16*)item)[3];
last_item[3] = ((U16*)item)[3];
}
else
{
((U16*)item)[3] = contexts[current_context].last_item[3];
((U16*)item)[3] = last_item[3];
}
}
......
......@@ -13,7 +13,7 @@
COPYRIGHT:
(c) 2007-2017, martin isenburg, rapidlasso - fast tools to catch reality
(c) 2007-2019, martin isenburg, rapidlasso - fast tools to catch reality
This is free software; you can redistribute and/or modify it under the
terms of the GNU Lesser General Licence as published by the Free Software
......@@ -299,6 +299,8 @@ BOOL LASwritePoint::write(const U8 * const * point)
U32 context = 0;
if (chunk_count == chunk_size)
{
if (enc)
{
if (layered_las14_compression)
{
......@@ -320,6 +322,12 @@ BOOL LASwritePoint::write(const U8 * const * point)
}
add_chunk_to_table();
init(outstream);
}
else
{
// happens *only* for uncompressed LAS with over U32_MAX points
assert(chunk_size == U32_MAX);
}
chunk_count = 0;
}
chunk_count++;
......
......@@ -13,7 +13,7 @@
COPYRIGHT:
(c) 2007-2017, martin isenburg, rapidlasso - fast tools to catch reality
(c) 2007-2019, martin isenburg, rapidlasso - fast tools to catch reality
This is free software; you can redistribute and/or modify it under the
terms of the GNU Lesser General Licence as published by the Free Software
......@@ -24,6 +24,7 @@
CHANGE HISTORY:
21 February 2019 -- fix for writing 4294967295+ points uncompressed to LAS
28 August 2017 -- moving 'context' from global development hack to interface
23 August 2016 -- layering of items for selective decompression in LAS 1.4
6 September 2014 -- removed inheritance of EntropyEncoder and EntropyDecoder
......
......@@ -258,7 +258,7 @@ bool LASzip::check_item(const LASitem* item)
break;
case LASitem::WAVEPACKET14:
if (item->size != 29) return return_error("WAVEPACKET14 has size != 29");
if ((item->version != 0) && (item->version != 3)) return return_error("WAVEPACKET14 has version != 0 and != 3 and != 4"); // version == 4 fixes context-switch
if ((item->version != 0) && (item->version != 3) && (item->version != 4)) return return_error("WAVEPACKET14 has version != 0 and != 3 and != 4"); // version == 4 fixes context-switch
break;
default:
if (1)
......
......@@ -14,7 +14,7 @@
COPYRIGHT:
(c) 2007-2018, martin isenburg, rapidlasso - fast tools to catch reality
(c) 2007-2019, martin isenburg, rapidlasso - fast tools to catch reality
This is free software; you can redistribute and/or modify it under the
terms of the GNU Lesser General Licence as published by the Free Software
......@@ -25,6 +25,9 @@
CHANGE HISTORY:
21 February 2019 -- bug fix when writing 4294967295+ points uncompressed to LAS
28 December 2018 -- fix for v4 decompression of WavePacket part of PRDF 9 and 10
27 December 2018 -- upped to 3.2 r9 for bug fix in multi-channel NIR decompression
7 November 2018 -- upped to 3.2 r8 for identical legacy and extended flags check
20 October 2018 -- upped to 3.2 r7 for rare bug in LASinterval::merge_intervals()
5 October 2018 -- upped to 3.2 r6 for corrected 'is_empty' return value
......@@ -69,9 +72,9 @@ typedef long long SIGNED_INT64;
#endif
#define LASZIP_VERSION_MAJOR 3
#define LASZIP_VERSION_MINOR 2
#define LASZIP_VERSION_REVISION 8
#define LASZIP_VERSION_BUILD_DATE 181107
#define LASZIP_VERSION_MINOR 3
#define LASZIP_VERSION_REVISION 0
#define LASZIP_VERSION_BUILD_DATE 190308
#define LASZIP_COMPRESSOR_NONE 0
#define LASZIP_COMPRESSOR_POINTWISE 1
......
......@@ -172,7 +172,7 @@ typedef union I64U32I32F32 { I64 i64; U32 u32[2]; I32 i32[2]; F32 f32[2]; } I64U
inline BOOL IS_LITTLE_ENDIAN()
{
const U32 i = 1;
return (*((U8*)&i) == 1);
return (*((const U8*)&i) == 1);
}
#define ENDIANSWAP16(n) \
......