Skip to content
Commits on Source (3)
......@@ -19,7 +19,7 @@ compiler:
after_success:
- echo "secure travis:" "$TRAVIS_SECURE_ENV_VARS"
- sh -c 'if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "master" -a "$CXX" = "g++"; then echo "publish website"; ./scripts/ci/build_docs.sh; ./scripts/ci/deploy_website.sh $TRAVIS_BUILD_DIR/doc/build; fi'
- sh -c 'if test "$TRAVIS_SECURE_ENV_VARS" = "true" -a "$TRAVIS_BRANCH" = "master" -a "$CXX" = "g++"; then echo "publish website"; ./scripts/ci/build_docs.sh; ./scripts/ci/add_deploy_key.sh; ./scripts/ci/deploy_website.sh $TRAVIS_BUILD_DIR/docs/build /tmp; fi'
before_install: ./scripts/ci/docker.sh
......
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()
28 September 2018 -- laszip DLL: tiny bug fix for writing extended classifications via DLL and updated examples
17 September 2018 -- laszip DLL: no more support for deprecated LASattributes (aka "extra bytes") with dimensions 2 or 3
30 July 2018 -- bug fix in selective decompression of "extra_bytes" for point types 6 and higher
29 March 2018 -- add LASlib only fields to some structs to avoid future mix-up for "native" LAS 1.4
9 February 2018 -- minor version increment to 3.2 as POINT14_v4 fixes context inefficiency bug
28 December 2017 -- prepare to correct 'context switch' bug reported by Wanwannodao on some future date
15 September 2017 -- new C++ istream / ostream interface completed and released
22 August 2017 -- new C++ istream / ostream interface
18 July 2017 -- bug fix for spatially-indexed reading from native compressed LAS 1.4 files
28 May 2017 -- support for "selective decompression" of compressed LAS 1.4 points added into DLL API
25 April 2017 -- enable "native LAS 1.4 extension" in LASzip DLL via 'request_native_extension'
30 March 2017 -- alpha-release of "native LAS 1.4 extension" for LASzip compression
11 January 2017 -- new DLL/API function 'laszip_set_chunk_size()' to change chunk size
8 January 2017 -- changed file names from "laszip_dll.h" to "laszip_api.h" for hobu
7 January 2017 -- set reserved field in LASzip VLR from 0xAABB to 0x0
......
......@@ -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.2" CACHE STRING "LASzip version" FORCE)
set(LASZIP_API_VERSION_STRING "3.2.8" 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.0")
set(LASZIP_SO_VERSION "8.0.1")
set(LASZIP_COMPATIBILITY_VERSION 8)
check_include_file_cxx ("unordered_map" HAVE_UNORDERED_MAP)
......
......@@ -2,6 +2,20 @@
LASzip
================================================================================
3.2.8 19-NOV-18
--------------------------------------------------------------------------------
** NOTE: The version number is 3.2.8 to be brought in line with the patch version
number present in LAStools, which had been incremented without being kept in sync
with the laszip.org version. We regret the error. The following bug fixes have been
made since 3.2.2:
* 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
* 28 September 2018 -- upped to 3.2 r5 for fix in extended classification writing
3.2.2 27-MAR-18
--------------------------------------------------------------------------------
......
laszip (3.2.2-1) UNRELEASED; urgency=medium
laszip (3.2.8-1) UNRELEASED; urgency=medium
TODO: FastAC license issue needs to be resolved, see:
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750731#16
......@@ -7,4 +7,4 @@ laszip (3.2.2-1) UNRELEASED; urgency=medium
* Initial release. (Closes: #750731)
-- Bas Couwenberg <sebastic@debian.org> Mon, 02 Apr 2018 15:22:01 +0200
-- Bas Couwenberg <sebastic@debian.org> Tue, 20 Nov 2018 15:49:51 +0100
......@@ -48,9 +48,9 @@ copyright = u'2018, Martin Isenburg'
# built documents.
#
# The short X.Y version.
version = '3.2.2'
version = '3.2.3'
# The full version, including alpha/beta/rc tags.
release = '3.2.2'
release = '3.2.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -9,15 +9,20 @@ LASzip - a free open source product of `rapidlasso GmbH <http://rapidlasso.com/>
Source
..............................................................................
* **2018-03-26**
* **2018-11-19**
- `laszip-3.2.1.tar.gz <https://github.com/LASzip/LASzip/releases/download/3.2.1/laszip-src-3.2.1.tar.gz>`_
`(md5) <https://github.com/LASzip/LASzip/releases/download/3.2.1/laszip-src-3.2.1.tar.gz.md5>`__
- `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>`__
Past Release(s)
~~~~~~~~~~~~~~~~~~~~~~~~~
* **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>`_
`(md5) <https://github.com/LASzip/LASzip/releases/download/3.2.2/laszip-src-3.2.2.tar.gz.md5>`__
* **2017-10-10**
- `laszip-3.1.1.tar.gz <https://github.com/LASzip/LASzip/releases/download/3.1.1/laszip-src-3.1.1.tar.gz>`_
......
This diff is collapsed.
......@@ -251,7 +251,7 @@ typedef struct laszip_point
#define laszip_DECOMPRESS_SELECTIVE_BYTE5 0x00200000
#define laszip_DECOMPRESS_SELECTIVE_BYTE6 0x00400000
#define laszip_DECOMPRESS_SELECTIVE_BYTE7 0x00800000
#define laszip_DECOMPRESS_SELECTIVE_EXTRA_BYTES 0xFFF00000
#define laszip_DECOMPRESS_SELECTIVE_EXTRA_BYTES 0xFFFF0000
/*---------------------------------------------------------------------------*/
/*---------------- DLL functions to manage the LASzip DLL -------------------*/
......
#!/bin/bash
if [ -n "$encrypted_de53628fc98a_key" ]; then
echo "decrypting SSH for github login"
openssl aes-256-cbc -K $encrypted_de53628fc98a_key -iv $encrypted_de53628fc98a_iv -in scripts/ci/pdaldocs-private.key.enc -out scripts/ci/pdaldocs-private.key -d
# openssl aes-256-cbc -K $encrypted_de53628fc98a_key -iv $encrypted_de53628fc98a_iv -in scripts/ci/pdaldocs-private.key.enc -out ~\/.ssh/pdal-docs/id_rsa -d
cp scripts/ci/pdaldocs-private.key ~/.ssh/id_rsa
rm scripts/ci/pdaldocs-private.key
chmod 600 ~/.ssh/id_rsa
echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
fi;
......@@ -8,6 +8,6 @@ if [[ ! -z $TRAVIS_BUILD_DIR ]]; then
buildpath="$TRAVIS_BUILD_DIR"
fi
docker run -v $buildpath:/data -w /data/docs laszip/docs make html
docker run -v $buildpath:/data -w /data/docs pdal/docs make html
......@@ -2,7 +2,30 @@
echo "deploying docs for $TRAVIS_BUILD_DIR/docs"
export AWS_ACCESS_KEY_ID="$AWS_KEY"
export AWS_SECRET_ACCESS_KEY="$AWS_SECRET"
builddir=$1
destdir=$2
echo "builddir: " $builddir
echo "destdir: " $destdir
DATE=$(date +'%y.%m.%d %H:%M:%S')
git clone git@github.com:LASzip/laszip.github.io.git $destdir/laszipdocs
cd $destdir/laszipdocs
git checkout master
cd $builddir/html
cp -rf * $destdir/laszipdocs
#cd $builddir/latex/
#cp PDAL.pdf $destdir/laszipdocs
cd $destdir/laszipdocs
git config user.email "howard+pdal-docs@hobu.co"
git config user.name "PDAL Travis docsbot"
git add -A
git commit -m "update with results of commit https://github.com/LASzip/LASzip/commit/$TRAVIS_COMMIT for ${DATE}"
git push origin master
docker run -e "AWS_SECRET_ACCESS_KEY=$AWS_SECRET" -e "AWS_ACCESS_KEY_ID=$AWS_KEY" -v $TRAVIS_BUILD_DIR:/data -w /data/docs laszip/docs aws s3 sync ./build/html/ s3://www.laszip.org --acl public-read
#!/bin/bash
# laszip/docs image has all of the Sphinx
# dependencies need to build LASzip's docs
docker pull laszip/docs
# proj.4 image has all of the Sphinx
# dependencies need to build proj.4's docs
docker pull pdal/docs
......@@ -13,7 +13,7 @@
COPYRIGHT:
(c) 2007-2012, martin isenburg, rapidlasso - fast tools to catch reality
(c) 2007-2018, 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:
10 July 2018 -- because it's hard to determine seek-ability, user must set it
1 October 2011 -- added 64 bit file support in MSVC 6.0 at McCafe at Hbf Linz
10 January 2011 -- licensing change for LGPL release and liblas integration
12 December 2010 -- created from ByteStreamOutFile after Howard got pushy (-;
......@@ -46,13 +47,13 @@ using namespace std;
class ByteStreamInIstream : public ByteStreamIn
{
public:
ByteStreamInIstream(istream& stream);
ByteStreamInIstream(istream& stream, BOOL seekable=TRUE);
/* read a single byte */
U32 getByte();
/* read an array of bytes */
void getBytes(U8* bytes, const U32 num_bytes);
/* is the stream seekable (e.g. standard in is not) */
BOOL isSeekable() const;
/* is the stream seekable (e.g. stdin is not) */
BOOL isSeekable() const { return seekable; };
/* get current position of stream */
I64 tell() const;
/* seek to this position in the stream */
......@@ -63,12 +64,13 @@ public:
~ByteStreamInIstream(){};
protected:
istream& stream;
BOOL seekable;
};
class ByteStreamInIstreamLE : public ByteStreamInIstream
{
public:
ByteStreamInIstreamLE(istream& stream);
ByteStreamInIstreamLE(istream& stream, BOOL seekable=TRUE);
/* read 16 bit low-endian field */
void get16bitsLE(U8* bytes);
/* read 32 bit low-endian field */
......@@ -88,7 +90,7 @@ private:
class ByteStreamInIstreamBE : public ByteStreamInIstream
{
public:
ByteStreamInIstreamBE(istream& stream);
ByteStreamInIstreamBE(istream& stream, BOOL seekable=TRUE);
/* read 16 bit low-endian field */
void get16bitsLE(U8* bytes);
/* read 32 bit low-endian field */
......@@ -105,8 +107,7 @@ private:
U8 swapped[8];
};
inline ByteStreamInIstream::ByteStreamInIstream(istream& stream_param) :
stream(stream_param)
inline ByteStreamInIstream::ByteStreamInIstream(istream& stream_param, BOOL seekable_param) : stream(stream_param), seekable(seekable_param)
{
}
......@@ -129,11 +130,6 @@ inline void ByteStreamInIstream::getBytes(U8* bytes, const U32 num_bytes)
}
}
inline BOOL ByteStreamInIstream::isSeekable() const
{
return !!(static_cast<ifstream&>(stream));
}
inline I64 ByteStreamInIstream::tell() const
{
return (I64)stream.tellg();
......@@ -155,7 +151,7 @@ inline BOOL ByteStreamInIstream::seekEnd(const I64 distance)
return stream.good();
}
inline ByteStreamInIstreamLE::ByteStreamInIstreamLE(istream& stream) : ByteStreamInIstream(stream)
inline ByteStreamInIstreamLE::ByteStreamInIstreamLE(istream& stream, BOOL seekable) : ByteStreamInIstream(stream, seekable)
{
}
......@@ -203,7 +199,7 @@ inline void ByteStreamInIstreamLE::get64bitsBE(U8* bytes)
bytes[7] = swapped[0];
}
inline ByteStreamInIstreamBE::ByteStreamInIstreamBE(istream& stream) : ByteStreamInIstream(stream)
inline ByteStreamInIstreamBE::ByteStreamInIstreamBE(istream& stream, BOOL seekable) : ByteStreamInIstream(stream, seekable)
{
}
......
......@@ -25,6 +25,7 @@
CHANGE HISTORY:
13 September 2018 -- removed tuples and triple support from attributes
19 July 2015 -- created after FOSS4GE in the train back from Lake Como
===============================================================================
......@@ -68,30 +69,27 @@ public:
this->options = size;
};
LASattribute(U32 type, const CHAR* name, const CHAR* description=0, U32 dim=1)
LASattribute(U32 type, const CHAR* name, const CHAR* description=0)
{
if (type > LAS_ATTRIBUTE_F64) throw;
if ((dim < 1) || (dim > 3)) throw;
if (name == 0) throw;
memset(this, 0, sizeof(LASattribute));
scale[0] = scale[1] = scale[2] = 1.0;
this->data_type = (dim-1)*10+type+1;
this->data_type = type+1;
strncpy(this->name, name, 32);
if (description) strncpy(this->description, description, 32);
};
inline BOOL set_no_data(U8 no_data, I32 dim=0) { if ((0 == get_type()) && (dim < get_dim())) { this->no_data[dim].u64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(I8 no_data, I32 dim=0) { if ((1 == get_type()) && (dim < get_dim())) { this->no_data[dim].i64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(U16 no_data, I32 dim=0) { if ((2 == get_type()) && (dim < get_dim())) { this->no_data[dim].u64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(I16 no_data, I32 dim=0) { if ((3 == get_type()) && (dim < get_dim())) { this->no_data[dim].i64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(U32 no_data, I32 dim=0) { if ((4 == get_type()) && (dim < get_dim())) { this->no_data[dim].u64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(I32 no_data, I32 dim=0) { if ((5 == get_type()) && (dim < get_dim())) { this->no_data[dim].i64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(U64 no_data, I32 dim=0) { if ((6 == get_type()) && (dim < get_dim())) { this->no_data[dim].u64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(I64 no_data, I32 dim=0) { if ((7 == get_type()) && (dim < get_dim())) { this->no_data[dim].i64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(F32 no_data, I32 dim=0) { if ((8 == get_type()) && (dim < get_dim())) { this->no_data[dim].f64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(F64 no_data, I32 dim=0)
{
if (dim < get_dim())
inline BOOL set_no_data(U8 no_data) { if (0 == get_type()) { this->no_data[0].u64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(I8 no_data) { if (1 == get_type()) { this->no_data[0].i64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(U16 no_data) { if (2 == get_type()) { this->no_data[0].u64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(I16 no_data) { if (3 == get_type()) { this->no_data[0].i64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(U32 no_data) { if (4 == get_type()) { this->no_data[0].u64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(I32 no_data) { if (5 == get_type()) { this->no_data[0].i64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(U64 no_data) { if (6 == get_type()) { this->no_data[0].u64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(I64 no_data) { if (7 == get_type()) { this->no_data[0].i64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(F32 no_data) { if (8 == get_type()) { this->no_data[0].f64 = no_data; options |= 0x01; return TRUE; } return FALSE; };
inline BOOL set_no_data(F64 no_data)
{
switch (get_type())
{
......@@ -99,48 +97,53 @@ public:
case 2:
case 4:
case 6:
this->no_data[dim].u64 = (U64)no_data; options |= 0x01; return TRUE;
this->no_data[0].u64 = (U64)no_data;
options |= 0x01;
return TRUE;
case 1:
case 3:
case 5:
case 7:
this->no_data[dim].i64 = (I64)no_data; options |= 0x01; return TRUE;
this->no_data[0].i64 = (I64)no_data;
options |= 0x01;
return TRUE;
case 8:
case 9:
this->no_data[dim].f64 = no_data; options |= 0x01; return TRUE;
}
this->no_data[0].f64 = no_data;
options |= 0x01;
return TRUE;
}
return FALSE;
};
inline void set_min(U8* min, I32 dim=0) { this->min[dim] = cast(min); options |= 0x02; };
inline void update_min(U8* min, I32 dim=0) { this->min[dim] = smallest(cast(min), this->min[dim]); };
inline BOOL set_min(U8 min, I32 dim=0) { if ((0 == get_type()) && (dim < get_dim())) { this->min[dim].u64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(I8 min, I32 dim=0) { if ((1 == get_type()) && (dim < get_dim())) { this->min[dim].i64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(U16 min, I32 dim=0) { if ((2 == get_type()) && (dim < get_dim())) { this->min[dim].u64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(I16 min, I32 dim=0) { if ((3 == get_type()) && (dim < get_dim())) { this->min[dim].i64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(U32 min, I32 dim=0) { if ((4 == get_type()) && (dim < get_dim())) { this->min[dim].u64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(I32 min, I32 dim=0) { if ((5 == get_type()) && (dim < get_dim())) { this->min[dim].i64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(U64 min, I32 dim=0) { if ((6 == get_type()) && (dim < get_dim())) { this->min[dim].u64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(I64 min, I32 dim=0) { if ((7 == get_type()) && (dim < get_dim())) { this->min[dim].i64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(F32 min, I32 dim=0) { if ((8 == get_type()) && (dim < get_dim())) { this->min[dim].f64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(F64 min, I32 dim=0) { if ((9 == get_type()) && (dim < get_dim())) { this->min[dim].f64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline void set_max(U8* max, I32 dim=0) { this->max[dim] = cast(max); options |= 0x04; };
inline void update_max(U8* max, I32 dim=0) { this->max[dim] = biggest(cast(max), this->max[dim]); };
inline BOOL set_max(U8 max, I32 dim=0) { if ((0 == get_type()) && (dim < get_dim())) { this->max[dim].u64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(I8 max, I32 dim=0) { if ((1 == get_type()) && (dim < get_dim())) { this->max[dim].i64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(U16 max, I32 dim=0) { if ((2 == get_type()) && (dim < get_dim())) { this->max[dim].u64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(I16 max, I32 dim=0) { if ((3 == get_type()) && (dim < get_dim())) { this->max[dim].i64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(U32 max, I32 dim=0) { if ((4 == get_type()) && (dim < get_dim())) { this->max[dim].u64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(I32 max, I32 dim=0) { if ((5 == get_type()) && (dim < get_dim())) { this->max[dim].i64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(U64 max, I32 dim=0) { if ((6 == get_type()) && (dim < get_dim())) { this->max[dim].u64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(I64 max, I32 dim=0) { if ((7 == get_type()) && (dim < get_dim())) { this->max[dim].i64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(F32 max, I32 dim=0) { if ((8 == get_type()) && (dim < get_dim())) { this->max[dim].f64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(F64 max, I32 dim=0) { if ((9 == get_type()) && (dim < get_dim())) { this->max[dim].f64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_scale(F64 scale, I32 dim=0) { if (data_type) { this->scale[dim] = scale; options |= 0x08; return TRUE; } return FALSE; };
inline BOOL set_offset(F64 offset, I32 dim=0) { if (data_type) { this->offset[dim] = offset; options |= 0x10; return TRUE; } return FALSE; };
inline void set_min(U8* min) { this->min[0] = cast(min); options |= 0x02; };
inline void update_min(U8* min) { this->min[0] = smallest(cast(min), this->min[0]); };
inline BOOL set_min(U8 min) { if (0 == get_type()) { this->min[0].u64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(I8 min) { if (1 == get_type()) { this->min[0].i64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(U16 min) { if (2 == get_type()) { this->min[0].u64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(I16 min) { if (3 == get_type()) { this->min[0].i64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(U32 min) { if (4 == get_type()) { this->min[0].u64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(I32 min) { if (5 == get_type()) { this->min[0].i64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(U64 min) { if (6 == get_type()) { this->min[0].u64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(I64 min) { if (7 == get_type()) { this->min[0].i64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(F32 min) { if (8 == get_type()) { this->min[0].f64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline BOOL set_min(F64 min) { if (9 == get_type()) { this->min[0].f64 = min; options |= 0x02; return TRUE; } return FALSE; };
inline void set_max(U8* max) { this->max[0] = cast(max); options |= 0x04; };
inline void update_max(U8* max) { this->max[0] = biggest(cast(max), this->max[0]); };
inline BOOL set_max(U8 max) { if (0 == get_type()) { this->max[0].u64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(I8 max) { if (1 == get_type()) { this->max[0].i64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(U16 max) { if (2 == get_type()) { this->max[0].u64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(I16 max) { if (3 == get_type()) { this->max[0].i64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(U32 max) { if (4 == get_type()) { this->max[0].u64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(I32 max) { if (5 == get_type()) { this->max[0].i64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(U64 max) { if (6 == get_type()) { this->max[0].u64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(I64 max) { if (7 == get_type()) { this->max[0].i64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(F32 max) { if (8 == get_type()) { this->max[0].f64 = max; options |= 0x04; return TRUE; } return FALSE; };
inline BOOL set_max(F64 max) { if (9 == get_type()) { this->max[0].f64 = max; options |= 0x04; return TRUE; } return FALSE; };
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 has_no_data() const { return options & 0x01; };
inline BOOL has_min() const { return options & 0x02; };
......@@ -154,8 +157,7 @@ public:
{
const U32 size_table[10] = { 1, 1, 2, 2, 4, 4, 8, 8, 4, 8 };
U32 type = get_type();
U32 dim = get_dim();
return size_table[type]*dim;
return size_table[type];
}
else
{
......@@ -197,7 +199,7 @@ private:
};
inline I32 get_dim() const
{
return 1 + ((I32)data_type - 1)/10;
return 1;
};
inline U64I64F64 cast(U8* value) const
{
......@@ -262,6 +264,7 @@ private:
class LASattributer
{
public:
BOOL attributes_linked;
I32 number_attributes;
LASattribute* attributes;
I32* attribute_starts;
......@@ -269,6 +272,7 @@ public:
LASattributer()
{
attributes_linked = TRUE;
number_attributes = 0;
attributes = 0;
attribute_starts = 0;
......@@ -282,13 +286,16 @@ public:
void clean_attributes()
{
if (number_attributes)
if (attributes_linked)
{
if (attributes)
{
number_attributes = 0;
free(attributes); attributes = 0;
free(attribute_starts); attribute_starts = 0;
free(attribute_sizes); attribute_sizes = 0;
}
}
};
BOOL init_attributes(U32 number_attributes, LASattribute* attributes)
......
......@@ -327,7 +327,7 @@ BOOL LASindex::write(FILE* file) const
BOOL LASindex::read(const char* file_name)
{
if (file_name == 0) return FALSE;
char* name = strdup(file_name);
char* name = LASCopyString(file_name);
if (strstr(file_name, ".las") || strstr(file_name, ".laz"))
{
name[strlen(name)-1] = 'x';
......@@ -502,7 +502,7 @@ BOOL LASindex::append(const char* file_name) const
BOOL LASindex::write(const char* file_name) const
{
if (file_name == 0) return FALSE;
char* name = strdup(file_name);
char* name = LASCopyString(file_name);
if (strstr(file_name, ".las") || strstr(file_name, ".laz"))
{
name[strlen(name)-1] = 'x';
......
......@@ -27,6 +27,7 @@
CHANGE HISTORY:
7 September 2018 -- replaced calls to _strdup with calls to the LASCopyString macro
7 January 2017 -- add read(FILE* file) for Trimble LASzip DLL improvement
2 April 2015 -- add seek_next(LASreadPoint* reader, I64 &p_count) for DLL
2 April 2015 -- delete read_next(LASreader* lasreader) that was not used
......
......@@ -168,7 +168,7 @@ BOOL LASinterval::add(const U32 p_index, const I32 c_index)
// get total number of cells
U32 LASinterval::get_number_cells() const
{
return ((my_cell_hash*)cells)->size();
return (U32)((my_cell_hash*)cells)->size();
}
// get total number of intervals
......@@ -239,9 +239,6 @@ void LASinterval::merge_intervals(U32 maximum_intervals, const BOOL verbose)
hash_element++;
}
my_cell_map::iterator map_element = map.begin();
diff = (*map_element).first;
// maybe nothing to do
if (map.size() <= maximum_intervals)
{
......@@ -253,13 +250,16 @@ void LASinterval::merge_intervals(U32 maximum_intervals, const BOOL verbose)
}
else
{
diff = (*(map.begin())).first;
fprintf(stderr,"maximum_intervals: %u number of interval gaps: %u next largest interval gap %u\n", maximum_intervals, (U32)map.size(), diff);
}
}
return;
}
U32 size = map.size();
my_cell_map::iterator map_element;
U32 size = (U32)map.size();
while (size > maximum_intervals)
{
map_element = map.begin();
......@@ -671,7 +671,7 @@ BOOL LASinterval::write(ByteStreamOut* stream) const
return FALSE;
}
// write number of cells
U32 number_cells = ((my_cell_hash*)cells)->size();
U32 number_cells = (U32)((my_cell_hash*)cells)->size();
if (!stream->put32bitsLE((U8*)&number_cells))
{
fprintf(stderr,"ERROR (LASinterval): writing number of cells %d\n", number_cells);
......
......@@ -25,6 +25,7 @@
CHANGE HISTORY:
20 October 2018 -- fixed rare bug in merge_intervals() when verbose is TRUE
29 April 2011 -- created after cable outage during the royal wedding (-:
===============================================================================
......