diff --git a/.gitignore b/.gitignore
index 336b803c79..4376786559 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
# these are generated by cmake
#
pdal_defines.h
+plugins/pgpointcloud/Pgtest-Support.hpp
#
# rst outputs
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4543daa906..101aa010a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -89,13 +89,28 @@ endif(WIN32)
# Choose package components
option(WITH_APPS "Choose if PDAL utilities should be built" TRUE)
-option(WITH_GREYHOUND "Choose if Greyhound support should be built" FALSE)
-option(WITH_PCL "Choose if PCL support should be built" FALSE)
+option(BUILD_PLUGIN_GREYHOUND "Choose if Greyhound support should be built" FALSE)
+option(BUILD_PLUGIN_HEXBIN "Whether or not HexBin filter is built" FALSE)
+option(BUILD_PLUGIN_ICEBRIDGE "Choose if Icebridge support should be built" FALSE)
+option(BUILD_PLUGIN_MRSID "Choose if MrSID/LiDAR support should be built" FALSE)
+option(BUILD_PLUGIN_NITF "Choose if NITF support should be built (only install supported is from http://github.com/hobu/nitro)" FALSE)
+option(BUILD_PLUGIN_OCI "Choose if OCI support should be built" TRUE)
+option(BUILD_PLUGIN_P2G "Choose if Points2Grid support should be built" FALSE)
+option(BUILD_PLUGIN_PCL "Choose if PCL support should be built" FALSE)
+option(BUILD_PLUGIN_PGPOINTCLOUD "Choose if PostgreSQL PointCloud support should be built" TRUE)
+option(BUILD_PLUGIN_SQLITE "Choose if SQLite database support should be built" FALSE)
+option(BUILD_PLUGIN_RIVLIB "Choose if RiVLib support should be built" FALSE)
option(WITH_TESTS "Choose if PDAL unit tests should be built" TRUE)
# Choose to use pkg-config or not
option(WITH_PKGCONFIG "Choose whether a pkgconfig file (PDAL.pc) should be installed" TRUE)
+# Choose dependent options
+cmake_dependent_option(BUILD_PGPOINTCLOUD_TESTS "Choose if PostgreSQL PointCloud tests should be built" ON BUILD_PLUGIN_PGPOINTCLOUD ON)
+cmake_dependent_option(BUILD_SQLITE_TESTS "Choose if SQLite tests should be built" ON BUILD_PLUGIN_SQLITE ON)
+cmake_dependent_option(BUILD_OCI_TESTS "Choose if OCI tests should be built" ON BUILD_PLUGIN_OCI ON)
+cmake_dependent_option(BUILD_RIVLIB_TESTS "Choose if RiVLib tests should be built" ON BUILD_PLUGIN_RIVLIB ON)
+
#------------------------------------------------------------------------------
# test harness settings
@@ -290,13 +305,13 @@ find_package(GEOS 3.3)
if (GEOS_FOUND)
find_file(GEOS_VERSION_H version.h "${GEOS_INCLUDE_DIR}/geos")
if ("${GEOS_VERSION_H}" STREQUAL "GEOS_VERSION_H-NOTFOUND")
- set(GEOS_LIBRARY "")
+ set(GEOS_LIBRARY "")
set(GEOS_FOUND FALSE)
set(WITH_GEOS FALSE)
else()
include_directories("${GEOS_INCLUDE_DIR}")
set(PDAL_HAVE_GEOS 1)
- message(STATUS "...building with GEOS")
+ message(STATUS "...building with GEOS")
endif()
else()
set(GEOS_LIBRARY "")
@@ -324,71 +339,6 @@ if(WITH_GEOTIFF)
endif()
-#
-# SQLite (optional)
-#
-option(WITH_SQLITE "Choose if sqlite database support should be built" FALSE)
-if (WITH_SQLITE)
- find_package(SQLite3)
- mark_as_advanced(CLEAR SQLITE3_INCLUDE_DIR)
- mark_as_advanced(CLEAR SQLITE3_LIBRARY)
- include_directories(${SQLITE3_INCLUDE_DIR})
- set(PDAL_HAVE_SQLITE 1)
-endif()
-
-
-#
-# PGPointCloud (optional)
-#
-option(WITH_PGPOINTCLOUD "Choose if PostgreSQL PointCloud support should be built" TRUE)
-cmake_dependent_option(
- WITH_PGPOINTCLOUD_TESTS
- "Choose if PostgreSQL PointCloud tests should be built"
- OFF
- WITH_PGPOINTCLOUD
- OFF
- )
-if (WITH_PGPOINTCLOUD)
- find_package(PostgreSQL)
- if (POSTGRESQL_FOUND)
- set(PDAL_HAVE_POSTGRESQL 1)
- mark_as_advanced(CLEAR POSTGRESQL_INCLUDE_DIR)
- mark_as_advanced(CLEAR POSTGRESQL_LIBRARIES)
- include_directories(${POSTGRESQL_INCLUDE_DIR})
- message(STATUS "..building with PgPointCloud")
- else()
- set(WITH_PGPOINTCLOUD FALSE)
- set(POSTGRESQL_LIBRARIES "")
- endif()
-endif()
-
-
-#
-# Nitro (optional)
-#
-option(WITH_NITRO "Choose if Nitro support (only install supported is from http://github.com/hobu/nitro)" TRUE)
-if(WITH_NITRO)
- find_package(Nitro 2.6)
- IF (NITRO_FOUND)
- set(PDAL_HAVE_NITRO 1)
- include_directories(${NITRO_INCLUDE_DIR})
- include_directories("${NITRO_INCLUDE_DIR}/nitro/c++")
- include_directories("${NITRO_INCLUDE_DIR}/nitro/c")
- add_definitions("-D_REENTRANT")
- if (WIN32)
- add_definitions("-DSIZEOF_SIZE_T=4")
- add_definitions("-DIMPORT_NITRO_API")
- else()
- add_definitions("-D__POSIX")
- endif()
- message(STATUS "...building with Nitro")
- else()
- set(WITH_NITRO FALSE)
- set(NITRO_LIBRARIES "")
- endif()
-endif()
-
-
#
# ICONV (optional)
#
@@ -406,23 +356,6 @@ if(WITH_ICONV)
endif()
-#
-# Oracle support (optional)
-#
-option(WITH_ORACLE "Choose if Oracle support should be built" TRUE)
-if(WITH_ORACLE)
- find_package(Oracle)
- if(ORACLE_FOUND)
- include_directories(${ORACLE_INCLUDE_DIR})
- set(PDAL_HAVE_ORACLE 1)
- message(STATUS "...building with Oracle")
- else()
- set(WITH_ORACLE FALSE)
- set(ORACLE_LIBRARY "")
- endif()
-endif()
-
-
#
# LASZIP support (optional)
#
@@ -445,6 +378,16 @@ if(WITH_LASZIP)
endif()
endif()
+option(WITH_COMPRESSION "Choose to use laz-perf compression for database drivers" FALSE)
+if (WITH_COMPRESSION)
+ find_package(Lazperf)
+ if (LAZPERF_FOUND)
+ include_directories(${LAZPERF_INCLUDE_DIR})
+ set(PDAL_HAVE_LAZPERF 1)
+ else()
+ set(WITH_COMPRESSION FALSE)
+ endif()
+endif()
#
# ZLIB support - required
@@ -459,25 +402,6 @@ if(ZLIB_FOUND)
endif()
-#
-# MrSID/LiDAR support (optional)
-#
-option(WITH_MRSID "Choose if MrSID/LiDAR support should be built" FALSE)
-
-if(WITH_MRSID)
-
- set(MRSID_ROOT "/Users/hobu/installs/mrsid/Lidar_DSDK" CACHE STRING "Root directory of MrSID install")
-
- find_package(MrSID)
- if(MRSID_FOUND)
- set(CMAKE_REQUIRED_LIBRARIES "${MRSID_LIBRARY}")
- include_directories(${MRSID_INCLUDE_DIR})
- add_definitions(-DHAVE_MRSID=1)
- set(PDAL_HAVE_MRSID 1)
- endif()
-endif()
-
-
#
# CARIS/BDB support (optional)
#
@@ -488,55 +412,6 @@ if(WITH_CARIS)
endif()
-#
-# Points2Grid (optional)
-#
-option(WITH_P2G "Choose if Points2Grid support should be built" FALSE)
-if(WITH_P2G)
- find_package(Points2Grid)
- if(P2G_FOUND)
- set(CMAKE_REQUIRED_LIBRARIES "${P2G_LIBRARY}")
- include_directories(${P2G_INCLUDE_DIR})
- add_definitions(-DHAVE_P2G=1)
- set(PDAL_HAVE_P2G 1)
- endif()
-endif()
-
-
-#
-# HDF5 - optional
-#
-option(WITH_HDF5 "Choose if HDF5 support should be built" FALSE)
-if(WITH_HDF5)
- set (HDF5_FIND_COMPONENTS "CXX")
- find_package(HDF5 COMPONENTS CXX)
- if(HDF5_FOUND)
- include_directories(${HDF5_INCLUDE_DIR})
- add_definitions(-DHAVE_HDF5=1)
- set(PDAL_HAVE_HDF5 1)
- message(STATUS "Found HDF5")
- else()
- set(WITH_HDF5 FALSE)
- set(PDAL_HAVE_HDF5 0)
- message(STATUS "HDF5 not found")
- endif()
-endif()
-
-
-#
-# Hexer - optional
-#
-option(WITH_HEXER "Whether or not hexbin filter is built" FALSE)
-if(WITH_HEXER)
- find_package(Hexer)
- if(HEXER_FOUND)
- include_directories(${HEXER_INCLUDE_DIR})
- add_definitions(-DHAVE_HEXER=1)
- set(PDAL_HAVE_HEXER 1)
- endif()
-endif()
-
-
#
# Python - optional
#
@@ -561,13 +436,13 @@ endif()
#
-# libxml2 (used iff ORACLE or PGPOINTCLOUD or SQLITE)
+# libxml2 (used iff OCI or PGPOINTCLOUD or SQLITE)
#
option(WITH_LIBXML2 "Choose if libxml2 support should be built " FALSE)
if (WITH_LIBXML2 OR
- (WITH_ORACLE OR
- WIT_PGPOINTCLOUD OR
- WITH_SQLITE))
+ (BUILD_PLUGIN_OCI OR
+ BUILD_PLUGIN_PGPOINTCLOUD OR
+ BUILD_PLUGIN_SQLITE))
set(WITH_LIBXML2 TRUE)
else()
set(WITH_LIBXML2 FALSE)
@@ -587,21 +462,6 @@ if(WITH_LIBXML2)
endif()
-option(USE_PDAL_PLUGIN_TEXT "Build the text driver as a plugin rather than embedding" FALSE)
-option(USE_PDAL_PLUGIN_SOCI "Build the soci driver as a plugin rather than embedding" FALSE)
-option(USE_PDAL_PLUGIN_OCI "Build the oci driver as a plugin rather than embedding" FALSE)
-option(USE_PDAL_PLUGIN_MRSID "Build the MrSID driver as a plugin rather than embedding" FALSE)
-option(USE_PDAL_PLUGIN_CARIS "Build the Caris driver as a plugin rather than embedding" FALSE)
-option(USE_PDAL_PLUGIN_NITRO "Build the NITF writer as a plugin rather than embedding" FALSE)
-
-if (USE_PDAL_PLUGIN_TEXT OR USE_PDAL_PLUGIN_SOCI OR USE_PDAL_PLUGIN_OCI OR
- USE_PDAL_PLUGIN_MRSID OR USE_PDAL_PLUGIN_CARIS OR USE_PDAL_PLUGIN_NITRO)
- if (PDAL_BUILD_STATIC)
- message(SEND_ERROR "Cannot build separate plugins with statically compiled PDAL")
- endif()
-endif()
-
-
#------------------------------------------------------------------------------
# installation commands
#------------------------------------------------------------------------------
@@ -632,13 +492,6 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/include")
# subdirectory controls
#------------------------------------------------------------------------------
-add_subdirectory(src)
-add_subdirectory(plugins)
-
-if(WITH_APPS)
- add_subdirectory(apps)
-endif()
-
if(WITH_TESTS)
message(STATUS "Building with PDAL unit tests")
enable_testing()
@@ -663,6 +516,14 @@ else()
endif()
+add_subdirectory(src)
+add_subdirectory(plugins)
+
+if(WITH_APPS)
+ add_subdirectory(apps)
+endif()
+
+
#------------------------------------------------------------------------------
# CPACK controls
diff --git a/cmake/examples/hobu-config.sh b/cmake/examples/hobu-config.sh
index 6c76bcb5ec..953b9fab17 100755
--- a/cmake/examples/hobu-config.sh
+++ b/cmake/examples/hobu-config.sh
@@ -2,7 +2,7 @@ USR_LOCAL="/usr/local"
USR="/usr"
TIFF_HOME=$USR_LOCAL
LASZIP_HOME=$USR_LOCAL
-LIBXML2_HOME=$USR
+LIBXML2_HOME=/usr/local/Cellar/libxml2/2.9.2/
GEOTIFF_HOME=$USR_LOCAL
P2G_HOME=$USR_LOCAL
HEXER_HOME="/usr/local"
@@ -12,6 +12,7 @@ SO_EXT=dylib
# CXX=/usr/local/bin/g++-4.8
ORACLE_HOME=$HOME/oracle
+LAZPERF_HOME=$HOME/dev/git/laz-perf
export ORACLE_HOME
CONFIG="Unix Makefiles"
#CONFIG="Ninja"
@@ -23,16 +24,18 @@ fi
CC=$CC CXX=$CXX cmake -G "$CONFIG" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=/Users/hobu \
- -DWITH_ORACLE=ON \
+ -DBUILD_PLUGIN_OCI=ON \
-DWITH_GEOTIFF=ON \
- -DWITH_SQLITE=ON \
- -DWITH_P2G=ON \
- -DWITH_HEXER=ON \
- -DWITH_NITRO=ON \
- -DWITH_MRSID=OFF \
- -DWITH_HDF5=ON \
- -DWITH_PCL=ON \
- -DWITH_PGPOINTCLOUD=ON \
+ -DBUILD_PLUGIN_SQLITE=ON \
+ -DBUILD_PLUGIN_PGPOINTCLOUD=ON \
+ -DBUILD_OCI_TESTS=ON \
+ -DBUILD_PLUGIN_HEXBIN=ON \
+ -DBUILD_PLUGIN_NITF=ON \
+ -DBUILD_PLUGIN_P2G=ON \
+ -DBUILD_PLUGIN_MRSID=OFF \
+ -DBUILD_PLUGIN_ICEBRIDGE=ON \
+ -DBUILD_PLUGIN_PCL=ON \
+ -DWITH_COMPRESSION=ON \
-DMRSID_INCLUDE_DIR=/Users/hobu/dev/release/mrsid/Lidar_DSDK/include \
-DMRSID_LIBRARY=/Users/hobu/dev/release/mrsid/Lidar_DSDK/lib/liblti_lidar_dsdk.dylib \
-DHEXER_INCLUDE_DIR=${HEXER_HOME}/include \
@@ -46,6 +49,7 @@ CC=$CC CXX=$CXX cmake -G "$CONFIG" \
-DLASZIP_LIBRARY=${LASZIP_HOME}/lib/liblaszip.${SO_EXT} \
-DLIBXML2_INCLUDE_DIR=${LIBXML2_HOME}/include/libxml2 \
-DLIBXML2_LIBRARIES=${LIBXML2_HOME}/lib/libxml2.${SO_EXT} \
+ -DLAZPERF_INCLUDE_DIR=${LAZPERF_HOME}/ \
-DSQLITE3_INCLUDE_DIR=${SQLITE_HOME}/include \
-DSQLITE3_LIBRARY=${SQLITE_HOME}/lib/libsqlite3.${SO_EXT}
diff --git a/cmake/modules/FindLazperf.cmake b/cmake/modules/FindLazperf.cmake
new file mode 100644
index 0000000000..d391e2a4d5
--- /dev/null
+++ b/cmake/modules/FindLazperf.cmake
@@ -0,0 +1,29 @@
+# - Find lazperf
+# Find the native LAZ-perf headers and libraries.
+#
+# LAZPERF_INCLUDE_DIRS - where to find encoder.hpp.hpp, etc.
+# LAZPERF_LIBRARIES - List of libraries when using LAZPERF.
+# LAZPERF_FOUND - True if LAZPERF found.
+
+
+# Look for the header file.
+FIND_PATH(LAZPERF_INCLUDE_DIR NAMES encoder.hpp )
+
+# Look for the library.
+#FIND_LIBRARY(LAZPERF_LIBRARY NAMES msgpack libmsgpack)
+
+# handle the QUIETLY and REQUIRED arguments and set LAZPERF_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LAZPERF DEFAULT_MSG LAZPERF_INCLUDE_DIR)
+
+# Copy the results to the output variables.
+IF(LAZPERF_FOUND)
+ SET(LAZPERF_LIBRARIES ${LAZPERF_LIBRARY})
+ SET(LAZPERF_INCLUDE_DIRS ${LAZPERF_INCLUDE_DIR})
+ELSE(LAZPERF_FOUND)
+ SET(LAZPERF_LIBRARIES)
+ SET(LAZPERF_INCLUDE_DIRS)
+ENDIF(LAZPERF_FOUND)
+
+MARK_AS_ADVANCED(LAZPERF_INCLUDE_DIR LAZPERF_LIBRARY)
diff --git a/cmake/pdal_targets.cmake b/cmake/pdal_targets.cmake
index b151b3785a..5854ece4ed 100644
--- a/cmake/pdal_targets.cmake
+++ b/cmake/pdal_targets.cmake
@@ -91,20 +91,25 @@ endmacro(PDAL_ADD_EXECUTABLE)
#
# Todo: handle windows/unix variants of the plugin name
# Todo: accept deps for target_link_libraries
-macro(PDAL_ADD_PLUGIN _name _type _shortname _srcs _incs)
- add_library(${_name} SHARED ${_srcs} ${_incs})
- target_link_libraries(${_name} ${PDAL_LINKAGE} ${PDAL_LIB_NAME})
+macro(PDAL_ADD_PLUGIN _name _type _shortname _srcs _incs _deps)
+ if(WIN32)
+ set(${_name} "libpdal_plugin_${_type}_${_shortname}")
+ else()
+ set(${_name} "pdal_plugin_${_type}_${_shortname}")
+ endif()
+ add_library(${${_name}} SHARED ${_srcs} ${_incs})
+ target_link_libraries(${${_name}} ${PDAL_LINKAGE} ${PDAL_LIB_NAME} ${_deps})
source_group("Header Files\\${_type}\\${_shortname}" FILES ${_incs})
source_group("Source Files\\${_type}\\${_shortname}" FILES ${_srcs})
- install(TARGETS ${_name}
+ install(TARGETS ${${_name}}
RUNTIME DESTINATION ${PDAL_BIN_DIR}
LIBRARY DESTINATION ${PDAL_LIB_DIR}
ARCHIVE DESTINATION ${PDAL_LIB_DIR})
endmacro(PDAL_ADD_PLUGIN)
-macro(PDAL_ADD_TEST _name _srcs)
+macro(PDAL_ADD_TEST _name _srcs _deps)
include_directories(${PROJECT_SOURCE_DIR}/test/unit)
include_directories(${PROJECT_BINARY_DIR}/test/unit)
set(common_srcs
@@ -114,7 +119,12 @@ macro(PDAL_ADD_TEST _name _srcs)
)
add_executable(${_name} ${_srcs} ${common_srcs})
set_target_properties(${_name} PROPERTIES COMPILE_DEFINITIONS PDAL_DLL_IMPORT)
- add_definitions("-DBOOST_TEST_DYN_LINK")
+ if(WIN32)
+ add_definitions("-DPDAL_DLL_EXPORT=1")
+ else()
+ add_definitions("-DBOOST_TEST_DYN_LINK")
+ endif()
target_link_libraries(${_name} ${PDAL_LINKAGE} ${PDAL_LIB_NAME})
+ target_link_libraries(${_name} ${PDAL_LINKAGE} ${_deps})
add_test(${_name} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_name}" "${PROJECT_SOURCE_DIR}/test/data" --catch_system_errors=no)
endmacro(PDAL_ADD_TEST)
diff --git a/doc/stages/drivers.rxp.reader.rst b/doc/stages/drivers.rxp.reader.rst
new file mode 100644
index 0000000000..b553d391a5
--- /dev/null
+++ b/doc/stages/drivers.rxp.reader.rst
@@ -0,0 +1,127 @@
+.. _drivers.rxp.reader:
+
+drivers.rxp.reader
+==================
+
+The **RXP reader** read from files in the RXP format, the in-house streaming format used by `RIEGL Laser Measurement Systems`_.
+
+.. warning::
+ This software has not been developed by RIEGL, and RIEGL will not provide any support for this driver.
+ Please do not contact RIEGL with any questions or issues regarding this driver.
+ RIEGL is not responsible for damages or other issues that arise from use of this driver.
+ This driver has been tested against RiVLib version 1.39 on a Ubuntu 14.04 using gcc43.
+
+
+Installation
+------------
+
+To build PDAL with rxp support, set RiVLib_DIR to the path of your local RiVLib installation.
+RiVLib can be obtained from the `RIEGL download pages`_ with a properly enabled user account.
+The RiVLib files do not need to be in a system-level directory, though they could be (e.g. they could be in ``/usr/local``, or just in your home directory somewhere).
+For help building PDAL with optional libraries, see `the optional library documentation`_.
+
+
+Example
+-------
+
+This example rescales the points, given in the scanner's own coordinate system, to values that can be written to a las file.
+Only points with a valid gps time, as determined by a pps pulse, are read from the rxp, since the ``sync_to_pps`` option is "true".
+
+.. code-block:: xml
+
+
+
+
+ output.las
+ true
+
+
+ X
+
+ 0.001
+ 0
+
+
+
+ Y
+
+ 0.001
+ 0
+
+
+
+ Z
+
+ 0.001
+ 0
+
+
+
+
+ import numpy
+ def reflectance_to_intensity(ins, outs):
+ ref = ins["Reflectance"]
+ min = numpy.amin(ref)
+ max = numpy.amax(ref)
+ outs["Intensity"] = (65535 * (ref - min) / (max - min)).astype(numpy.uint16)
+ return True
+
+ reflectance_to_intensity
+ pyrxp
+ Intensity
+
+ 120304_204030.rxp
+ true
+
+
+
+
+
+
+A few things to note:
+
+- We use a ``filters.programmable`` to remap Reflectance values to Intensity values, scaling them so the entire range of Reflectance values fit into the Intensity field.
+ This is analogous to the "Export reflectance as intensity" option in RiSCAN Pro.
+ You could also explicitly set the minimum and maximum Reflectance values as you would in RiSCAN Pro using the same programmable filter.
+ You could also use "Amplitude" instead of "Reflectance".
+ If you do not need Intensity values in your output file, you can delete the programmable filter.
+- We set the ``discard_high_return_numbers`` option to ``true`` on the las writer.
+ RXP files can contain more returns per shot than is supported by las, and so we need to explicitly tell the las writer to ignore those high return number points.
+ You could also use ``filters.predicate`` to filter those points earlier in the pipeline, or modify the return values with a ``filters.programmable``.
+
+
+Options
+-------
+
+filename
+ File to read from [Required if rdtp is not provided]
+
+rdtp
+ URI for a network-assessable scanner [Required if filename is not provided]
+
+sync_to_pps
+ If "true", ensure all incoming points have a valid pps timestamp, usually provided by some sort of GPS clock.
+ If "false", use the scanner's internal time.
+ Defaults to "true"
+
+minimal
+ If "true", only write X, Y, Z, and time values to the data stream.
+ If "false", write all available values as derived from the rxp file.
+ Use this feature to reduce the memory footprint of a PDAL run, if you don't need any values but the points themselves.
+ Defaults to "false".
+
+inclination_fix
+ *EXPERIMENTAL*: If "true", use inclination values in the rxp file to dynamically correct for inclination changes throughout the scan, using a moving average of 2 * ``inclination_fix_window`` inclination readings (see below).
+ This is an experimental feature that will remove some points from the data stream and modify many others.
+ Use with caution.
+ If "false", disable this feature.
+ Defaults to "false".
+
+inclination_fix_window
+ *EXPERIMENTAL*: Sets the half-size of the inclination fix window (see above).
+ Use of this feature should be considered highly experimental.
+
+
+.. _RIEGL Laser Measurement Systems: http://www.riegl.com
+.. _RIEGL download pages: http://www.riegl.com/members-area/software-downloads/libraries/
+.. _the optional library documentation: http://www.pdal.io/compilation/unix.html#configure-your-optional-libraries
diff --git a/doc/stages/index.rst b/doc/stages/index.rst
index 01d796f482..db0c2884ba 100644
--- a/doc/stages/index.rst
+++ b/doc/stages/index.rst
@@ -28,6 +28,7 @@ Readers & Writers
drivers.pcd.reader
drivers.pcd.writer
drivers.qfit.reader
+ drivers.rxp.reader
drivers.sbet.reader
drivers.text.writer
diff --git a/include/pdal/Charbuf.hpp b/include/pdal/Charbuf.hpp
index 12de1ff310..d31443d570 100644
--- a/include/pdal/Charbuf.hpp
+++ b/include/pdal/Charbuf.hpp
@@ -34,6 +34,7 @@
#pragma once
+#include
#include
#include
@@ -41,7 +42,7 @@ namespace pdal
{
// Turns a vector into a streambuf.
-class Charbuf : public std::streambuf
+class PDAL_DLL Charbuf : public std::streambuf
{
public:
Charbuf() : m_bufOffset(0)
@@ -54,15 +55,15 @@ class Charbuf : public std::streambuf
void initialize(char *buf, size_t count, pos_type bufOffset = 0);
protected:
- pos_type seekpos(pos_type pos, std::ios_base::openmode which =
+ std::ios::pos_type seekpos(std::ios::pos_type pos, std::ios_base::openmode which =
std::ios_base::in | std::ios_base::out);
- pos_type seekoff(off_type off, std::ios_base::seekdir dir,
+ std::ios::pos_type seekoff(std::ios::off_type off, std::ios_base::seekdir dir,
std::ios_base::openmode which = std::ios_base::in | std::ios_base::out);
private:
// The offset allows one to use offsets when seeking that refer not to
// the positions in the backing vector, but to some other reference point.
- pos_type m_bufOffset;
+ std::ios::pos_type m_bufOffset;
// For the put pointer, it seems we need the beginning of the buffer
// in order to deal with offsets.
char *m_buf;
diff --git a/include/pdal/Compression.hpp b/include/pdal/Compression.hpp
new file mode 100644
index 0000000000..a89ea817e5
--- /dev/null
+++ b/include/pdal/Compression.hpp
@@ -0,0 +1,378 @@
+/******************************************************************************
+* 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
+
+#ifdef PDAL_HAVE_LAZPERF
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#endif
+
+#include
+#include
+#include
+#include
+
+
+
+
+#include
+#include
+
+namespace pdal
+{
+
+
+namespace compression
+{
+
+
+namespace CompressionType
+{
+
+enum Enum
+{
+ None = 0,
+ Ght = 1,
+ Dimensional = 2,
+ Lazperf = 3,
+ Unknown = 256
+};
+
+} // namespace CompressionType
+
+
+template inline void Compress(PointContextRef ctx,
+ const PointBuffer& buffer,
+ CompressionStream& output,
+ CompressionType::Enum ctype,
+ PointId start,
+ PointId end)
+{
+
+#ifdef PDAL_HAVE_LAZPERF
+ using namespace laszip;
+ using namespace laszip::formats;
+
+ typedef encoders::arithmetic EncoderType;
+
+ EncoderType encoder(output);
+ auto compressor = make_dynamic_compressor(encoder);
+ const Dimension::IdList& dims = ctx.dims();
+// std::cout << listDims(ctx) << std::endl;
+ for (auto di = dims.begin(); di != dims.end(); ++di)
+ {
+ Dimension::Type::Enum t = ctx.dimType(*di);
+ size_t s = ctx.dimSize(*di);
+ if (t == Dimension::Type::Signed32)
+ {
+ if (s == 4)
+ {
+ compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Signed32 but size != 4!");
+ }
+ else if (t == Dimension::Type::Signed16)
+ {
+ if (s == 2)
+ {
+ compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Signed16 but size != 2 !");
+ }
+ else if (t == Dimension::Type::Signed8)
+ {
+ if (s == 1)
+ {
+ compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Signed8 but size != 1!");
+ }
+ else if (t == Dimension::Type::Signed64)
+ {
+ if (s == 8)
+ {
+ compressor->template add_field();
+ compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Signed64 but size != 8!");
+ }
+ else if (t == Dimension::Type::Unsigned32)
+ {
+ if (s == 4)
+ {
+ compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Unsigned32 but size != 4!");
+ }
+ else if (t == Dimension::Type::Unsigned16)
+ {
+ if (s == 2)
+ {
+ compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Unsigned16 but size != 2!");
+ }
+ else if (t == Dimension::Type::Unsigned8)
+ {
+ if (s == 1)
+ {
+ compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Unsigned8 but size != 1!");
+ }
+ else if (t == Dimension::Type::Unsigned64)
+ {
+ if (s == 8)
+ {
+ compressor->template add_field();
+ compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Unsigned64 but size != 8!");
+ }
+ else if (t == Dimension::Type::Double)
+ {
+ if (s == 8)
+ {
+ compressor->template add_field();
+ compressor->template add_field();
+// compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Double but size != 8!");
+ }
+ else if (t == Dimension::Type::Float)
+ {
+ if (s == 4)
+ {
+ compressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Float but size != 4!");
+ }
+ else
+ {
+
+ std::ostringstream oss;
+ oss << "Unhandled compression for dimension of type '" << Dimension::interpretationName(t) << "' for dimension '" << Dimension::name(*di) << "'";
+ throw pdal_error(oss.str());
+ }
+
+ }
+
+ std::vector bytes = buffer.getBytes();
+ size_t pointSize = ctx.pointSize();
+ uint8_t* pos = &(bytes.front())+ (pointSize * start);
+ if (end == 0) // Set to max
+ end = buffer.size();
+ uint8_t* end_pos = &(bytes.front())+ (pointSize * end);
+ while (pos != end_pos)
+ {
+ compressor->compress((const char*)pos);
+ pos += pointSize;
+ }
+
+ encoder.done();
+#endif
+}
+
+
+
+template inline PointBufferPtr Decompress(PointContextRef ctx,
+ CompressionStream& strm,
+ size_t howMany,
+ CompressionType::Enum ctype)
+{
+ std::vector output;
+#ifdef PDAL_HAVE_LAZPERF
+ using namespace laszip;
+ using namespace laszip::formats;
+
+ typedef decoders::arithmetic DecoderType;
+
+
+ DecoderType decoder(strm);
+ auto decompressor = make_dynamic_decompressor(decoder);
+ const Dimension::IdList& dims = ctx.dims();
+
+// std::cout << listDims(ctx) << std::endl;
+ for (auto di = dims.begin(); di != dims.end(); ++di)
+ {
+ Dimension::Type::Enum t = ctx.dimType(*di);
+ size_t s = ctx.dimSize(*di);
+ if (t == Dimension::Type::Signed32)
+ {
+ if (s == 4)
+ {
+ decompressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Signed32 but size != 4!");
+ }
+ else if (t == Dimension::Type::Signed16)
+ {
+ if (s == 2)
+ {
+ decompressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Signed16 but size != 2 !");
+ }
+ else if (t == Dimension::Type::Signed8)
+ {
+ if (s == 1)
+ {
+ decompressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Signed8 but size != 1!");
+ }
+ else if (t == Dimension::Type::Signed64)
+ {
+ if (s == 8)
+ {
+ decompressor->template add_field();
+ decompressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Signed64 but size != 8!");
+ }
+ else if (t == Dimension::Type::Unsigned32)
+ {
+ if (s == 4)
+ {
+ decompressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Unsigned32 but size != 4!");
+ }
+ else if (t == Dimension::Type::Unsigned16)
+ {
+ if (s == 2)
+ {
+ decompressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Unsigned16 but size != 2!");
+ }
+ else if (t == Dimension::Type::Unsigned8)
+ {
+ if (s == 1)
+ {
+ decompressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Unsigned8 but size != 1!");
+ }
+ else if (t == Dimension::Type::Unsigned64)
+ {
+ if (s == 8)
+ {
+ decompressor->template add_field();
+ decompressor->template add_field();
+ }
+
+ else
+ throw pdal_error("Dimension is type Unsigned64 but size != 8!");
+ }
+ else if (t == Dimension::Type::Double)
+ {
+ if (s == 8)
+ {
+ decompressor->template add_field();
+ decompressor->template add_field();
+// decompressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Double but size != 8!");
+ }
+ else if (t == Dimension::Type::Float)
+ {
+ if (s == 4)
+ {
+ decompressor->template add_field();
+ }
+ else
+ throw pdal_error("Dimension is type Float but size != 4!");
+ }
+ else
+ {
+
+ std::ostringstream oss;
+ oss << "Unhandled compression for dimension of type '" << Dimension::interpretationName(t) << "' for dimension '" << Dimension::name(*di) << "'";
+ throw pdal_error(oss.str());
+ }
+
+ }
+
+
+ output.resize(howMany * ctx.pointSize());
+ uint8_t* pos = &(output[0]);
+ size_t point_size = ctx.pointSize();
+
+ uint8_t* end_pos = pos + (point_size * howMany);
+ while (pos != end_pos)
+ {
+ decompressor->decompress((char*)pos);
+ pos+=point_size;
+ }
+
+#endif
+ PointBufferPtr b = PointBufferPtr(new PointBuffer(output, ctx));
+
+ return b;
+
+
+}
+
+} // compression
+} // namespace pdal
+
+
diff --git a/include/pdal/Dimension.hpp b/include/pdal/Dimension.hpp
index b0866c59dd..b82ad1d4b0 100644
--- a/include/pdal/Dimension.hpp
+++ b/include/pdal/Dimension.hpp
@@ -156,6 +156,8 @@ enum Enum
Y,
Z,
Intensity,
+ Amplitude,
+ Reflectance,
ReturnNumber,
NumberOfReturns,
ScanDirectionFlag,
@@ -168,6 +170,7 @@ enum Enum
Green,
Blue,
GpsTime,
+ InternalTime,
OffsetTime,
IsPpsLocked,
StartPulse,
@@ -176,7 +179,9 @@ enum Enum
Pitch,
Roll,
PulseWidth,
+ Deviation,
PassiveSignal,
+ BackgroundRadiation,
PassiveX,
PassiveY,
PassiveZ,
@@ -194,6 +199,7 @@ enum Enum
Flag,
Mark,
Alpha,
+ EchoRange,
ScanChannel,
Infrared
};
@@ -218,6 +224,16 @@ inline std::string description(Id::Enum id)
return "Z coordinate";
case Id::Intensity:
return "Representation of the pulse return magnitude";
+ case Id::Amplitude:
+ return "This is the ratio of the received power to the "
+ "power received at the detection limit expressed in dB";
+ case Id::Reflectance:
+ return "This is the ratio of the received power to the "
+ "power that would be received from a white diffuse target "
+ "at the same distance expressed in dB. The reflectance "
+ "represents a range independent property of the target. "
+ "The surface normal of this target is assumed to be in "
+ "parallel to the laser beam direction.";
case Id::ReturnNumber:
return "Pulse return number for a given output pulse. A given output "
"laser pulse can have many returns, and they must be marked in "
@@ -249,6 +265,8 @@ inline std::string description(Id::Enum id)
"indicates that the point originated in the current file";
case Id::GpsTime:
return "GPS time that the point was acquired";
+ case Id::InternalTime:
+ return "Scanner's internal time when the point was aquired, in seconds";
case Id::OffsetTime:
return "Milliseconds from first acquired point";
case Id::IsPpsLocked:
@@ -274,8 +292,12 @@ inline std::string description(Id::Enum id)
return "GPS PDOP (dilution of precision)";
case Id::PulseWidth:
return "Laser received pulse width (digitizer samples)";
+ case Id::Deviation:
+ return "A larger value for deviation indicates larger distortion.";
case Id::PassiveSignal:
return "Relative passive signal";
+ case Id::BackgroundRadiation:
+ return "A measure of background radiation.";
case Id::PassiveX:
return "Passive X footprint";
case Id::PassiveY:
@@ -308,6 +330,8 @@ inline std::string description(Id::Enum id)
return "Mark";
case Id::Flag:
return "Flag";
+ case Id::EchoRange:
+ return "The distance from the laser origin to the target.";
case Id::ScanChannel:
return "Scan Channel";
case Id::Infrared:
@@ -334,6 +358,10 @@ inline Id::Enum id(std::string s)
return Id::Z;
else if (s == "INTENSITY")
return Id::Intensity;
+ else if (s == "AMPLITUDE")
+ return Id::Amplitude;
+ else if (s == "REFLECTANCE")
+ return Id::Reflectance;
else if (s == "RETURNNUMBER")
return Id::ReturnNumber;
else if (s == "NUMBEROFRETURNS")
@@ -360,6 +388,8 @@ inline Id::Enum id(std::string s)
return Id::Alpha;
else if (s == "GPSTIME")
return Id::GpsTime;
+ else if (s == "INTERNALTIME")
+ return Id::InternalTime;
else if (s == "TIME" || s == "OFFSETTIME")
return Id::OffsetTime;
else if (s == "ISPPSLOCKED")
@@ -376,8 +406,12 @@ inline Id::Enum id(std::string s)
return Id::Pdop;
else if (s == "PULSEWIDTH")
return Id::PulseWidth;
+ else if (s == "DEVIATION")
+ return Id::Deviation;
else if (s == "PASSIVESIGNAL")
return Id::PassiveSignal;
+ else if (s == "BACKGROUNDRADIATION")
+ return Id::BackgroundRadiation;
else if (s == "PASSIVEX")
return Id::PassiveX;
else if (s == "PASSIVEY")
@@ -410,6 +444,8 @@ inline Id::Enum id(std::string s)
return Id::Mark;
else if (s == "FLAG")
return Id::Flag;
+ else if (s == "ECHORANGE")
+ return Id::EchoRange;
else if (s == "SCANCHANNEL")
return Id::ScanChannel;
else if (s == "INFRARED" || s == "NEARINFRARED")
@@ -432,6 +468,10 @@ inline std::string name(Id::Enum id)
return "Z";
case Id::Intensity:
return "Intensity";
+ case Id::Amplitude:
+ return "Amplitude";
+ case Id::Reflectance:
+ return "Reflectance";
case Id::ReturnNumber:
return "ReturnNumber";
case Id::NumberOfReturns:
@@ -458,6 +498,8 @@ inline std::string name(Id::Enum id)
return "Alpha";
case Id::GpsTime:
return "GpsTime";
+ case Id::InternalTime:
+ return "InternalTime";
case Id::OffsetTime:
return "OffsetTime";
case Id::IsPpsLocked:
@@ -474,8 +516,12 @@ inline std::string name(Id::Enum id)
return "Pdop";
case Id::PulseWidth:
return "PulseWidth";
+ case Id::Deviation:
+ return "Deviation";
case Id::PassiveSignal:
return "PassiveSignal";
+ case Id::BackgroundRadiation:
+ return "BackgroundRadiation";
case Id::PassiveX:
return "PassiveX";
case Id::PassiveY:
@@ -508,6 +554,8 @@ inline std::string name(Id::Enum id)
return "Mark";
case Id::Flag:
return "Flag";
+ case Id::EchoRange:
+ return "EchoRange";
case Id::ScanChannel:
return "ScanChannel";
case Id::Infrared:
@@ -537,6 +585,10 @@ inline Type::Enum defaultType(Id::Enum id)
return Double;
case Id::Intensity:
return Unsigned16;
+ case Id::Amplitude:
+ return Float;
+ case Id::Reflectance:
+ return Float;
case Id::ReturnNumber:
return Unsigned8;
case Id::NumberOfReturns:
@@ -555,6 +607,8 @@ inline Type::Enum defaultType(Id::Enum id)
return Unsigned16;
case Id::GpsTime:
return Double;
+ case Id::InternalTime:
+ return Double;
case Id::OffsetTime:
return Unsigned32;
case Id::IsPpsLocked:
@@ -579,8 +633,12 @@ inline Type::Enum defaultType(Id::Enum id)
return Float;
case Id::PulseWidth:
return Float;
+ case Id::Deviation:
+ return Float;
case Id::PassiveSignal:
return Signed32;
+ case Id::BackgroundRadiation:
+ return Float;
case Id::PassiveX:
return Double;
case Id::PassiveY:
@@ -613,6 +671,8 @@ inline Type::Enum defaultType(Id::Enum id)
return Unsigned8;
case Id::Flag:
return Unsigned8;
+ case Id::EchoRange:
+ return Double;
case Id::ScanChannel:
return Unsigned8;
case Id::Infrared:
diff --git a/include/pdal/Drivers.hpp b/include/pdal/Drivers.hpp
index 9ece4bee90..6d114a6c6b 100644
--- a/include/pdal/Drivers.hpp
+++ b/include/pdal/Drivers.hpp
@@ -32,8 +32,7 @@
* OF SUCH DAMAGE.
****************************************************************************/
-#ifndef INCLUDED_PDAL_DRIVERS_HPP
-#define INCLUDED_PDAL_DRIVERS_HPP
+#pragma once
#include
@@ -47,68 +46,10 @@
#include
-#ifdef PDAL_HAVE_HDF5
-#include
-#endif
-
-#ifdef PDAL_HAVE_ORACLE
-#ifndef USE_PDAL_PLUGIN_OCI
-#include
-#endif
-#endif
-
#ifdef PDAL_HAVE_CARIS
-#ifndef USE_PDAL_PLUGIN_CARIS
#include
#endif
-#endif
-
-#ifdef PDAL_HAVE_MRSID
-#ifndef USE_PDAL_PLUGIN_MRSID
-#include
-#endif
-#endif
#include
#include
#include
-
-#ifdef PDAL_HAVE_ORACLE
-#ifndef USE_PDAL_PLUGIN_OCI
-#include
-#endif
-#endif
-
-#ifdef PDAL_HAVE_NITRO
-#ifndef USE_PDAL_PLUGIN_NITF
-#include
-#endif
-#endif
-
-#ifdef PDAL_HAVE_NITRO
-#include
-#endif
-
-#ifdef PDAL_HAVE_P2G
-#include
-#endif
-
-#ifdef PDAL_HAVE_HDF5
-#include
-#endif
-
-#ifdef PDAL_HAVE_SQLITE
-#ifndef USE_PDAL_PLUGIN_SQLITE
-#include
-#include
-#endif
-#endif
-
-#ifdef PDAL_HAVE_POSTGRESQL
-#ifndef USE_PDAL_PLUGIN_PGPOINTCLOUD
-#include
-#include
-#endif
-#endif
-
-#endif
diff --git a/include/pdal/Filters.hpp b/include/pdal/Filters.hpp
index bc604db02e..fb9adb916c 100644
--- a/include/pdal/Filters.hpp
+++ b/include/pdal/Filters.hpp
@@ -42,7 +42,6 @@
#include
#include
#include
-#include
#include
#include
#ifdef PDAL_HAVE_PYTHON
diff --git a/include/pdal/Metadata.hpp b/include/pdal/Metadata.hpp
index 9553ec10c5..7a2d72ce7f 100644
--- a/include/pdal/Metadata.hpp
+++ b/include/pdal/Metadata.hpp
@@ -37,6 +37,7 @@
#include
#include
#include
+#include
#include
#include
@@ -52,7 +53,8 @@ namespace
{
auto ischar = [](char c)
{
- return c == ';' || c == ':' || c == ' ' || c == '\'' || c == '\"' || c == '[' || c ==']';
+ return c == ';' || c == ':' || c == ' ' || c == '\'' ||
+ c == '\"' || c == '[' || c ==']';
};
std::string v;
@@ -206,7 +208,6 @@ class MetadataNodeImpl
return MetadataType::Instance;
}
-
std::string toJSON() const;
void toJSON(std::ostream& o, int level) const;
void subnodesToJSON(std::ostream& o, int level) const;
@@ -450,8 +451,41 @@ class PDAL_DLL MetadataNode
}
std::string name() const
{ return m_impl->m_name; }
+
+ template
+ T value() const
+ {
+ T t;
+
+ if (m_impl->m_type == "base64Binary")
+ {
+ std::vector encVal =
+ Utils::base64_decode(m_impl->m_value);
+ encVal.resize(sizeof(T));
+ memcpy(&t, encVal.data(), sizeof(T));
+ }
+ else
+ {
+ try
+ {
+ t = boost::lexical_cast(m_impl->m_value);
+ }
+ catch (boost::bad_lexical_cast&)
+ {
+ // Static to get default initialization.
+ static T t2;
+ std::cerr << "Error converting metadata [" << name() <<
+ "] = " << m_impl->m_value << " to type " <<
+ Utils::typeidName() << " -- return default initialized.";
+ t = t2;
+ }
+ }
+ return t;
+ }
+
std::string value() const
{ return m_impl->m_value; }
+
std::string description() const
{ return m_impl->m_descrip; }
std::vector children() const
diff --git a/include/pdal/PointBuffer.hpp b/include/pdal/PointBuffer.hpp
index 749b7bdb55..d651dbc7dc 100644
--- a/include/pdal/PointBuffer.hpp
+++ b/include/pdal/PointBuffer.hpp
@@ -220,6 +220,65 @@ class PDAL_DLL PointBuffer
Dimension::IdList dims() const
{ return m_context.dims(); }
+ std::ostream& getBytes(std::ostream& strm, PointId start, PointId end) const
+ {
+ char buf[sizeof(double)];
+ for (PointId i = start; i < end; ++i)
+ {
+ for (const auto& dim : m_context.m_dims->m_used)
+ {
+ getFieldInternal(dim, i, buf);
+ strm.write(buf, m_context.dimSize(dim));
+ }
+ }
+ return strm;
+ }
+ std::vector getBytes() const
+ {
+ return getBytes(0, size());
+ }
+
+ std::vector getBytes(PointId start, PointId end) const
+ {
+ std::vector output;
+
+ size_t byteCount = PointBuffer::size() * m_context.pointSize();
+ output.reserve(byteCount);
+ output.resize(byteCount);
+
+ if (end == 0) end = PointBuffer::size();
+
+ uint8_t* pos = &(output.front());
+ for (PointId i = start; i < end; ++i)
+ {
+ for (const auto& dim : m_context.m_dims->m_used)
+ {
+ getFieldInternal(dim, i, pos);
+ pos += m_context.dimSize(dim);
+ }
+ }
+ return output;
+ }
+
+ PointBuffer(const std::vector& bytes, PointContextRef ctx) : m_context(ctx)
+ {
+
+ size_t pointCount = bytes.size() / ctx.pointSize();
+ if (bytes.size() % ctx.pointSize())
+ throw pdal_error("byte count is not a multiple of point size!");
+
+// assert(ctx.m_dims->m_used.size() == ctx.m_dims->m_detail.size());
+ const uint8_t* pos = &(bytes[0]);
+ for (PointId i = 0; i < pointCount; ++i)
+ {
+ for (const auto& dim : ctx.m_dims->m_used)
+ {
+ setFieldInternal(dim, i, pos);
+ pos += m_context.dimSize(dim);
+ }
+ }
+ }
+
protected:
PointContextRef m_context;
std::vector m_index;
diff --git a/include/pdal/PointContext.hpp b/include/pdal/PointContext.hpp
index 69f1b3e361..bd8bbfcdd0 100644
--- a/include/pdal/PointContext.hpp
+++ b/include/pdal/PointContext.hpp
@@ -206,6 +206,14 @@ class PointContext
size_t dimSize(Dimension::Id::Enum id) const
{ return dimDetail(id)->size(); }
+ size_t pointSize() const
+ {
+ size_t size(0);
+ for (auto d: m_dims->m_detail)
+ size += d.size();
+ return size;
+ }
+
private:
Dimension::Detail *dimDetail(Dimension::Id::Enum id) const
{ return &(m_dims->m_detail[(size_t)id]); }
diff --git a/include/pdal/XMLSchema.hpp b/include/pdal/XMLSchema.hpp
index 6ee9c7a7d9..8225cdb2be 100644
--- a/include/pdal/XMLSchema.hpp
+++ b/include/pdal/XMLSchema.hpp
@@ -196,13 +196,16 @@ class PDAL_DLL Reader
XMLSchema schema() const
{ return m_schema; }
+ MetadataNode getMetadata() const
+ { return m_metadata;}
+
protected:
void Initialize();
void Load();
private:
#ifdef PDAL_HAVE_LIBXML2
- pdal::Metadata LoadMetadata(xmlNode* node);
+ pdal::MetadataNode LoadMetadata(xmlNode* node, pdal::MetadataNode& input);
std::string remapOldNames(std::string const& input);
DocPtr m_doc;
@@ -220,6 +223,7 @@ class PDAL_DLL Reader
std::string m_xsd;
uint32_t m_field_position;
XMLSchema m_schema;
+ MetadataNode m_metadata;
Reader& operator=(const Reader&); // not implemented
Reader(const Reader&); // not implemented;
@@ -230,7 +234,7 @@ class PDAL_DLL Writer
{
public:
Writer(const Dimension::IdList& ids,
- const std::vector& types,
+ const std::vector& types,
Orientation::Enum orientation= Orientation::PointMajor) :
m_dims(ids), m_types(types), m_orientation(orientation)
{}
diff --git a/include/pdal/drivers/bpf/BpfReader.hpp b/include/pdal/drivers/bpf/BpfReader.hpp
index c9e31cb692..3cd4aca1c4 100644
--- a/include/pdal/drivers/bpf/BpfReader.hpp
+++ b/include/pdal/drivers/bpf/BpfReader.hpp
@@ -85,6 +85,7 @@ class PDAL_DLL BpfReader : public Reader
bool readUlemData();
bool readUlemFiles();
+ bool readHeaderExtraData();
bool readPolarData();
point_count_t readPointMajor(PointBuffer& data, point_count_t count);
point_count_t readDimMajor(PointBuffer& data, point_count_t count);
diff --git a/include/pdal/drivers/las/VariableLengthRecord.hpp b/include/pdal/drivers/las/VariableLengthRecord.hpp
index 7787e5b86f..27c51dfb17 100644
--- a/include/pdal/drivers/las/VariableLengthRecord.hpp
+++ b/include/pdal/drivers/las/VariableLengthRecord.hpp
@@ -89,6 +89,8 @@ class PDAL_DLL VariableLengthRecord
const char* data() const
{ return (const char *)m_data.data(); }
+ char* data()
+ { return (char *)m_data.data(); }
uint64_t dataLen() const
{ return m_data.size(); }
void setDataLen(uint64_t size)
diff --git a/include/pdal/drivers/las/Writer.hpp b/include/pdal/drivers/las/Writer.hpp
index 4a4334298c..5acc93b50e 100644
--- a/include/pdal/drivers/las/Writer.hpp
+++ b/include/pdal/drivers/las/Writer.hpp
@@ -41,12 +41,14 @@
namespace pdal
{
+class LasTester;
+
namespace drivers
{
namespace nitf
{
- class Writer;
+ class NitfWriter;
}
namespace las
@@ -65,7 +67,8 @@ struct VlrOptionInfo
class PDAL_DLL Writer : public pdal::Writer
{
- friend class nitf::Writer;
+ friend class pdal::LasTester;
+ friend class nitf::NitfWriter;
public:
SET_STAGE_NAME("drivers.las.writer", "Las Writer")
SET_STAGE_LINK("http://pdal.io/stages/drivers.las.writer.html")
@@ -122,6 +125,42 @@ class PDAL_DLL Writer : public pdal::Writer
Writer(const Writer&); // not implemented
};
+// Find the approriate value for the specified header field.
+/// \param name - Name of header field.
+/// \return Value of header field.
+template
+T Writer::headerVal(const std::string& name)
+{
+ // The header values either come from options, or are overriden in
+ // the metadata for options which had the value FORWARD. For those,
+ // grab the value from metadata if it exists, or use the default value,
+ // which was stuck on following the FORWARD value when processing options.
+ auto pred = [name](MetadataNode n)
+ {
+ return n.name() == name;
+ };
+
+ std::string val = m_headerVals[name];
+ if (val.find("FORWARD") == 0)
+ {
+ MetadataNode m = m_metadata.findChild(pred);
+ if (m.valid())
+ return m.value();
+ val = val.substr(strlen("FORWARD"));
+ }
+ try
+ {
+ return boost::lexical_cast(val);
+ }
+ catch (boost::bad_lexical_cast ex)
+ {
+ std::stringstream out;
+ out << "Couldn't convert option \"" << name << "\" with value \"" <<
+ val << "\" from string as necessary.";
+ throw pdal_error(out.str());
+ }
+}
+
} // namespace las
} // namespace drivers
} // namespace pdal
diff --git a/include/pdal/drivers/text/Writer.hpp b/include/pdal/drivers/text/Writer.hpp
index beec474ef1..e32aaff326 100644
--- a/include/pdal/drivers/text/Writer.hpp
+++ b/include/pdal/drivers/text/Writer.hpp
@@ -48,14 +48,6 @@ namespace drivers
namespace text
{
-#ifdef USE_PDAL_PLUGIN_TEXT
-PDAL_C_START
-
-PDAL_DLL void PDALRegister_writer_text(void* factory);
-
-PDAL_C_END
-#endif
-
typedef std::shared_ptr FileStreamPtr;
class PDAL_DLL Writer : public pdal::Writer
diff --git a/include/pdal/pdal_macros.hpp b/include/pdal/pdal_macros.hpp
index 97f9d7f164..ecdddcbafb 100644
--- a/include/pdal/pdal_macros.hpp
+++ b/include/pdal/pdal_macros.hpp
@@ -40,10 +40,7 @@
//
#define MAKE_READER_CREATOR(T, FullT) \
pdal::Reader* create_##T() \
- { \
- return new FullT(); \
- }
-
+ { pdal::Reader *r = new FullT(); return r; }
#define MAKE_FILTER_CREATOR(T, FullT) \
pdal::Filter* create_##T() \
{ pdal::Filter *f = new FullT(); return f; }
@@ -52,7 +49,7 @@
{ pdal::Writer *w = new FullT(); return w; }
#define MAKE_KERNEL_CREATOR(T, FullT) \
pdal::Kernel* create_##T() \
- { pdal::Kernel *a = new FullT(); return a; }
+ { pdal::Kernel *k = new FullT(); return k; }
//
// macros to register the stage creators
@@ -70,6 +67,9 @@
registerKernelDriverInfo(); \
registerKernel(FullT::s_getName(), create_##T)
+//
+// macros to create the various plugins types
+//
#define CREATE_READER_PLUGIN(T, FullT) \
MAKE_READER_CREATOR(T, FullT) \
PDAL_C_START PDAL_DLL void PDALRegister_reader_##T(void* factory) \
@@ -79,8 +79,7 @@
f.registerReader(FullT::s_getName(), create_##T); \
} \
PDAL_C_END \
- SET_PLUGIN_VERSION(T)
-
+ SET_READER_PLUGIN_VERSION(T)
#define CREATE_FILTER_PLUGIN(T, FullT) \
MAKE_FILTER_CREATOR(T, FullT) \
PDAL_C_START PDAL_DLL void PDALRegister_filter_##T(void* factory) \
@@ -90,8 +89,7 @@
f.registerFilter(FullT::s_getName(), create_##T); \
} \
PDAL_C_END \
- SET_PLUGIN_VERSION(T)
-
+ SET_FILTER_PLUGIN_VERSION(T)
#define CREATE_WRITER_PLUGIN(T, FullT) \
MAKE_WRITER_CREATOR(T, FullT) \
PDAL_C_START PDAL_DLL void PDALRegister_writer_##T(void* factory) \
@@ -101,8 +99,7 @@
f.registerWriter(FullT::s_getName(), create_##T); \
} \
PDAL_C_END \
- SET_PLUGIN_VERSION(T)
-
+ SET_WRITER_PLUGIN_VERSION(T)
#define CREATE_KERNEL_PLUGIN(T, FullT) \
MAKE_KERNEL_CREATOR(T, FullT) \
PDAL_C_START PDAL_DLL void PDALRegister_kernel_##T(void* factory) \
@@ -112,15 +109,27 @@
f.registerKernel(FullT::s_getName(), create_##T); \
} \
PDAL_C_END \
- SET_PLUGIN_VERSION(T)
+ SET_KERNEL_PLUGIN_VERSION(T)
-#define SET_PLUGIN_VERSION(DriverName) \
- PDAL_C_START PDAL_DLL int PDALRegister_version_##DriverName() \
- { \
- return PDAL_PLUGIN_VERSION; \
- } \
+//
+// macro to register the version of PDAL the plugin was linked against
+//
+#define SET_READER_PLUGIN_VERSION(T) \
+ PDAL_C_START PDAL_DLL int PDALRegister_version_reader_##T() \
+ { return PDAL_PLUGIN_VERSION; } \
+ PDAL_C_END
+#define SET_FILTER_PLUGIN_VERSION(T) \
+ PDAL_C_START PDAL_DLL int PDALRegister_version_filter_##T() \
+ { return PDAL_PLUGIN_VERSION; } \
+ PDAL_C_END
+#define SET_WRITER_PLUGIN_VERSION(T) \
+ PDAL_C_START PDAL_DLL int PDALRegister_version_writer_##T() \
+ { return PDAL_PLUGIN_VERSION; } \
+ PDAL_C_END
+#define SET_KERNEL_PLUGIN_VERSION(T) \
+ PDAL_C_START PDAL_DLL int PDALRegister_version_kernel_##T() \
+ { return PDAL_PLUGIN_VERSION; } \
PDAL_C_END
-
#ifdef _WIN32
inline long lround(double d)
diff --git a/pdal_defines.h.in b/pdal_defines.h.in
index 38c0a8e12c..01d7b34a97 100644
--- a/pdal_defines.h.in
+++ b/pdal_defines.h.in
@@ -31,6 +31,7 @@
#cmakedefine PDAL_HAVE_HDF5
#cmakedefine PDAL_HAVE_HEXER
#cmakedefine PDAL_HAVE_LASZIP
+#cmakedefine PDAL_HAVE_LAZPERF
#cmakedefine PDAL_HAVE_LIBXML2
#cmakedefine PDAL_HAVE_LIBGEOTIFF
#cmakedefine PDAL_HAVE_MRSID
@@ -41,7 +42,6 @@
#cmakedefine PDAL_HAVE_SQLITE
#cmakedefine PDAL_HAVE_POSTGRESQL
-
/*
* plugins
*/
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index 1e78054264..83828ec28d 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -1,7 +1,43 @@
-if(WITH_GREYHOUND)
+if(BUILD_PLUGIN_GREYHOUND)
add_subdirectory(greyhound)
endif()
-if(WITH_PCL)
+if(BUILD_PLUGIN_HEXBIN)
+ add_subdirectory(hexbin)
+endif()
+
+if(BUILD_PLUGIN_ICEBRIDGE)
+ add_subdirectory(icebridge)
+endif()
+
+if(BUILD_PLUGIN_MRSID)
+ add_subdirectory(mrsid)
+endif()
+
+if(BUILD_PLUGIN_NITF)
+ add_subdirectory(nitf)
+endif()
+
+if(BUILD_PLUGIN_OCI)
+ add_subdirectory(oci)
+endif()
+
+if(BUILD_PLUGIN_P2G)
+ add_subdirectory(p2g)
+endif()
+
+if(BUILD_PLUGIN_PCL)
add_subdirectory(pcl)
endif()
+
+if(BUILD_PLUGIN_PGPOINTCLOUD)
+ add_subdirectory(pgpointcloud)
+endif()
+
+if(BUILD_PLUGIN_SQLITE)
+ add_subdirectory(sqlite)
+endif()
+
+if(BUILD_PLUGIN_RIVLIB)
+ add_subdirectory(rxp)
+endif(BUILD_PLUGIN_RIVLIB)
diff --git a/plugins/greyhound/CMakeLists.txt b/plugins/greyhound/CMakeLists.txt
index d47b43486d..37dd11f192 100644
--- a/plugins/greyhound/CMakeLists.txt
+++ b/plugins/greyhound/CMakeLists.txt
@@ -3,38 +3,38 @@
#
include_directories(${PROJECT_SOURCE_DIR}/include)
-include_directories(${PROJECT_SOURCE_DIR}/plugin/greyhound)
-
-# attempt to find Greyhound required dependencies
-find_package(JSONCPP REQUIRED)
-find_package(WEBSOCKETPP REQUIRED)
-
-# JSONCPP and WEBSOCKETPP were both found
-message(STATUS "Building with Greyhound support")
-
-# add JSONCPP stuff
-include_directories(${JSONCPP_INCLUDE_DIR})
-add_definitions(-DHAVE_JSONCPP=1)
-
-# add WEBSOCKETPP stuff
-include_directories(${WEBSOCKETPP_INCLUDE_DIR})
-add_definitions(-D_WEBSOCKETPP_NULLPTR_TOKEN_=0)
-add_definitions(-DHAVE_WEBSOCKETPP=1)
-
-#
-# Greyhound Reader
-#
-set(srcs
- drivers/GreyhoundReader.cpp
- drivers/WebSocketClient.cpp
-)
-
-set(incs
- drivers/Exchanges.hpp
- drivers/GreyhoundReader.hpp
- drivers/WebSocketClient.hpp
-)
-
-set(GREYHOUND_LIB_NAME pdal_plugin_reader_greyhound)
-PDAL_ADD_PLUGIN(${GREYHOUND_LIB_NAME} reader greyhound ${srcs} ${incs})
-target_link_libraries(${GREYHOUND_LIB_NAME} ${PDAL_LINKAGE} ${JSONCPP_LIBRARY})
+include_directories(${PROJECT_SOURCE_DIR}/plugins/greyhound)
+
+find_package(JSONCPP)
+find_package(WEBSOCKETPP)
+if(JSONCPP_FOUND AND WEBSOCKETPP_FOUND)
+ message(STATUS "Building with Greyhound support")
+
+ # add JSONCPP stuff
+ include_directories(${JSONCPP_INCLUDE_DIR})
+ add_definitions(-DHAVE_JSONCPP=1)
+
+ # add WEBSOCKETPP stuff
+ include_directories(${WEBSOCKETPP_INCLUDE_DIR})
+ add_definitions(-D_WEBSOCKETPP_NULLPTR_TOKEN_=0)
+ add_definitions(-DHAVE_WEBSOCKETPP=1)
+
+ #
+ # Greyhound Reader
+ #
+ set(srcs
+ drivers/GreyhoundReader.cpp
+ drivers/WebSocketClient.cpp
+ )
+
+ set(incs
+ drivers/Exchanges.hpp
+ drivers/GreyhoundReader.hpp
+ drivers/WebSocketClient.hpp
+ )
+
+ set(deps ${JSONCPP_LIBRARY})
+ PDAL_ADD_PLUGIN(greyhound_reader_lib_name reader greyhound "${srcs}" "${incs}" "${deps}")
+else()
+ message(STATUS "Building without Greyhound support")
+endif()
diff --git a/plugins/greyhound/drivers/GreyhoundReader.hpp b/plugins/greyhound/drivers/GreyhoundReader.hpp
index dc350c51b3..4977c79c7c 100644
--- a/plugins/greyhound/drivers/GreyhoundReader.hpp
+++ b/plugins/greyhound/drivers/GreyhoundReader.hpp
@@ -39,12 +39,6 @@
#include "WebSocketClient.hpp"
-PDAL_C_START
-
-PDAL_DLL void PDALRegister_reader_greyhound(void* factory);
-
-PDAL_C_END
-
namespace pdal
{
namespace drivers
diff --git a/plugins/hexbin/CMakeLists.txt b/plugins/hexbin/CMakeLists.txt
new file mode 100644
index 0000000000..a48be35c2b
--- /dev/null
+++ b/plugins/hexbin/CMakeLists.txt
@@ -0,0 +1,39 @@
+#
+# HexBin plugin CMake configuration
+#
+
+include_directories(${PROJECT_SOURCE_DIR}/include)
+include_directories(${PROJECT_SOURCE_DIR}/plugins/hexbin)
+
+find_package(Hexer)
+if (HEXER_FOUND)
+ message(STATUS "Building with Hexer support")
+
+ include_directories(${HEXER_INCLUDE_DIR})
+ add_definitions(-DHAVE_HEXER=1)
+
+ #
+ # HexBin filter
+ #
+ set(srcs
+ filters/HexBin.cpp
+ )
+
+ set(incs
+ filters/HexBin.hpp
+ )
+
+ set(deps ${HEXER_LIBRARY})
+ PDAL_ADD_PLUGIN(hexbin_filter_lib_name filter hexbin "${srcs}" "${incs}" "${deps}")
+
+ #
+ # HexBin tests
+ #
+ set(srcs
+ test/HexbinFilterTest.cpp
+ )
+
+ PDAL_ADD_TEST(hexbintest "${srcs}" ${hexbin_filter_lib_name})
+else()
+ message(STATUS "Building without Hexer support")
+endif()
diff --git a/src/filters/HexBin.cpp b/plugins/hexbin/filters/HexBin.cpp
similarity index 96%
rename from src/filters/HexBin.cpp
rename to plugins/hexbin/filters/HexBin.cpp
index 31202c81d1..5bf17af0ec 100644
--- a/src/filters/HexBin.cpp
+++ b/plugins/hexbin/filters/HexBin.cpp
@@ -32,13 +32,14 @@
* OF SUCH DAMAGE.
****************************************************************************/
-#include
+#include "HexBin.hpp"
-#ifdef PDAL_HAVE_HEXER
#include
+#include
using namespace hexer;
-#endif
+
+CREATE_FILTER_PLUGIN(hexbin, pdal::filters::HexBin)
namespace pdal
{
@@ -60,7 +61,6 @@ void HexBin::processOptions(const Options& options)
void HexBin::ready(PointContext ctx)
{
-#ifdef PDAL_HAVE_HEXER
if (m_edgeLength == 0.0) // 0 can always be represented exactly.
{
m_grid.reset(new HexGrid(m_density));
@@ -68,26 +68,22 @@ void HexBin::ready(PointContext ctx)
}
else
m_grid.reset(new HexGrid(m_edgeLength * sqrt(3), m_density));
-#endif
}
void HexBin::filter(PointBuffer& buf)
{
-#ifdef PDAL_HAVE_HEXER
for (PointId idx = 0; idx < buf.size(); ++idx)
{
double x = buf.getFieldAs(pdal::Dimension::Id::X, idx);
double y = buf.getFieldAs(pdal::Dimension::Id::Y, idx);
m_grid->addPoint(x, y);
}
-#endif
}
void HexBin::done(PointContext ctx)
{
-#ifdef PDAL_HAVE_HEXER
m_grid->processSample();
m_grid->findShapes();
m_grid->findParentPaths();
@@ -137,7 +133,6 @@ void HexBin::done(PointContext ctx)
m_grid->toWKT(polygon);
m_metadata.add("boundary", polygon.str(),
"Boundary MULTIPOLYGON of domain");
-#endif
}
} // namespace filters
diff --git a/include/pdal/filters/HexBin.hpp b/plugins/hexbin/filters/HexBin.hpp
similarity index 95%
rename from include/pdal/filters/HexBin.hpp
rename to plugins/hexbin/filters/HexBin.hpp
index 3f7a7aa1e4..354510e0be 100644
--- a/include/pdal/filters/HexBin.hpp
+++ b/plugins/hexbin/filters/HexBin.hpp
@@ -36,11 +36,9 @@
#include
-#ifdef PDAL_HAVE_HEXER
#include
#include
#include
-#endif
namespace pdal
{
@@ -52,20 +50,14 @@ class PDAL_DLL HexBin : public Filter
public:
SET_STAGE_NAME("filters.hexbin", "Hexbin implementation")
SET_STAGE_LINK("http://pdal.io/stages/filters.hexbin.html")
-#ifdef PDAL_HAVE_HEXER
SET_STAGE_ENABLED(true)
-#else
- SET_STAGE_ENABLED(false)
-#endif
HexBin() : Filter()
{}
private:
-#ifdef PDAL_HAVE_HEXER
std::unique_ptr m_grid;
-#endif
std::string m_xDimName;
std::string m_yDimName;
uint32_t m_sampleSize;
diff --git a/test/unit/filters/HexbinFilterTest.cpp b/plugins/hexbin/test/HexbinFilterTest.cpp
similarity index 80%
rename from test/unit/filters/HexbinFilterTest.cpp
rename to plugins/hexbin/test/HexbinFilterTest.cpp
index 761a8c1caf..e3550d58bb 100644
--- a/test/unit/filters/HexbinFilterTest.cpp
+++ b/plugins/hexbin/test/HexbinFilterTest.cpp
@@ -35,16 +35,14 @@
#include "UnitTest.hpp"
#include
+#include
#include
-#include
#include
#include "Support.hpp"
BOOST_AUTO_TEST_SUITE(HexbinFilterTest)
-#ifdef PDAL_HAVE_HEXER
-
using namespace pdal;
void printChildren(std::ostream& out, MetadataNode m, int depth = 0)
@@ -75,29 +73,34 @@ BOOST_AUTO_TEST_CASE(HexbinFilterTest_test_1)
drivers::las::Reader reader;
reader.setOptions(options);
- filters::HexBin hexbin;
- hexbin.setOptions(options);
- hexbin.setInput(&reader);
+ StageFactory f;
+ StageFactory::FilterCreator* fc = f.getFilterCreator("filters.hexbin");
+ if(fc)
+ {
+ BOOST_CHECK(fc);
- PointContext ctx;
+ std::unique_ptr hexbin(fc());
+ hexbin->setOptions(options);
+ hexbin->setInput(&reader);
- hexbin.prepare(ctx);
- hexbin.execute(ctx);
+ PointContext ctx;
- MetadataNode m = ctx.metadata();
- m = m.findChild(hexbin.getName());
+ hexbin->prepare(ctx);
+ hexbin->execute(ctx);
- std::string filename = Support::temppath("hexbin.txt");
- std::ofstream out(filename);
- printChildren(out, m);
- out.close();
+ MetadataNode m = ctx.metadata();
+ m = m.findChild(hexbin->getName());
- BOOST_CHECK(Support::compare_text_files(filename,
- Support::datapath("filters/hexbin.txt")));
+ std::string filename = Support::temppath("hexbin.txt");
+ std::ofstream out(filename);
+ printChildren(out, m);
+ out.close();
- FileUtils::deleteFile(filename);
-}
+ BOOST_CHECK(Support::compare_text_files(filename,
+ Support::datapath("filters/hexbin.txt")));
-#endif
+ FileUtils::deleteFile(filename);
+ }
+}
BOOST_AUTO_TEST_SUITE_END()
diff --git a/plugins/icebridge/CMakeLists.txt b/plugins/icebridge/CMakeLists.txt
new file mode 100644
index 0000000000..df5bf35f92
--- /dev/null
+++ b/plugins/icebridge/CMakeLists.txt
@@ -0,0 +1,42 @@
+#
+# Icebridge plugin CMake configuration
+#
+
+include_directories(${PROJECT_SOURCE_DIR}/include)
+include_directories(${PROJECT_SOURCE_DIR}/plugins/icebridge)
+
+set (HDF5_FIND_COMPONENTS "CXX")
+find_package(HDF5 COMPONENTS CXX REQUIRED)
+if (HDF5_FOUND)
+ message(STATUS "Building with Icebridge support")
+
+ include_directories(${HDF5_INCLUDE_DIR})
+ add_definitions(-DHAVE_HDF5=1)
+
+ #
+ # Icebridge Reader
+ #
+ set(srcs
+ drivers/IcebridgeReader.cpp
+ drivers/Hdf5Handler.cpp
+ )
+
+ set(incs
+ drivers/IcebridgeReader.hpp
+ drivers/Hdf5Handler.hpp
+ )
+
+ set(deps ${HDF5_LIBRARIES})
+ PDAL_ADD_PLUGIN(icebridge_reader_lib_name reader icebridge "${srcs}" "${incs}" "${deps}")
+
+ #
+ # Icebridge tests
+ #
+ set(srcs
+ test/IcebridgeReaderTest.cpp
+ )
+
+ PDAL_ADD_TEST(icetest "${srcs}" ${icebridge_reader_lib_name})
+else()
+ message(STATUS "Building without Icebridge support")
+endif()
diff --git a/src/Hdf5Handler.cpp b/plugins/icebridge/drivers/Hdf5Handler.cpp
similarity index 99%
rename from src/Hdf5Handler.cpp
rename to plugins/icebridge/drivers/Hdf5Handler.cpp
index 36a52fcb70..9ddb5a5f28 100644
--- a/src/Hdf5Handler.cpp
+++ b/plugins/icebridge/drivers/Hdf5Handler.cpp
@@ -32,7 +32,7 @@
* OF SUCH DAMAGE.
****************************************************************************/
-#include
+#include "Hdf5Handler.hpp"
#include
#include
diff --git a/include/pdal/Hdf5Handler.hpp b/plugins/icebridge/drivers/Hdf5Handler.hpp
similarity index 100%
rename from include/pdal/Hdf5Handler.hpp
rename to plugins/icebridge/drivers/Hdf5Handler.hpp
diff --git a/src/drivers/icebridge/Reader.cpp b/plugins/icebridge/drivers/IcebridgeReader.cpp
similarity index 92%
rename from src/drivers/icebridge/Reader.cpp
rename to plugins/icebridge/drivers/IcebridgeReader.cpp
index c33f9bb663..ca2cdfe019 100644
--- a/src/drivers/icebridge/Reader.cpp
+++ b/plugins/icebridge/drivers/IcebridgeReader.cpp
@@ -32,12 +32,14 @@
* OF SUCH DAMAGE.
****************************************************************************/
-#include
+#include "IcebridgeReader.hpp"
#include
#include
#include
+CREATE_READER_PLUGIN(icebridge, pdal::drivers::icebridge::IcebridgeReader)
+
namespace
{
const std::vector hdf5Columns =
@@ -64,7 +66,7 @@ namespace drivers
namespace icebridge
{
-Options Reader::getDefaultOptions()
+Options IcebridgeReader::getDefaultOptions()
{
Options options;
options.add("filename", "", "file to read from");
@@ -72,7 +74,7 @@ Options Reader::getDefaultOptions()
}
-Dimension::IdList Reader::getDefaultDimensions()
+Dimension::IdList IcebridgeReader::getDefaultDimensions()
{
Dimension::IdList ids;
@@ -94,20 +96,20 @@ Dimension::IdList Reader::getDefaultDimensions()
}
-void Reader::addDimensions(PointContextRef ctx)
+void IcebridgeReader::addDimensions(PointContextRef ctx)
{
return ctx.registerDims(getDefaultDimensions());
}
-void Reader::ready(PointContextRef ctx)
+void IcebridgeReader::ready(PointContextRef ctx)
{
m_hdf5Handler.initialize(m_filename, hdf5Columns);
m_index = 0;
}
-point_count_t Reader::read(PointBuffer& buf, point_count_t count)
+point_count_t IcebridgeReader::read(PointBuffer& buf, point_count_t count)
{
//All data we read for icebridge is currently 4 bytes wide, so
// just allocate once and forget it.
@@ -172,13 +174,13 @@ point_count_t Reader::read(PointBuffer& buf, point_count_t count)
}
-void Reader::done(PointContextRef ctx)
+void IcebridgeReader::done(PointContextRef ctx)
{
m_hdf5Handler.close();
}
-bool Reader::eof()
+bool IcebridgeReader::eof()
{
return m_index >= m_hdf5Handler.getNumPoints();
}
diff --git a/include/pdal/drivers/icebridge/Reader.hpp b/plugins/icebridge/drivers/IcebridgeReader.hpp
similarity index 89%
rename from include/pdal/drivers/icebridge/Reader.hpp
rename to plugins/icebridge/drivers/IcebridgeReader.hpp
index 6528469d1a..ffa325b7be 100644
--- a/include/pdal/drivers/icebridge/Reader.hpp
+++ b/plugins/icebridge/drivers/IcebridgeReader.hpp
@@ -36,7 +36,9 @@
#include
#include
-#include
+#include
+
+#include "Hdf5Handler.hpp"
#include
@@ -54,14 +56,14 @@ class icebridge_error : public pdal_error
{ }
};
-class PDAL_DLL Reader : public pdal::Reader
+class PDAL_DLL IcebridgeReader : public pdal::Reader
{
public:
SET_STAGE_NAME("drivers.icebridge.reader", "Icebridge Reader")
SET_STAGE_LINK("http://pdal.io/stages/drivers.icebridge.reader.html")
SET_STAGE_ENABLED(true)
- Reader() : pdal::Reader()
+ IcebridgeReader() : pdal::Reader()
{}
static Options getDefaultOptions();
@@ -77,8 +79,8 @@ class PDAL_DLL Reader : public pdal::Reader
virtual void done(PointContextRef ctx);
virtual bool eof();
- Reader& operator=(const Reader&); // Not implemented.
- Reader(const Reader&); // Not implemented.
+ IcebridgeReader& operator=(const IcebridgeReader&); // Not implemented.
+ IcebridgeReader(const IcebridgeReader&); // Not implemented.
};
} // namespace icebridge
diff --git a/test/unit/drivers/icebridge/IcebridgeReaderTest.cpp b/plugins/icebridge/test/IcebridgeReaderTest.cpp
similarity index 68%
rename from test/unit/drivers/icebridge/IcebridgeReaderTest.cpp
rename to plugins/icebridge/test/IcebridgeReaderTest.cpp
index a2db5c4a18..b292912893 100644
--- a/test/unit/drivers/icebridge/IcebridgeReaderTest.cpp
+++ b/plugins/icebridge/test/IcebridgeReaderTest.cpp
@@ -38,8 +38,7 @@
#include
#include
#include
-
-#include
+#include
#include "StageTester.hpp"
#include "Support.hpp"
@@ -94,49 +93,56 @@ BOOST_AUTO_TEST_SUITE(IcebridgeReaderTest)
BOOST_AUTO_TEST_CASE(testRead)
{
- Option filename("filename", getFilePath(), "");
- Options options(filename);
- drivers::icebridge::Reader reader;
- reader.setOptions(options);
-
- PointContext ctx;
- reader.prepare(ctx);
- PointBufferSet pbSet = reader.execute(ctx);
- BOOST_CHECK_EQUAL(pbSet.size(), 1);
- PointBufferPtr buf = *pbSet.begin();
- BOOST_CHECK_EQUAL(buf->size(), 2);
-
- checkPoint(
- *buf,
- 0,
- 141437548, // time
- 82.605319, // latitude
- 301.406196, // longitude
- 18.678, // elevation
- 2408, // xmtSig
- 181, // rcvSig
- 49.91, // azimuth
- -4.376, // pitch
- 0.608, // roll
- 2.9, // gpsPdop
- 20.0, // pulseWidth
- 0.0); // relTime
-
- checkPoint(
- *buf,
- 1,
- 141437548, // time
- 82.605287, // latitude
- 301.404862, // longitude
- 18.688, // elevation
- 2642, // xmtSig
- 173, // rcvSig
- 52.006, // azimuth
- -4.376, // pitch
- 0.609, // roll
- 2.9, // gpsPdop
- 17.0, // pulseWidth
- 0.0); // relTime
+ StageFactory f;
+ StageFactory::ReaderCreator* rc = f.getReaderCreator("drivers.icebridge.reader");
+ if (rc)
+ {
+ BOOST_CHECK(rc);
+
+ Option filename("filename", getFilePath(), "");
+ Options options(filename);
+ std::unique_ptr reader(rc());
+ reader->setOptions(options);
+
+ PointContext ctx;
+ reader->prepare(ctx);
+ PointBufferSet pbSet = reader->execute(ctx);
+ BOOST_CHECK_EQUAL(pbSet.size(), 1);
+ PointBufferPtr buf = *pbSet.begin();
+ BOOST_CHECK_EQUAL(buf->size(), 2);
+
+ checkPoint(
+ *buf,
+ 0,
+ 141437548, // time
+ 82.605319, // latitude
+ 301.406196, // longitude
+ 18.678, // elevation
+ 2408, // xmtSig
+ 181, // rcvSig
+ 49.91, // azimuth
+ -4.376, // pitch
+ 0.608, // roll
+ 2.9, // gpsPdop
+ 20.0, // pulseWidth
+ 0.0); // relTime
+
+ checkPoint(
+ *buf,
+ 1,
+ 141437548, // time
+ 82.605287, // latitude
+ 301.404862, // longitude
+ 18.688, // elevation
+ 2642, // xmtSig
+ 173, // rcvSig
+ 52.006, // azimuth
+ -4.376, // pitch
+ 0.609, // roll
+ 2.9, // gpsPdop
+ 17.0, // pulseWidth
+ 0.0); // relTime
+ }
}
BOOST_AUTO_TEST_CASE(testPipeline)
diff --git a/plugins/mrsid/CMakeLists.txt b/plugins/mrsid/CMakeLists.txt
new file mode 100644
index 0000000000..8601b0e6d1
--- /dev/null
+++ b/plugins/mrsid/CMakeLists.txt
@@ -0,0 +1,31 @@
+#
+# MrSID plugin CMake configuration
+#
+
+include_directories(${PROJECT_SOURCE_DIR}/include)
+include_directories(${PROJECT_SOURCE_DIR}/plugins/mrsid)
+
+set(MRSID_ROOT "/Users/hobu/installs/mrsid/Lidar_DSDK" CACHE STRING "Root directory of MrSID install")
+find_package(MrSID)
+if(MRSID_FOUND)
+ message(STATUS "Building with MrSID support")
+
+ include_directories(${MRSID_INCLUDE_DIR})
+ add_definitions(-DHAVE_MRSID=1)
+
+ #
+ # MrSID Reader
+ #
+ set(srcs
+ drivers/MrsidReader.cpp
+ )
+
+ set(incs
+ drivers/MrsidReader.hpp
+ )
+
+ set(deps ${MRSID_LIBRARY})
+ PDAL_ADD_PLUGIN(mrsid_reader_lib_name reader mrsid "${srcs}" "${incs}" "${deps}")
+else()
+ message(STATUS "Building without MrSID support")
+endif()
diff --git a/src/drivers/mrsid/Reader.cpp b/plugins/mrsid/drivers/MrsidReader.cpp
similarity index 93%
rename from src/drivers/mrsid/Reader.cpp
rename to plugins/mrsid/drivers/MrsidReader.cpp
index c7b2bdba77..03b394f480 100644
--- a/src/drivers/mrsid/Reader.cpp
+++ b/plugins/mrsid/drivers/MrsidReader.cpp
@@ -32,13 +32,15 @@
* OF SUCH DAMAGE.
****************************************************************************/
-#include
+#include "MrsidReader.hpp"
#include
#include
+CREATE_READER_PLUGIN(mrsid, pdal::drivers::mrsid::MrsidReader)
+
namespace pdal
{
namespace drivers
@@ -47,28 +49,21 @@ namespace mrsid
{
-Reader::Reader(const Options& options)
- : pdal::Reader(options)
-{
- return;
-}
-
-
-Reader::Reader(LizardTech::PointSource *ps)
- : pdal::Reader(Options::none())
+MrsidReader::MrsidReader(LizardTech::PointSource *ps)
+ : pdal::Reader()
, m_PS(ps), m_iter(NULL)
{
m_PS->retain();
return;
}
-Reader::~Reader()
+MrsidReader::~MrsidReader()
{
m_iter->release();
m_PS->release();
}
-Dimension Reader::LTChannelToPDalDimension(const LizardTech::ChannelInfo & channel, pdal::Schema const& dimensions) const
+Dimension MrsidReader::LTChannelToPDalDimension(const LizardTech::ChannelInfo & channel, pdal::Schema const& dimensions) const
{
std::string name = channel.getName();
@@ -89,7 +84,7 @@ Dimension Reader::LTChannelToPDalDimension(const LizardTech::ChannelInfo & chann
}
-void Reader::initialize()
+void MrsidReader::initialize()
{
const LizardTech::PointInfo& pointinfo = m_PS->getPointInfo();
@@ -111,18 +106,18 @@ void Reader::initialize()
}
-Options Reader::getDefaultOptions()
+Options MrsidReader::getDefaultOptions()
{
Options options;
return options;
}
-pdal::StageSequentialIterator* Reader::createSequentialIterator(PointBuffer& buffer) const
+pdal::StageSequentialIterator* MrsidReader::createSequentialIterator(PointBuffer& buffer) const
{
- return new pdal::drivers::mrsid::iterators::sequential::Reader(*this, buffer, getNumPoints());
+ return new pdal::drivers::mrsid::iterators::sequential::MrsidReader(*this, buffer, getNumPoints());
}
-int Reader::SchemaToPointInfo(const Schema &schema, LizardTech::PointInfo &pointInfo) const
+int MrsidReader::SchemaToPointInfo(const Schema &schema, LizardTech::PointInfo &pointInfo) const
{
schema::index_by_index const& dims = schema.getDimensions().get();
@@ -176,7 +171,7 @@ int Reader::SchemaToPointInfo(const Schema &schema, LizardTech::PointInfo &point
}
-boost::uint32_t Reader::processBuffer(PointBuffer& data, boost::uint64_t index) const
+boost::uint32_t MrsidReader::processBuffer(PointBuffer& data, boost::uint64_t index) const
{
const Schema& schema = data.getSchema();
@@ -313,7 +308,7 @@ boost::uint32_t Reader::processBuffer(PointBuffer& data, boost::uint64_t index)
return cnt;
}
-std::vector Reader::getDefaultDimensions()
+std::vector MrsidReader::getDefaultDimensions()
{
std::vector output;
@@ -408,7 +403,7 @@ namespace sequential
{
-Reader::Reader(const pdal::drivers::mrsid::Reader& reader, PointBuffer& buffer, boost::uint32_t numPoints)
+MrsidReader::MrsidReader(const pdal::drivers::mrsid::MrsidReader& reader, PointBuffer& buffer, boost::uint32_t numPoints)
: pdal::ReaderSequentialIterator(buffer)
, m_numPoints(numPoints)
, m_reader(reader)
@@ -417,13 +412,13 @@ Reader::Reader(const pdal::drivers::mrsid::Reader& reader, PointBuffer& buffer,
}
-boost::uint64_t Reader::skipImpl(boost::uint64_t count)
+boost::uint64_t MrsidReader::skipImpl(boost::uint64_t count)
{
return count;
}
-bool Reader::atEndImpl() const
+bool MrsidReader::atEndImpl() const
{
// const boost::uint64_t numPoints = getStage().getNumPoints();
const boost::uint64_t currPoint = getIndex();
@@ -431,7 +426,7 @@ bool Reader::atEndImpl() const
}
-boost::uint32_t Reader::readBufferImpl(PointBuffer& data)
+boost::uint32_t MrsidReader::readBufferImpl(PointBuffer& data)
{
return m_reader.processBuffer(data, getIndex());
}
diff --git a/include/pdal/drivers/mrsid/Reader.hpp b/plugins/mrsid/drivers/MrsidReader.hpp
similarity index 82%
rename from include/pdal/drivers/mrsid/Reader.hpp
rename to plugins/mrsid/drivers/MrsidReader.hpp
index ff5261cafc..58fdb2a09b 100644
--- a/include/pdal/drivers/mrsid/Reader.hpp
+++ b/plugins/mrsid/drivers/MrsidReader.hpp
@@ -32,8 +32,7 @@
* OF SUCH DAMAGE.
****************************************************************************/
-#ifndef INCLUDED_DRIVERS_MrSID_READER_HPP
-#define INCLUDED_DRIVERS_MrSID_READER_HPP
+#pragma once
#include
#include
@@ -61,21 +60,17 @@ namespace mrsid
// The MrSIDReader wraps LT's PointSource abstraction
//
-class PDAL_DLL Reader : public pdal::Reader
+class PDAL_DLL MrsidReader : public pdal::Reader
{
public:
SET_STAGE_NAME("drivers.mrsid.reader", "MrSID Reader")
SET_STAGE_LINK("http://www.pdal.io/stages/drivers.mrsid.reader.html")
-#ifdef PDAL_HAVE_MRSID
SET_STAGE_ENABLED(true)
-#else
- SET_STAGE_ENABLED(false)
-#endif
- virtual ~Reader();
- Reader();
- Reader(LizardTech::PointSource *ps);
+ virtual ~MrsidReader();
+ MrsidReader() : Writer() {};
+ MrsidReader(LizardTech::PointSource *ps);
static Options getDefaultOptions();
static std::vector getDefaultDimensions();
@@ -92,8 +87,8 @@ class PDAL_DLL Reader : public pdal::Reader
virtual void initialize();
int SchemaToPointInfo(const Schema &schema, LizardTech::PointInfo &pointInfo) const;
Dimension LTChannelToPDalDimension(const LizardTech::ChannelInfo & channel, pdal::Schema const& dimensions) const;
- Reader& operator=(const Reader&); // not implemented
- Reader(const Reader&); // not implemented
+ MrsidReader& operator=(const MrsidReader&); // not implemented
+ MrsidReader(const MrsidReader&); // not implemented
};
namespace iterators
@@ -102,10 +97,10 @@ namespace iterators
namespace sequential
{
-class Reader : public pdal::ReaderSequentialIterator
+class MrsidReader : public pdal::ReaderSequentialIterator
{
public:
- Reader(const pdal::drivers::mrsid::Reader& reader, PointBuffer& buffer, boost::uint32_t numPoints);
+ MrsidReader(const pdal::drivers::mrsid::MrsidReader& reader, PointBuffer& buffer, boost::uint32_t numPoints);
private:
boost::uint64_t skipImpl(boost::uint64_t);
@@ -113,7 +108,7 @@ class Reader : public pdal::ReaderSequentialIterator
bool atEndImpl() const;
boost::uint32_t m_numPoints;
- const pdal::drivers::mrsid::Reader& m_reader;
+ const pdal::drivers::mrsid::MrsidReader& m_reader;
};
} // sequential
@@ -121,17 +116,17 @@ class Reader : public pdal::ReaderSequentialIterator
namespace random
{
-class Reader : public pdal::ReaderRandomIterator
+class MrsidReader : public pdal::ReaderRandomIterator
{
public:
- Reader(const pdal::drivers::mrsid::Reader& reader,
+ MrsidReader(const pdal::drivers::mrsid::MrsidReader& reader,
PointBuffer& buffer, boost::uint32_t numPoints);
private:
boost::uint64_t seekImpl(boost::uint64_t);
boost::uint32_t readBufferImpl(PointBuffer&);
- const pdal::drivers::mrsid::Reader& m_reader;
+ const pdal::drivers::mrsid::MrsidReader& m_reader;
boost::uint32_t m_numPoints;
};
@@ -144,6 +139,3 @@ class Reader : public pdal::ReaderRandomIterator
}
}
} // namespaces
-
-
-#endif
diff --git a/plugins/nitf/CMakeLists.txt b/plugins/nitf/CMakeLists.txt
new file mode 100644
index 0000000000..975197e4fe
--- /dev/null
+++ b/plugins/nitf/CMakeLists.txt
@@ -0,0 +1,104 @@
+#
+# NITF plugin CMake configuration
+#
+
+include_directories(${PROJECT_SOURCE_DIR}/include)
+include_directories(${PROJECT_SOURCE_DIR}/plugins/nitf)
+
+find_package(Nitro 2.6 REQUIRED)
+if(NITRO_FOUND)
+ message(STATUS "Building with NITF support")
+
+ include_directories(${NITRO_INCLUDE_DIR})
+ include_directories("${NITRO_INCLUDE_DIR}/nitro/c++")
+ include_directories("${NITRO_INCLUDE_DIR}/nitro/c")
+ add_definitions("-D_REENTRANT")
+ if (WIN32)
+ add_definitions("-DSIZEOF_SIZE_T=4")
+ add_definitions("-DIMPORT_NITRO_API")
+ else()
+ add_definitions("-D__POSIX")
+ endif()
+
+ set(PDAL_LAS_PATH drivers/las)
+ set(PDAL_LAS_HEADERS "${PROJECT_SOURCE_DIR}/include/pdal/${PDAL_LAS_PATH}")
+ set(PDAL_LAS_SRC "${PROJECT_SOURCE_DIR}/src/${PDAL_LAS_PATH}")
+
+ if ((GEOTIFF_FOUND) AND (GDAL_FOUND))
+ set(PDAL_GTIFF_SRCS "${PDAL_LAS_SRC}/GeotiffSupport.cpp")
+ set(PDAL_GTIFF_INCS "${PDAL_LAS_SRC}/GeotiffSupport.hpp")
+ endif()
+
+ if (LASZIP_FOUND)
+ set(PDAL_LASZIP_SRCS "${PDAL_LAS_SRC}/ZipPoint.cpp")
+ set(PDAL_LASZIP_INCS "${PDAL_LAS_HEADERS}/ZipPoint.hpp")
+ endif()
+
+ set(PDAL_LAS_SRCS
+ ${PDAL_GTIFF_SRCS}
+ ${PDAL_LASZIP_SRCS}
+ "${PDAL_LAS_SRC}/Header.cpp"
+ "${PDAL_LAS_SRC}/Reader.cpp"
+ "${PDAL_LAS_SRC}/SummaryData.cpp"
+ "${PDAL_LAS_SRC}/VariableLengthRecord.cpp"
+ "${PDAL_LAS_SRC}/Writer.cpp"
+ )
+
+ set(PDAL_LAS_INCS
+ ${PDAL_GTIFF_INCS}
+ ${PDAL_LASZIP_INCS}
+ "${PDAL_LAS_HEADERS}/Header.hpp"
+ "${PDAL_LAS_HEADERS}/Reader.hpp"
+ "${PDAL_LAS_HEADERS}/SummaryData.hpp"
+ "${PDAL_LAS_HEADERS}/VariableLengthRecord.hpp"
+ "${PDAL_LAS_HEADERS}/Writer.hpp"
+ )
+
+ #
+ # NITF Reader
+ #
+ set(srcs
+ ${PDAL_LAS_SRCS}
+ drivers/NitfFile.cpp
+ drivers/MetadataReader.cpp
+ drivers/tre_plugins.cpp
+ drivers/NitfReader.cpp
+ )
+
+ set(incs
+ ${PDAL_LAS_INCS}
+ drivers/NitfFile.hpp
+ drivers/MetadataReader.hpp
+ drivers/tre_plugins.hpp
+ drivers/NitfReader.hpp
+ )
+
+ set(deps ${NITRO_LIBRARIES})
+ PDAL_ADD_PLUGIN(nitf_reader_lib_name reader nitf "${srcs}" "${incs}" "${deps}")
+
+ #
+ # NITF Writer
+ #
+ set(srcs
+ ${PDAL_LAS_SRCS}
+ drivers/NitfWriter.cpp
+ drivers/tre_plugins.cpp
+ )
+
+ set(incs
+ ${PDAL_LAS_INCS}
+ drivers/NitfWriter.hpp
+ drivers/tre_plugins.hpp
+ )
+
+ set(deps ${NITRO_LIBRARIES})
+ PDAL_ADD_PLUGIN(nitf_writer_lib_name writer nitf "${srcs}" "${incs}" "${deps}")
+
+ set(srcs
+ test/NitfReaderTest.cpp
+ test/NitfWriterTest.cpp
+ )
+
+ set(deps ${nitf_reader_lib_name} ${nitf_writer_lib_name})
+ PDAL_ADD_TEST(nitftest "${srcs}" "${deps}")
+endif()
diff --git a/src/drivers/nitf/MetadataReader.cpp b/plugins/nitf/drivers/MetadataReader.cpp
similarity index 99%
rename from src/drivers/nitf/MetadataReader.cpp
rename to plugins/nitf/drivers/MetadataReader.cpp
index 700aff3f9f..06d2cc2faf 100644
--- a/src/drivers/nitf/MetadataReader.cpp
+++ b/plugins/nitf/drivers/MetadataReader.cpp
@@ -34,8 +34,6 @@
#include "MetadataReader.hpp"
-#ifdef PDAL_HAVE_NITRO
-
#include
#include
@@ -423,5 +421,3 @@ void MetadataReader::doComments(const std::string& key,
}
}
} // namespaces
-
-#endif // PDAL_HAVE_NITRO
diff --git a/src/drivers/nitf/MetadataReader.hpp b/plugins/nitf/drivers/MetadataReader.hpp
similarity index 98%
rename from src/drivers/nitf/MetadataReader.hpp
rename to plugins/nitf/drivers/MetadataReader.hpp
index c868d73720..79ccc511af 100644
--- a/src/drivers/nitf/MetadataReader.hpp
+++ b/plugins/nitf/drivers/MetadataReader.hpp
@@ -36,8 +36,6 @@
#include
-#ifdef PDAL_HAVE_NITRO
-
#include
#ifdef PDAL_COMPILER_GCC
@@ -133,5 +131,3 @@ class PDAL_DLL MetadataReader
} } } // namespaces
-
-#endif // HAVE_NITRO
diff --git a/src/drivers/nitf/NitfFile.cpp b/plugins/nitf/drivers/NitfFile.cpp
similarity index 99%
rename from src/drivers/nitf/NitfFile.cpp
rename to plugins/nitf/drivers/NitfFile.cpp
index c5f5cb135c..e6363dabbe 100644
--- a/src/drivers/nitf/NitfFile.cpp
+++ b/plugins/nitf/drivers/NitfFile.cpp
@@ -34,8 +34,6 @@
#include "NitfFile.hpp"
-#ifdef PDAL_HAVE_NITRO
-
#include
#include
@@ -268,5 +266,3 @@ bool NitfFile::locateLidarDataSegment()
}
}
} // namespaces
-
-#endif // PDAL_HAVE_NITRO
diff --git a/src/drivers/nitf/NitfFile.hpp b/plugins/nitf/drivers/NitfFile.hpp
similarity index 98%
rename from src/drivers/nitf/NitfFile.hpp
rename to plugins/nitf/drivers/NitfFile.hpp
index f6182490b2..6d298a158c 100644
--- a/src/drivers/nitf/NitfFile.hpp
+++ b/plugins/nitf/drivers/NitfFile.hpp
@@ -36,8 +36,6 @@
#include
-#ifdef PDAL_HAVE_NITRO
-
#include
#ifdef PDAL_COMPILER_GCC
@@ -109,5 +107,3 @@ class PDAL_DLL NitfFile
} } } // namespaces
-
-#endif // HAVE_NITRO
diff --git a/src/drivers/nitf/Reader.cpp b/plugins/nitf/drivers/NitfReader.cpp
similarity index 96%
rename from src/drivers/nitf/Reader.cpp
rename to plugins/nitf/drivers/NitfReader.cpp
index be0d26cd56..2695eaddf2 100644
--- a/src/drivers/nitf/Reader.cpp
+++ b/plugins/nitf/drivers/NitfReader.cpp
@@ -32,17 +32,10 @@
* OF SUCH DAMAGE.
****************************************************************************/
-#include
-
-#ifdef PDAL_HAVE_NITRO
-
-// local
#include "NitfFile.hpp"
+#include "NitfReader.hpp"
-#include
-#include
-
-
+CREATE_READER_PLUGIN(nitf, pdal::drivers::nitf::NitfReader)
namespace pdal
{
@@ -137,5 +130,3 @@ void NitfReader::ready(PointContextRef ctx)
} // namespace nitf
} // namespace drivers
} // namespace pdal
-
-#endif // PDAL_HAVE_NITRO
diff --git a/include/pdal/drivers/nitf/Reader.hpp b/plugins/nitf/drivers/NitfReader.hpp
similarity index 96%
rename from include/pdal/drivers/nitf/Reader.hpp
rename to plugins/nitf/drivers/NitfReader.hpp
index b93a966805..d2658e7b48 100644
--- a/include/pdal/drivers/nitf/Reader.hpp
+++ b/plugins/nitf/drivers/NitfReader.hpp
@@ -34,10 +34,9 @@
#pragma once
-#include
-
-#ifdef PDAL_HAVE_NITRO
#include
+#include
+#include
namespace pdal
{
@@ -76,5 +75,3 @@ class PDAL_DLL NitfReader : public las::Reader
} // namespace nitf
} // namespace drivers
} // namespace pdal
-
-#endif // PDAL_HAVE_NITRO
diff --git a/src/drivers/nitf/Writer.cpp b/plugins/nitf/drivers/NitfWriter.cpp
similarity index 97%
rename from src/drivers/nitf/Writer.cpp
rename to plugins/nitf/drivers/NitfWriter.cpp
index e1ce165787..4c5945aac5 100644
--- a/src/drivers/nitf/Writer.cpp
+++ b/plugins/nitf/drivers/NitfWriter.cpp
@@ -35,15 +35,13 @@
#include
#include
-#include
+#include "NitfWriter.hpp"
#include
+#include
#include
#include
-
-#ifdef PDAL_HAVE_NITRO
-
#ifdef PDAL_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wredundant-decls"
@@ -73,14 +71,14 @@
# pragma GCC diagnostic pop
#endif
-#endif
-
// NOTES
//
// is it legal to write a LAZ file?
// syntactically, how do we name all the LAS writer options that we will pass to the las writer?
//
+CREATE_WRITER_PLUGIN(nitf, pdal::drivers::nitf::NitfWriter)
+
namespace pdal
{
namespace drivers
@@ -135,12 +133,12 @@ BOX3D reprojectBoxToDD(const SpatialReference& reference, const BOX3D& box)
return output;
}
-Writer::Writer() : las::Writer(&m_oss)
+NitfWriter::NitfWriter() : las::Writer(&m_oss)
{
register_tre_plugins();
}
-void Writer::processOptions(const Options& options)
+void NitfWriter::processOptions(const Options& options)
{
las::Writer::processOptions(options);
m_cLevel = options.getValueOrDefault("CLEVEL","03");
@@ -170,18 +168,17 @@ void Writer::processOptions(const Options& options)
{}
}
-void Writer::write(const PointBuffer& buffer)
+void NitfWriter::write(const PointBuffer& buffer)
{
m_bounds.grow(buffer.calculateBounds(true));
drivers::las::Writer::write(buffer);
}
-void Writer::done(PointContextRef ctx)
+void NitfWriter::done(PointContextRef ctx)
{
las::Writer::done(ctx);
-#ifdef PDAL_HAVE_NITRO
try
{
::nitf::Record record(NITF_VER_21);
@@ -344,7 +341,6 @@ void Writer::done(PointContextRef ctx)
// std::cout << t.getTrace();
throw pdal_error(t.getMessage());
}
-#endif
}
diff --git a/include/pdal/drivers/nitf/Writer.hpp b/plugins/nitf/drivers/NitfWriter.hpp
similarity index 92%
rename from include/pdal/drivers/nitf/Writer.hpp
rename to plugins/nitf/drivers/NitfWriter.hpp
index 1446597ea5..74125adcb3 100644
--- a/include/pdal/drivers/nitf/Writer.hpp
+++ b/plugins/nitf/drivers/NitfWriter.hpp
@@ -34,6 +34,7 @@
#pragma once
+#include
#include
namespace pdal
@@ -44,18 +45,14 @@ namespace nitf
{
-class PDAL_DLL Writer : public las::Writer
+class PDAL_DLL NitfWriter : public las::Writer
{
public:
SET_STAGE_NAME("drivers.nitf.writer", "NITF Writer")
SET_STAGE_LINK("http://pdal.io/stages/drivers.nitf.writer.html")
-#ifdef PDAL_HAVE_NITRO
SET_STAGE_ENABLED(true)
-#else
- SET_STAGE_ENABLED(false)
-#endif
- Writer() ;
+ NitfWriter() ;
private:
virtual void processOptions(const Options& options);
@@ -82,8 +79,8 @@ class PDAL_DLL Writer : public las::Writer
std::string m_igeolob;
std::stringstream m_oss;
- Writer& operator=(const Writer&); // not implemented
- Writer(const Writer&); // not implemented
+ NitfWriter& operator=(const NitfWriter&); // not implemented
+ NitfWriter(const NitfWriter&); // not implemented
};
} // namespace nitf
diff --git a/src/drivers/nitf/nitflib.h b/plugins/nitf/drivers/nitflib.h
similarity index 100%
rename from src/drivers/nitf/nitflib.h
rename to plugins/nitf/drivers/nitflib.h
diff --git a/src/drivers/nitf/tre_plugins.cpp b/plugins/nitf/drivers/tre_plugins.cpp
similarity index 99%
rename from src/drivers/nitf/tre_plugins.cpp
rename to plugins/nitf/drivers/tre_plugins.cpp
index 1cc92add94..34719e0ec0 100644
--- a/src/drivers/nitf/tre_plugins.cpp
+++ b/plugins/nitf/drivers/tre_plugins.cpp
@@ -34,8 +34,6 @@
#include "tre_plugins.hpp"
-#ifdef PDAL_HAVE_NITRO
-
#ifdef PDAL_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wredundant-decls"
@@ -256,5 +254,3 @@ void register_tre_plugins()
}
} // namespaces
-
-#endif // HAVE_NITRO
diff --git a/src/drivers/nitf/tre_plugins.hpp b/plugins/nitf/drivers/tre_plugins.hpp
similarity index 97%
rename from src/drivers/nitf/tre_plugins.hpp
rename to plugins/nitf/drivers/tre_plugins.hpp
index 9de14ebadb..a167533b0e 100644
--- a/src/drivers/nitf/tre_plugins.hpp
+++ b/plugins/nitf/drivers/tre_plugins.hpp
@@ -36,9 +36,6 @@
#include
-#ifdef PDAL_HAVE_NITRO
-
-
namespace pdal { namespace drivers { namespace nitf {
@@ -48,4 +45,3 @@ void register_tre_plugins();
} } } // namespaces
-#endif // HAVE_NITRO
diff --git a/test/unit/drivers/nitf/NitfReaderTest.cpp b/plugins/nitf/test/NitfReaderTest.cpp
similarity index 59%
rename from test/unit/drivers/nitf/NitfReaderTest.cpp
rename to plugins/nitf/test/NitfReaderTest.cpp
index b19e8eb77c..618e98ae67 100644
--- a/test/unit/drivers/nitf/NitfReaderTest.cpp
+++ b/plugins/nitf/test/NitfReaderTest.cpp
@@ -39,8 +39,8 @@
#include
#include
#include
+#include
-#include
#include
#include
#include
@@ -67,57 +67,64 @@ BOOST_AUTO_TEST_CASE(test_one)
nitf_opts.add("count", 750);
PointContext ctx;
- drivers::nitf::NitfReader nitf_reader;
- nitf_reader.setOptions(nitf_opts);
- nitf_reader.prepare(ctx);
- PointBufferSet pbSet = nitf_reader.execute(ctx);
- BOOST_CHECK_EQUAL(nitf_reader.getDescription(), "NITF Reader");
- BOOST_CHECK_EQUAL(pbSet.size(), 1);
- PointBufferPtr buf = *pbSet.begin();
-
- // check metadata
-//ABELL
-/**
+ StageFactory f;
+ StageFactory::ReaderCreator* rc = f.getReaderCreator("drivers.nitf.reader");
+ if(rc)
{
- pdal::Metadata metadata = nitf_reader.getMetadata();
- /////////////////////////////////////////////////BOOST_CHECK_EQUAL(metadatums.size(), 80u);
- BOOST_CHECK_EQUAL(metadata.toPTree().get("metadata.FH_FDT.value"), "20120323002946");
- }
-**/
-
- //
- // read LAS
- //
- pdal::Options las_opts;
- las_opts.add("count", 750);
- las_opts.add("filename", Support::datapath("nitf/autzen-utm10.las"));
-
- PointContext ctx2;
- drivers::las::Reader las_reader;
- las_reader.setOptions(las_opts);
- las_reader.prepare(ctx2);
- PointBufferSet pbSet2 = las_reader.execute(ctx2);
- BOOST_CHECK_EQUAL(pbSet2.size(), 1);
- PointBufferPtr buf2 = *pbSet.begin();
- //
- //
- // compare the two buffers
- //
- BOOST_CHECK_EQUAL(buf->size(), buf2->size());
-
- for (PointId i = 0; i < buf2->size(); i++)
- {
- int32_t nitf_x = buf->getFieldAs(Dimension::Id::X, i);
- int32_t nitf_y = buf->getFieldAs(Dimension::Id::Y, i);
- int32_t nitf_z = buf->getFieldAs(Dimension::Id::Z, i);
-
- int32_t las_x = buf2->getFieldAs(Dimension::Id::X, i);
- int32_t las_y = buf2->getFieldAs(Dimension::Id::Y, i);
- int32_t las_z = buf2->getFieldAs(Dimension::Id::Z, i);
+ BOOST_CHECK(rc);
+
+ std::unique_ptr nitf_reader(rc());
+ nitf_reader->setOptions(nitf_opts);
+ nitf_reader->prepare(ctx);
+ PointBufferSet pbSet = nitf_reader->execute(ctx);
+ BOOST_CHECK_EQUAL(nitf_reader->getDescription(), "NITF Reader");
+ BOOST_CHECK_EQUAL(pbSet.size(), 1);
+ PointBufferPtr buf = *pbSet.begin();
+
+ // check metadata
+ //ABELL
+ /**
+ {
+ pdal::Metadata metadata = nitf_reader.getMetadata();
+ /////////////////////////////////////////////////BOOST_CHECK_EQUAL(metadatums.size(), 80u);
+ BOOST_CHECK_EQUAL(metadata.toPTree().get("metadata.FH_FDT.value"), "20120323002946");
+ }
+ **/
- BOOST_CHECK_EQUAL(nitf_x, las_x);
- BOOST_CHECK_EQUAL(nitf_y, las_y);
- BOOST_CHECK_EQUAL(nitf_z, las_z);
+ //
+ // read LAS
+ //
+ pdal::Options las_opts;
+ las_opts.add("count", 750);
+ las_opts.add("filename", Support::datapath("nitf/autzen-utm10.las"));
+
+ PointContext ctx2;
+ drivers::las::Reader las_reader;
+ las_reader.setOptions(las_opts);
+ las_reader.prepare(ctx2);
+ PointBufferSet pbSet2 = las_reader.execute(ctx2);
+ BOOST_CHECK_EQUAL(pbSet2.size(), 1);
+ PointBufferPtr buf2 = *pbSet.begin();
+ //
+ //
+ // compare the two buffers
+ //
+ BOOST_CHECK_EQUAL(buf->size(), buf2->size());
+
+ for (PointId i = 0; i < buf2->size(); i++)
+ {
+ int32_t nitf_x = buf->getFieldAs(Dimension::Id::X, i);
+ int32_t nitf_y = buf->getFieldAs(Dimension::Id::Y, i);
+ int32_t nitf_z = buf->getFieldAs(Dimension::Id::Z, i);
+
+ int32_t las_x = buf2->getFieldAs(Dimension::Id::X, i);
+ int32_t las_y = buf2->getFieldAs(Dimension::Id::Y, i);
+ int32_t las_z = buf2->getFieldAs(Dimension::Id::Z, i);
+
+ BOOST_CHECK_EQUAL(nitf_x, las_x);
+ BOOST_CHECK_EQUAL(nitf_y, las_y);
+ BOOST_CHECK_EQUAL(nitf_z, las_z);
+ }
}
}
@@ -154,21 +161,28 @@ BOOST_AUTO_TEST_CASE(optionSrs)
nitfOpts.add("spatialreference", sr);
PointContext ctx;
- drivers::nitf::NitfReader nitfReader;
- nitfReader.setOptions(nitfOpts);
+ StageFactory f;
+ StageFactory::ReaderCreator* rc = f.getReaderCreator("drivers.nitf.reader");
+ if (rc)
+ {
+ BOOST_CHECK(rc);
- Options lasOpts;
- lasOpts.add("filename", "/dev/null");
- drivers::las::Writer lasWriter;
- lasWriter.setInput(&nitfReader);
- lasWriter.setOptions(lasOpts);;
+ Stage* nitfReader = rc();
+ nitfReader->setOptions(nitfOpts);
- lasWriter.prepare(ctx);
- PointBufferSet pbSet = lasWriter.execute(ctx);
+ Options lasOpts;
+ lasOpts.add("filename", "/dev/null");
+ drivers::las::Writer lasWriter;
+ lasWriter.setInput(nitfReader);
+ lasWriter.setOptions(lasOpts);;
- BOOST_CHECK_EQUAL(sr, nitfReader.getSpatialReference().getWKT());
- BOOST_CHECK_EQUAL("", lasWriter.getSpatialReference().getWKT());
- BOOST_CHECK_EQUAL(sr, ctx.spatialRef().getWKT());
+ lasWriter.prepare(ctx);
+ PointBufferSet pbSet = lasWriter.execute(ctx);
+
+ BOOST_CHECK_EQUAL(sr, nitfReader->getSpatialReference().getWKT());
+ BOOST_CHECK_EQUAL("", lasWriter.getSpatialReference().getWKT());
+ BOOST_CHECK_EQUAL(sr, ctx.spatialRef().getWKT());
+ }
}
BOOST_AUTO_TEST_SUITE_END()
diff --git a/test/unit/drivers/nitf/NitfWriterTest.cpp b/plugins/nitf/test/NitfWriterTest.cpp
similarity index 88%
rename from test/unit/drivers/nitf/NitfWriterTest.cpp
rename to plugins/nitf/test/NitfWriterTest.cpp
index da460c87e2..1d538ebda5 100644
--- a/test/unit/drivers/nitf/NitfWriterTest.cpp
+++ b/plugins/nitf/test/NitfWriterTest.cpp
@@ -35,9 +35,8 @@
#include "UnitTest.hpp"
#include
+#include
#include
-#include
-#include
#include "Support.hpp"
using namespace pdal;
@@ -111,7 +110,6 @@ static void compare_contents(const std::string& las_file, const std::string& ntf
BOOST_AUTO_TEST_CASE(test1)
{
-#ifdef PDAL_HAVE_NITRO
const std::string las_input(Support::datapath("las/1.2-with-color.las"));
const std::string nitf_output(Support::temppath("temp_nitf.ntf"));
const std::string reference_output(
@@ -153,26 +151,31 @@ BOOST_AUTO_TEST_CASE(test1)
pdal::drivers::las::Reader reader;
reader.setOptions(reader_opts);
- pdal::drivers::nitf::Writer writer;
- writer.setOptions(writer_opts);
- writer.setInput(&reader);
+ StageFactory f;
+ StageFactory::WriterCreator* wc = f.getWriterCreator("drivers.nitf.writer");
+ if(wc)
{
- // writer.setCompressed(false);
- // // writer.setDate(0, 0);
- // // writer.setPointFormat(::pdal::drivers::las::PointFormat3);
- // // writer.setSystemIdentifier("");
- // writer.setGeneratingSoftware("PDAL-NITF");
- // writer.setChunkSize(100);
+ BOOST_CHECK(wc);
+
+ std::unique_ptr writer(wc());
+ writer->setOptions(writer_opts);
+ writer->setInput(&reader);
+ {
+ // writer.setCompressed(false);
+ // // writer.setDate(0, 0);
+ // // writer.setPointFormat(::pdal::drivers::las::PointFormat3);
+ // // writer.setSystemIdentifier("");
+ // writer.setGeneratingSoftware("PDAL-NITF");
+ // writer.setChunkSize(100);
+ }
+ PointContext ctx;
+ writer->prepare(ctx);
+ writer->execute(ctx);
}
- PointContext ctx;
- writer.prepare(ctx);
- writer.execute(ctx);
}
FileUtils::deleteFile(nitf_output);
-#endif
-
#if 0
//
// check the generated NITF
diff --git a/plugins/oci/CMakeLists.txt b/plugins/oci/CMakeLists.txt
new file mode 100644
index 0000000000..ba1cfbabc6
--- /dev/null
+++ b/plugins/oci/CMakeLists.txt
@@ -0,0 +1,63 @@
+#
+# Oracle OCI plugin CMake configuration
+#
+
+include_directories(${PROJECT_SOURCE_DIR}/include)
+include_directories(${PROJECT_SOURCE_DIR}/plugins/oci)
+
+find_package(Oracle)
+if(ORACLE_FOUND)
+ message(STATUS "Building with Oracle support")
+
+ include_directories(${ORACLE_INCLUDE_DIR})
+
+ #
+ # OCI Reader
+ #
+ set(srcs
+ drivers/OciCommon.cpp
+ drivers/OciReader.cpp
+ drivers/OciWrapper.cpp
+ )
+
+ set(incs
+ drivers/OciCommon.hpp
+ drivers/OciReader.hpp
+ drivers/OciWrapper.h
+ )
+
+ set(deps ${ORACLE_LIBRARY})
+ PDAL_ADD_PLUGIN(oci_reader_lib_name reader oci "${srcs}" "${incs}" "${deps}")
+
+ #
+ # OCI Writer
+ #
+ set(srcs
+ drivers/OciCommon.cpp
+ drivers/OciWrapper.cpp
+ drivers/OciWriter.cpp
+ )
+
+ set(incs
+ drivers/OciCommon.hpp
+ drivers/OciWrapper.h
+ drivers/OciWriter.hpp
+ )
+
+ set(deps ${ORACLE_LIBRARY})
+ PDAL_ADD_PLUGIN(oci_writer_lib_name writer oci "${srcs}" "${incs}" "${deps}")
+
+ #
+ # OCI tests
+ #
+ if(BUILD_OCI_TESTS)
+ set(srcs
+ test/OCITest.cpp
+ )
+
+ set(deps ${oci_reader_lib_name} ${oci_writer_lib_name})
+ PDAL_ADD_TEST(ocitest "${srcs}" "${deps}")
+ endif()
+else()
+ message(STATUS "Building without Oracle support")
+endif()
diff --git a/src/drivers/oci/common.cpp b/plugins/oci/drivers/OciCommon.cpp
similarity index 99%
rename from src/drivers/oci/common.cpp
rename to plugins/oci/drivers/OciCommon.cpp
index 1714de1f0a..59aa262d4d 100644
--- a/src/drivers/oci/common.cpp
+++ b/plugins/oci/drivers/OciCommon.cpp
@@ -33,7 +33,7 @@
****************************************************************************/
-#include
+#include "OciCommon.hpp"
#include
diff --git a/include/pdal/drivers/oci/common.hpp b/plugins/oci/drivers/OciCommon.hpp
similarity index 99%
rename from include/pdal/drivers/oci/common.hpp
rename to plugins/oci/drivers/OciCommon.hpp
index cb24c74a17..0a97aca7b1 100644
--- a/include/pdal/drivers/oci/common.hpp
+++ b/plugins/oci/drivers/OciCommon.hpp
@@ -34,7 +34,7 @@
#pragma once
-#include "oci_wrapper.h"
+#include "OciWrapper.h"
#include
diff --git a/src/drivers/oci/OciReader.cpp b/plugins/oci/drivers/OciReader.cpp
similarity index 98%
rename from src/drivers/oci/OciReader.cpp
rename to plugins/oci/drivers/OciReader.cpp
index 889d67b22a..6cfda577f8 100644
--- a/src/drivers/oci/OciReader.cpp
+++ b/plugins/oci/drivers/OciReader.cpp
@@ -36,12 +36,9 @@
#include
#include
-#include
+#include "OciReader.hpp"
-#ifdef USE_PDAL_PLUGIN_OCI
-//MAKE_READER_CREATOR(ociReader, pdal::drivers::oci::Reader)
-CREATE_READER_PLUGIN(ociReader, pdal::drivers::oci::Reader)
-#endif
+CREATE_READER_PLUGIN(oci, pdal::drivers::oci::OciReader)
namespace pdal
{
diff --git a/include/pdal/drivers/oci/OciReader.hpp b/plugins/oci/drivers/OciReader.hpp
similarity index 97%
rename from include/pdal/drivers/oci/OciReader.hpp
rename to plugins/oci/drivers/OciReader.hpp
index b4bba567d1..bc8c44970d 100644
--- a/include/pdal/drivers/oci/OciReader.hpp
+++ b/plugins/oci/drivers/OciReader.hpp
@@ -37,7 +37,9 @@
#include
#include
-#include
+#include
+
+#include "OciCommon.hpp"
namespace pdal
{
@@ -52,11 +54,7 @@ class PDAL_DLL OciReader : public pdal::Reader
public:
SET_STAGE_NAME("drivers.oci.reader", "OCI Reader")
SET_STAGE_LINK("http://pdal.io/stages/drivers.oci.reader.html")
-#ifdef PDAL_HAVE_ORACLE
SET_STAGE_ENABLED(true)
-#else
- SET_STAGE_ENABLED(false)
-#endif
OciReader() : pdal::Reader()
{}
diff --git a/src/drivers/oci/oci_wrapper.cpp b/plugins/oci/drivers/OciWrapper.cpp
similarity index 99%
rename from src/drivers/oci/oci_wrapper.cpp
rename to plugins/oci/drivers/OciWrapper.cpp
index f93ef1dbe3..b730dfc6ec 100644
--- a/src/drivers/oci/oci_wrapper.cpp
+++ b/plugins/oci/drivers/OciWrapper.cpp
@@ -28,7 +28,7 @@
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
-#include
+#include "OciWrapper.h"
#include
diff --git a/include/pdal/drivers/oci/oci_wrapper.h b/plugins/oci/drivers/OciWrapper.h
similarity index 100%
rename from include/pdal/drivers/oci/oci_wrapper.h
rename to plugins/oci/drivers/OciWrapper.h
diff --git a/src/drivers/oci/Writer.cpp b/plugins/oci/drivers/OciWriter.cpp
similarity index 96%
rename from src/drivers/oci/Writer.cpp
rename to plugins/oci/drivers/OciWriter.cpp
index a5d6f5b652..76445c67b0 100644
--- a/src/drivers/oci/Writer.cpp
+++ b/plugins/oci/drivers/OciWriter.cpp
@@ -39,7 +39,7 @@
#include
#include
-#include
+#include "OciWriter.hpp"
#include
@@ -47,12 +47,7 @@
#include
-
-#ifdef USE_PDAL_PLUGIN_OCI
-//MAKE_WRITER_CREATOR(ociWriter, pdal::drivers::oci::Writer)
-CREATE_WRITER_PLUGIN(ociWriter, pdal::drivers::oci::Writer)
-#endif
-
+CREATE_WRITER_PLUGIN(oci, pdal::drivers::oci::OciWriter)
namespace pdal
{
@@ -62,7 +57,7 @@ namespace oci
{
-Writer::Writer()
+OciWriter::OciWriter()
: pdal::Writer()
, m_createIndex(false)
, m_bDidCreateBlockTable(false)
@@ -77,12 +72,12 @@ Writer::Writer()
, m_orientation(Orientation::PointMajor)
{}
-Writer::~Writer()
+OciWriter::~OciWriter()
{
}
-void Writer::initialize()
+void OciWriter::initialize()
{
GlobalEnvironment::get().getGDALDebug()->addLog(log());
m_connection = connect(m_connSpec);
@@ -90,7 +85,7 @@ void Writer::initialize()
}
-Options Writer::getDefaultOptions()
+Options OciWriter::getDefaultOptions()
{
Options options;
@@ -230,7 +225,7 @@ Options Writer::getDefaultOptions()
}
-void Writer::runCommand(std::ostringstream const& command)
+void OciWriter::runCommand(std::ostringstream const& command)
{
Statement statement(m_connection->CreateStatement(command.str().c_str()));
@@ -241,7 +236,7 @@ void Writer::runCommand(std::ostringstream const& command)
}
-void Writer::wipeBlockTable()
+void OciWriter::wipeBlockTable()
{
std::ostringstream oss;
@@ -293,7 +288,7 @@ void Writer::wipeBlockTable()
}
-void Writer::createBlockIndex()
+void OciWriter::createBlockIndex()
{
std::ostringstream oss;
@@ -320,7 +315,7 @@ void Writer::createBlockIndex()
}
-void Writer::createSDOEntry()
+void OciWriter::createSDOEntry()
{
std::ostringstream oss;
oss.setf(std::ios_base::fixed, std::ios_base::floatfield);
@@ -366,7 +361,7 @@ void Writer::createSDOEntry()
}
-bool Writer::blockTableExists()
+bool OciWriter::blockTableExists()
{
std::ostringstream oss;
@@ -402,7 +397,7 @@ bool Writer::blockTableExists()
}
-void Writer::createBlockTable()
+void OciWriter::createBlockTable()
{
std::ostringstream oss;
oss << "CREATE TABLE " << m_blockTableName <<
@@ -414,7 +409,7 @@ void Writer::createBlockTable()
}
-bool Writer::isGeographic(int32_t srid)
+bool OciWriter::isGeographic(int32_t srid)
{
std::unique_ptr kind(new char[OWNAME]);
std::string stmt("SELECT COORD_REF_SYS_KIND from "
@@ -442,7 +437,7 @@ bool Writer::isGeographic(int32_t srid)
}
-std::string Writer::loadSQLData(std::string const& filename)
+std::string OciWriter::loadSQLData(std::string const& filename)
{
if (!FileUtils::fileExists(filename))
{
@@ -473,7 +468,7 @@ std::string Writer::loadSQLData(std::string const& filename)
}
-void Writer::runFileSQL(std::string const& filename)
+void OciWriter::runFileSQL(std::string const& filename)
{
std::ostringstream oss;
std::string sql = getOptions().getValueOrDefault(filename, "");
@@ -494,7 +489,7 @@ void Writer::runFileSQL(std::string const& filename)
// Get the geometry type
-long Writer::getGType()
+long OciWriter::getGType()
{
if (m_3d)
return (m_solid ? 3008 : 3003);
@@ -502,7 +497,7 @@ long Writer::getGType()
}
-std::string Writer::createPCElemInfo()
+std::string OciWriter::createPCElemInfo()
{
if (m_3d)
return m_solid ? "(1,1007,3)" : "(1,1003,3)";
@@ -510,7 +505,7 @@ std::string Writer::createPCElemInfo()
}
-void Writer::createPCEntry()
+void OciWriter::createPCEntry()
{
std::ostringstream oss;
@@ -691,7 +686,7 @@ void Writer::createPCEntry()
}
-bool Writer::isValidWKT(std::string const& input)
+bool OciWriter::isValidWKT(std::string const& input)
{
OGRGeometryH g;
@@ -702,7 +697,7 @@ bool Writer::isValidWKT(std::string const& input)
}
-void Writer::processOptions(const Options& options)
+void OciWriter::processOptions(const Options& options)
{
m_precision = getDefaultedOption(options,
"stream_output_precision");
@@ -752,14 +747,14 @@ void Writer::processOptions(const Options& options)
}
-void Writer::write(const PointBuffer& buffer)
+void OciWriter::write(const PointBuffer& buffer)
{
writeInit();
writeTile(buffer);
}
-void Writer::writeInit()
+void OciWriter::writeInit()
{
if (m_sdo_pc_is_initialized)
return;
@@ -792,7 +787,7 @@ void Writer::writeInit()
}
-void Writer::ready(PointContextRef ctx)
+void OciWriter::ready(PointContextRef ctx)
{
bool haveOutputTable = blockTableExists();
if (m_overwrite && haveOutputTable)
@@ -818,7 +813,7 @@ void Writer::ready(PointContextRef ctx)
}
-void Writer::done(PointContextRef ctx)
+void OciWriter::done(PointContextRef ctx)
{
if (!m_connection)
return;
@@ -840,7 +835,7 @@ void Writer::done(PointContextRef ctx)
}
-void Writer::setElements(Statement statement, OCIArray* elem_info)
+void OciWriter::setElements(Statement statement, OCIArray* elem_info)
{
statement->AddElement(elem_info, 1);
if (m_solid == true)
@@ -857,7 +852,7 @@ void Writer::setElements(Statement statement, OCIArray* elem_info)
}
-void Writer::setOrdinates(Statement statement, OCIArray* ordinates,
+void OciWriter::setOrdinates(Statement statement, OCIArray* ordinates,
const BOX3D& extent)
{
@@ -934,7 +929,7 @@ void fillBuf(const PointBuffer& buf, char *pos, Dimension::Id::Enum d,
} // anonymous namespace.
-void Writer::writeTile(PointBuffer const& buffer)
+void OciWriter::writeTile(PointBuffer const& buffer)
{
bool usePartition = (m_blockTablePartitionColumn.size() != 0);
@@ -1084,7 +1079,7 @@ void Writer::writeTile(PointBuffer const& buffer)
}
-std::string Writer::shutOff_SDO_PC_Trigger()
+std::string OciWriter::shutOff_SDO_PC_Trigger()
{
// Don't monkey with the trigger unless the user says to.
if (!m_disableCloudTrigger)
@@ -1124,7 +1119,7 @@ std::string Writer::shutOff_SDO_PC_Trigger()
}
-void Writer::turnOn_SDO_PC_Trigger(std::string trigger_name)
+void OciWriter::turnOn_SDO_PC_Trigger(std::string trigger_name)
{
if (!trigger_name.size())
return;
@@ -1137,7 +1132,7 @@ void Writer::turnOn_SDO_PC_Trigger(std::string trigger_name)
}
-void Writer::updatePCExtent()
+void OciWriter::updatePCExtent()
{
BOX3D bounds = m_baseTableBounds;
if (bounds.empty())
diff --git a/include/pdal/drivers/oci/Writer.hpp b/plugins/oci/drivers/OciWriter.hpp
similarity index 92%
rename from include/pdal/drivers/oci/Writer.hpp
rename to plugins/oci/drivers/OciWriter.hpp
index ab5db3324d..e955d748f1 100644
--- a/include/pdal/drivers/oci/Writer.hpp
+++ b/plugins/oci/drivers/OciWriter.hpp
@@ -40,15 +40,7 @@
pdal::Writer* createOciWriter();
-#ifdef USE_PDAL_PLUGIN_OCI
-PDAL_C_START
-
-PDAL_DLL void PDALRegister_writer_oci(void* factory);
-
-PDAL_C_END
-#endif
-
-#include "common.hpp"
+#include "OciCommon.hpp"
namespace pdal
{
@@ -57,18 +49,14 @@ namespace drivers
namespace oci
{
-class PDAL_DLL Writer : public pdal::Writer
+class PDAL_DLL OciWriter : public pdal::Writer
{
public:
SET_STAGE_NAME("drivers.oci.writer", "OCI Writer")
SET_STAGE_LINK("http://pdal.io/stages/drivers.oci.writer.html")
-#ifdef PDAL_HAVE_ORACLE
SET_STAGE_ENABLED(true)
-#else
- SET_STAGE_ENABLED(false)
-#endif
- Writer();
- ~Writer();
+ OciWriter();
+ ~OciWriter();
static Options getDefaultOptions();
@@ -85,8 +73,8 @@ class PDAL_DLL Writer : public pdal::Writer
{}
private:
- Writer& operator=(const Writer&); // not implemented
- Writer(const Writer&); // not implemented
+ OciWriter& operator=(const OciWriter&); // not implemented
+ OciWriter(const OciWriter&); // not implemented
template
T getDefaultedOption(const Options& options,
diff --git a/test/unit/drivers/oci/OCITest.cpp b/plugins/oci/test/OCITest.cpp
similarity index 94%
rename from test/unit/drivers/oci/OCITest.cpp
rename to plugins/oci/test/OCITest.cpp
index a86a40ace8..17eb17e7e1 100644
--- a/test/unit/drivers/oci/OCITest.cpp
+++ b/plugins/oci/test/OCITest.cpp
@@ -37,22 +37,15 @@
#include
#include
-#include
-#include
-#include
-
+#include
+#include
#include
#include
-
#include
#include
#include
-#include
-#include
-
-#include
-
+#include "../drivers/OciCommon.hpp"
#include "Support.hpp"
#include "TestConfig.hpp"
@@ -251,15 +244,21 @@ bool WriteUnprojectedData()
reader.setOptions(options);
// pdal::filters::Chipper chipper(options);
// chipper.setInput(&reader);
- pdal::drivers::oci::Writer writer;
- writer.setOptions(options);
- writer.setInput(&reader);
+ StageFactory f;
+ StageFactory::WriterCreator* wc = f.getWriterCreator("drivers.oci.writer");
+ if (wc)
+ {
+ BOOST_CHECK(wc);
- writer.prepare(ctx);
- writer.execute(ctx);
+ std::unique_ptr writer(wc());
+ writer->setOptions(options);
+ writer->setInput(&reader);
- //ABELL - This test doesn't test anything anymore. Perhaps it should.
+ writer->prepare(ctx);
+ writer->execute(ctx);
+ //ABELL - This test doesn't test anything anymore. Perhaps it should.
+ }
return true;
}
@@ -379,19 +378,27 @@ BOOST_AUTO_TEST_CASE(read_unprojected_data)
Option& verbose = options.getOptionByRef("verbose");
verbose.setValue( "7");
- pdal::drivers::oci::OciReader reader;
- reader.setOptions(options);
- PointContext ctx;
- reader.prepare(ctx);
- PointBufferSet pbSet = reader.execute(ctx);
- BOOST_CHECK_EQUAL(pbSet.size(), 1);
- PointBufferPtr buf = *pbSet.begin();
- BOOST_CHECK_EQUAL(buf->size(), 1065);
+ StageFactory f;
+ StageFactory::ReaderCreator* rc = f.getReaderCreator("drivers.oci.reader");
+ if (rc)
+ {
+ BOOST_CHECK(rc);
+
+ std::unique_ptr reader(rc());
- // checkUnProjectedPoints(*buf);
+ reader->setOptions(options);
+ PointContext ctx;
+ reader->prepare(ctx);
+ PointBufferSet pbSet = reader->execute(ctx);
+ BOOST_CHECK_EQUAL(pbSet.size(), 1);
+ PointBufferPtr buf = *pbSet.begin();
+ BOOST_CHECK_EQUAL(buf->size(), 1065);
- // compareAgainstSourceBuffer(*buf, Support::datapath("autzen-utm-chipped-25.las"));
- compareAgainstSourceBuffer(*buf, Support::datapath("autzen/autzen-utm.las"));
+ // checkUnProjectedPoints(*buf);
+
+ // compareAgainstSourceBuffer(*buf, Support::datapath("autzen-utm-chipped-25.las"));
+ compareAgainstSourceBuffer(*buf, Support::datapath("autzen/autzen-utm.las"));
+ }
}
diff --git a/plugins/p2g/CMakeLists.txt b/plugins/p2g/CMakeLists.txt
new file mode 100644
index 0000000000..5a748c2998
--- /dev/null
+++ b/plugins/p2g/CMakeLists.txt
@@ -0,0 +1,30 @@
+#
+# Points2grid plugin CMake configuration
+#
+
+include_directories(${PROJECT_SOURCE_DIR}/include)
+include_directories(${PROJECT_SOURCE_DIR}/plugins/p2g)
+
+find_package(Points2Grid)
+if (P2G_FOUND)
+ message(STATUS "Building with Points2grid support")
+
+ include_directories(${P2G_INCLUDE_DIR})
+ add_definitions(-DHAVE_P2G=1)
+
+ #
+ # Points2grid Writer
+ #
+ set(srcs
+ drivers/P2gWriter.cpp
+ )
+
+ set(incs
+ drivers/P2gWriter.hpp
+ )
+
+ set(deps ${P2G_LIBRARY})
+ PDAL_ADD_PLUGIN(p2g_writer_lib_name writer p2g "${srcs}" "${incs}" "${deps}")
+else()
+ message(STATUS "Building without Points2grid support")
+endif()
diff --git a/src/drivers/p2g/P2gWriter.cpp b/plugins/p2g/drivers/P2gWriter.cpp
similarity index 98%
rename from src/drivers/p2g/P2gWriter.cpp
rename to plugins/p2g/drivers/P2gWriter.cpp
index 76b8e005c1..d3f0113639 100644
--- a/src/drivers/p2g/P2gWriter.cpp
+++ b/plugins/p2g/drivers/P2gWriter.cpp
@@ -32,7 +32,7 @@
* OF SUCH DAMAGE.
****************************************************************************/
-#include
+#include "P2gWriter.hpp"
#include
#include
@@ -41,6 +41,7 @@
#include
#include
+CREATE_WRITER_PLUGIN(p2g, pdal::drivers::p2g::P2gWriter)
namespace pdal
{
diff --git a/include/pdal/drivers/p2g/P2gWriter.hpp b/plugins/p2g/drivers/P2gWriter.hpp
similarity index 97%
rename from include/pdal/drivers/p2g/P2gWriter.hpp
rename to plugins/p2g/drivers/P2gWriter.hpp
index ac03e2c606..04fb3d2f55 100644
--- a/include/pdal/drivers/p2g/P2gWriter.hpp
+++ b/plugins/p2g/drivers/P2gWriter.hpp
@@ -35,16 +35,15 @@
#pragma once
#include
+#include
#include
#include
-#ifdef PDAL_HAVE_P2G
#include
#include
#include
#include
-#endif
namespace pdal
{
@@ -71,11 +70,7 @@ class PDAL_DLL P2gWriter : public pdal::Writer
public:
SET_STAGE_NAME("drivers.p2g.writer", "Points2Grid Writer")
SET_STAGE_LINK("http://pdal.io/stages/drivers.p2g.writer.html")
-#ifdef PDAL_HAVE_P2G
SET_STAGE_ENABLED(true)
-#else
- SET_STAGE_ENABLED(false)
-#endif
P2gWriter() : Writer(), m_outputTypes(0), m_outputFormat(OUTPUT_FORMAT_ARC_ASCII) {};
~P2gWriter() {};
diff --git a/plugins/pcl/CMakeLists.txt b/plugins/pcl/CMakeLists.txt
index 1ad00c6fe6..93d5ae1813 100644
--- a/plugins/pcl/CMakeLists.txt
+++ b/plugins/pcl/CMakeLists.txt
@@ -22,10 +22,12 @@
#------------------------------------------------------------------------------
include_directories(${PROJECT_SOURCE_DIR}/include)
-include_directories(${PROJECT_SOURCE_DIR}/plugin/pcl)
+include_directories(${PROJECT_SOURCE_DIR}/plugins/pcl)
find_package(PCL 1.7)
if(PCL_FOUND)
+ message(STATUS "Building with PCL support")
+
set(PCL_LINKAGE "LINK_PUBLIC;general")
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
@@ -35,10 +37,8 @@ if(PCL_FOUND)
# PCL's configuration clobbers Boost find_package - do it again
find_package(Boost 1.52 COMPONENTS program_options thread iostreams filesystem system unit_test_framework random)
- message(STATUS "..building with PCL")
-
if (PCL_VISUALIZATION_FOUND)
- message(STATUS "..building with PCL Visualization")
+ message(STATUS "Building with PCL Visualization support")
#
# PCLVisualizer Writer
#
@@ -51,11 +51,12 @@ if(PCL_FOUND)
PCLConversions.hpp
)
+ set(deps ${PCL_LIBRARIES})
set(PCLVIZ_LIB_NAME pdal_plugin_writer_pclvisualizer)
- PDAL_ADD_PLUGIN(${PCLVIZ_LIB_NAME} writer pclvisualizer ${srcs} ${incs})
- else()
- message(STATUS "..building without PCL Visualization")
- endif()
+ PDAL_ADD_PLUGIN(${PCLVIZ_LIB_NAME} writer pclvisualizer "${srcs}" "${incs}" "${deps}")
+else()
+ message(STATUS "..building without PCL Visualization")
+endif()
#
# PCD Reader
@@ -72,9 +73,8 @@ if(PCL_FOUND)
PCLConversions.hpp
)
- set(PCD_READ_LIB_NAME pdal_plugin_reader_pcd)
- PDAL_ADD_PLUGIN(${PCD_READ_LIB_NAME} reader pcd ${srcs} ${incs})
- target_link_libraries(${PCD_READ_LIB_NAME} ${PDAL_LINKAGE} ${PCL_LIBRARIES})
+ set(deps ${PCL_LIBRARIES})
+ PDAL_ADD_PLUGIN(pcd_reader_lib_name reader pcd "${srcs}" "${incs}" "${deps}")
#
# PCD Writer
@@ -91,9 +91,8 @@ if(PCL_FOUND)
PCLConversions.hpp
)
- set(PCD_WRITE_LIB_NAME pdal_plugin_writer_pcd)
- PDAL_ADD_PLUGIN(${PCD_WRITE_LIB_NAME} writer pcd ${srcs} ${incs})
- target_link_libraries(${PCD_WRITE_LIB_NAME} ${PDAL_LINKAGE} ${PCL_LIBRARIES})
+ set(deps ${PCL_LIBRARIES})
+ PDAL_ADD_PLUGIN(pcd_writer_lib_name writer pcd "${srcs}" "${incs}" "${deps}")
#
# PCLBlock Filter
@@ -110,9 +109,9 @@ if(PCL_FOUND)
PCLConversions.hpp
)
- set(PCLBLOCK_LIB_NAME pdal_plugin_filter_pclblock)
- PDAL_ADD_PLUGIN(${PCLBLOCK_LIB_NAME} filter pclblock ${srcs} ${incs})
- target_link_libraries(${PCLBLOCK_LIB_NAME} ${PDAL_LINKAGE} ${PCL_LIBRARIES})
+ set(deps ${PCL_LIBRARIES})
+ PDAL_ADD_PLUGIN(pclblock_filter_lib_name filter pclblock "${srcs}" "${incs}" "${deps}")
+
#
# PCL Kernel
#
@@ -122,12 +121,10 @@ if(PCL_FOUND)
set(incs
kernel/PCL.hpp
- #PCLConversions.hpp
)
- set(PCL_KERNEL_LIB_NAME pdal_plugin_kernel_pcl)
- PDAL_ADD_PLUGIN(${PCL_KERNEL_LIB_NAME} kernel pcl ${srcs} ${incs})
- target_link_libraries(${PCL_KERNEL_LIB_NAME} ${PCLBLOCK_LIB_NAME})
+ set(deps ${PCL_LIBRARIES} ${pclblock_filter_lib_name})
+ PDAL_ADD_PLUGIN(pcl_kernel_lib_name kernel pcl "${srcs}" "${incs}" "${deps}")
#
# Ground Kernel
@@ -140,9 +137,8 @@ if(PCL_FOUND)
kernel/Ground.hpp
)
- set(GROUND_KERNEL_LIB_NAME pdal_plugin_kernel_ground)
- PDAL_ADD_PLUGIN(${GROUND_KERNEL_LIB_NAME} kernel ground ${srcs} ${incs})
- target_link_libraries(${GROUND_KERNEL_LIB_NAME} ${PCLBLOCK_LIB_NAME})
+ set(deps ${PCL_LIBRARIES} ${pclblock_filter_lib_name})
+ PDAL_ADD_PLUGIN(ground_kernel_lib_name kernel ground "${srcs}" "${incs}" "${deps}")
#
# Smooth Kernel
@@ -155,9 +151,8 @@ if(PCL_FOUND)
kernel/Smooth.hpp
)
- set(SMOOTH_KERNEL_LIB_NAME pdal_plugin_kernel_smooth)
- PDAL_ADD_PLUGIN(${SMOOTH_KERNEL_LIB_NAME} kernel smooth ${srcs} ${incs})
- target_link_libraries(${SMOOTH_KERNEL_LIB_NAME} ${PCLBLOCK_LIB_NAME})
+ set(deps ${PCL_LIBRARIES} ${pclblock_filter_lib_name})
+ PDAL_ADD_PLUGIN(smooth_kernel_lib_name kernel smooth "${srcs}" "${incs}" "${deps}")
#
# View Kernel
@@ -168,9 +163,20 @@ if(PCL_FOUND)
set(incs
kernel/View.hpp
- #PCLConversions.hpp
)
- set(VIEW_KERNEL_LIB_NAME pdal_plugin_kernel_view)
- PDAL_ADD_PLUGIN(${VIEW_KERNEL_LIB_NAME} kernel view ${srcs} ${incs})
+ set(deps ${PCL_LIBRARIES})
+ PDAL_ADD_PLUGIN(view_kernel_lib_name kernel view "${srcs}" "${incs}" "${deps}")
+
+ #
+ # PCL tests
+ #
+ set(srcs
+ test/PCLBlockFilterTest.cpp
+ )
+
+ set(deps ${pclvisualizer_lib_name} ${pcd_reader_lib_name} ${pcd_writer_lib_name} ${pclblock_filter_lib_name} ${pcl_kernel_lib_name} ${ground_kernel_lib_name} ${smooth_kernel_lib_name} ${view_kernel_lib_name})
+ PDAL_ADD_TEST(pcltest "${srcs}" "${deps}")
+else()
+ message(STATUS "Building without PCL support")
endif()
diff --git a/plugins/pcl/drivers/PCLVisualizer.hpp b/plugins/pcl/drivers/PCLVisualizer.hpp
index 68e01cff8c..3b71d89974 100644
--- a/plugins/pcl/drivers/PCLVisualizer.hpp
+++ b/plugins/pcl/drivers/PCLVisualizer.hpp
@@ -38,12 +38,6 @@
#include
-PDAL_C_START
-
-PDAL_DLL void PDALRegister_writer_pclvisualizer(void* factory);
-
-PDAL_C_END
-
namespace pdal
{
namespace drivers
diff --git a/plugins/pcl/drivers/PcdReader.hpp b/plugins/pcl/drivers/PcdReader.hpp
index 95ebc0fd45..8886a6d207 100644
--- a/plugins/pcl/drivers/PcdReader.hpp
+++ b/plugins/pcl/drivers/PcdReader.hpp
@@ -40,12 +40,6 @@
#include "PcdCommon.hpp"
-PDAL_C_START
-
-PDAL_DLL void PDALRegister_writer_pcd(void* factory);
-
-PDAL_C_END
-
namespace pdal
{
namespace drivers
diff --git a/plugins/pcl/drivers/PcdWriter.hpp b/plugins/pcl/drivers/PcdWriter.hpp
index d8789f40bf..17adc2a8b5 100644
--- a/plugins/pcl/drivers/PcdWriter.hpp
+++ b/plugins/pcl/drivers/PcdWriter.hpp
@@ -41,12 +41,6 @@
#include
#include
-PDAL_C_START
-
-PDAL_DLL void PDALRegister_reader_pcd(void* factory);
-
-PDAL_C_END
-
namespace pdal
{
namespace drivers
diff --git a/plugins/pcl/filters/PCLBlock.hpp b/plugins/pcl/filters/PCLBlock.hpp
index 394d0fca17..bf55a2cf75 100644
--- a/plugins/pcl/filters/PCLBlock.hpp
+++ b/plugins/pcl/filters/PCLBlock.hpp
@@ -37,12 +37,6 @@
#include
#include