Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add general deflate/LZMA support. * Add lzma cmake file * Add xz to dockerfile. * Try xz-dev. * Put xz in the right list. * Modify travis build script for xz(lzma) compression. * Update Dockerfile for xz(lzma) * Use proper casting to avoid warnings on Linux. * Make interface consistent for compressors. * Update SQLite for new compression API. * Update osgeo4w install to grab xz-devel. * Add support for zstd compression. * Add zstd to alpine build. * Add zstd. * Add zstd-dev pkg. * Update docker/build files for zstd. * Convert LazPerfDecompressor to new interface. * Update Dockerfile(s) for lzma(xz) and zstd. * Update compression for GreyhoundReader. * Made compression modules optional. * Allow compression types to be optional. * Provide appropriate defaults for compression options.
- Loading branch information
1 parent
88b102e
commit 813caf8
Showing
24 changed files
with
711 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
# | ||
# LZMA support | ||
# | ||
find_package(LibLZMA REQUIRED) | ||
set_package_properties(LibLZMA PROPERTIES TYPE REQUIRED | ||
PURPOSE "General compression support") | ||
if(LIBLZMA_FOUND) | ||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} | ||
"${LIBLZMA_LIBRARIES}") | ||
include_directories(${LIBLZMA_INCLUDE_DIRS}) | ||
mark_as_advanced(CLEAR LIBLZMA_INCLUDE_DIRS) | ||
mark_as_advanced(CLEAR LIBLZMA_LIBRARIES) | ||
set(PDAL_HAVE_LZMA 1) | ||
option(WITH_LZMA | ||
"Build support for compression/decompression with LZMA" FALSE) | ||
if (WITH_LZMA) | ||
find_package(LibLZMA REQUIRED) | ||
set_package_properties(LibLZMA PROPERTIES TYPE REQUIRED | ||
PURPOSE "General compression support") | ||
if(LIBLZMA_FOUND) | ||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} | ||
"${LIBLZMA_LIBRARIES}") | ||
include_directories(${LIBLZMA_INCLUDE_DIRS}) | ||
mark_as_advanced(CLEAR LIBLZMA_INCLUDE_DIRS) | ||
mark_as_advanced(CLEAR LIBLZMA_LIBRARIES) | ||
set(PDAL_HAVE_LZMA 1) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
# | ||
# ZLIB support | ||
# | ||
find_package(ZLIB REQUIRED) | ||
set_package_properties(ZLIB PROPERTIES TYPE REQUIRED | ||
option(WITH_ZLIB | ||
"Build support for compression/decompression with zlib/deflate." TRUE) | ||
if (WITH_ZLIB) | ||
find_package(ZLIB REQUIRED) | ||
set_package_properties(ZLIB PROPERTIES TYPE REQUIRED | ||
PURPOSE "Compression support in BPF") | ||
if(ZLIB_FOUND) | ||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "${ZLIB_LIBRARY}") | ||
include_directories(${ZLIB_INCLUDE_DIR}) | ||
mark_as_advanced(CLEAR ZLIB_INCLUDE_DIR) | ||
mark_as_advanced(CLEAR ZLIB_LIBRARY) | ||
set(PDAL_HAVE_ZLIB 1) | ||
endif() | ||
if(ZLIB_FOUND) | ||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} | ||
"${ZLIB_LIBRARY}") | ||
include_directories(${ZLIB_INCLUDE_DIR}) | ||
mark_as_advanced(CLEAR ZLIB_INCLUDE_DIR) | ||
mark_as_advanced(CLEAR ZLIB_LIBRARY) | ||
set(PDAL_HAVE_ZLIB 1) | ||
endif(ZLIB_FOUND) | ||
endif(WITH_ZLIB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
# | ||
# LZMA support | ||
# | ||
find_package(ZSTD REQUIRED) | ||
set_package_properties(ZSTD PROPERTIES TYPE REQUIRED | ||
option(WITH_ZSTD | ||
"Build support for compression/decompression with Zstd." FALSE) | ||
if (WITH_ZSTD) | ||
find_package(ZSTD REQUIRED) | ||
set_package_properties(ZSTD PROPERTIES TYPE REQUIRED | ||
PURPOSE "General compression support") | ||
if(ZSTD_FOUND) | ||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} | ||
"${ZSTD_STATIC_LIB}") | ||
mark_as_advanced(CLEAR ZSTD_INCLUDE_DIRS) | ||
mark_as_advanced(CLEAR ZSTD_LIBRARIES) | ||
set(PDAL_HAVE_ZSTD 1) | ||
endif() | ||
if (ZSTD_FOUND) | ||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} | ||
"${ZSTD_STATIC_LIB}") | ||
mark_as_advanced(CLEAR ZSTD_INCLUDE_DIRS) | ||
mark_as_advanced(CLEAR ZSTD_LIBRARIES) | ||
set(PDAL_HAVE_ZSTD 1) | ||
endif(ZSTD_FOUND) | ||
endif(WITH_ZSTD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2014, Howard Butler (howard@hobu.co) | ||
* | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following | ||
* conditions are met: | ||
* | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided | ||
* with the distribution. | ||
* * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the | ||
* names of its contributors may be used to endorse or promote | ||
* products derived from this software without specific prior | ||
* written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | ||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | ||
* OF SUCH DAMAGE. | ||
****************************************************************************/ | ||
#pragma once | ||
|
||
#include <pdal/pdal_internal.hpp> | ||
|
||
namespace pdal | ||
{ | ||
|
||
enum class CompressionType | ||
{ | ||
None = 0, | ||
Ght = 1, | ||
Dimensional = 2, | ||
Lazperf = 3, | ||
Unknown = 256 | ||
}; | ||
|
||
using BlockCb = std::function<void(char *buf, size_t bufsize)>; | ||
const size_t CHUNKSIZE(1000000); | ||
|
||
class compression_error : public std::runtime_error | ||
{ | ||
public: | ||
compression_error() : std::runtime_error("General compression error") | ||
{} | ||
|
||
compression_error(const std::string& s) : | ||
std::runtime_error("Compression: " + s) | ||
{} | ||
}; | ||
|
||
} // namespace pdal | ||
|
Oops, something went wrong.