Skip to content

Commit

Permalink
This is a merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jul 27, 2017
1 parent 928c32b commit bf0f9f5
Show file tree
Hide file tree
Showing 80 changed files with 484 additions and 849 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Expand Up @@ -57,7 +57,7 @@ else()
endif()
set(PDAL_UTIL_LIB_NAME pdal_util)
set(PDAL_BOOST_LIB_NAME pdal_boost)
#set(PDAL_ARBITER_LIB_NAME pdal_arbiter)
set(PDAL_KAZHDAN_LIB_NAME pdal_kazhdan)

set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)

Expand Down Expand Up @@ -172,6 +172,7 @@ endif()
add_subdirectory(dimbuilder)
add_subdirectory(vendor/pdalboost)
add_subdirectory(vendor/arbiter)
add_subdirectory(vendor/kazhdan)

if (NOT PDAL_HAVE_JSONCPP)
add_subdirectory(vendor/jsoncpp/dist)
Expand Down Expand Up @@ -247,6 +248,7 @@ target_link_libraries(${PDAL_BASE_LIB_NAME}
${PDAL_REEXPORT}
${PDAL_UTIL_LIB_NAME}
${PDAL_ARBITER_LIB_NAME}
${PDAL_KAZHDAN_LIB_NAME}
${JSON_CPP_LINK_TYPE}
${PDAL_JSONCPP_LIB_NAME}
INTERFACE
Expand Down Expand Up @@ -285,6 +287,11 @@ install(DIRECTORY ${PDAL_KERNELS_DIR}
FILES_MATCHING PATTERN "*.hpp"
PATTERN "private" EXCLUDE
)
install(DIRECTORY ${PDAL_VENDOR_DIR}/nanoflann
DESTINATION include/pdal
FILES_MATCHING PATTERN "*.hpp"
PATTERN "private" EXCLUDE
)
install(DIRECTORY ${PDAL_IO_DIR}
DESTINATION include/pdal
FILES_MATCHING PATTERN "*.hpp"
Expand Down
40 changes: 40 additions & 0 deletions cmake/modules/FindLASzip.cmake
Expand Up @@ -54,6 +54,46 @@ FIND_LIBRARY(LASZIP_LIBRARY
/usr/local/lib
${OSGEO4W_ROOT_DIR}/lib)

# Comment out laszip.hpp version info
#[[
SET(LASZIP_VERSION_H "${LASZIP_INCLUDE_DIR}/laszip.hpp")
IF(LASZIP_INCLUDE_DIR AND EXISTS ${LASZIP_VERSION_H})
SET(LASZIP_VERSION 0)

message("Looking for: ${LASZIP_INCLUDE_DIR}/laszip.hpp")

FILE(READ ${LASZIP_VERSION_H} LASZIP_VERSION_H_CONTENTS)

IF (DEFINED LASZIP_VERSION_H_CONTENTS)
string(REGEX REPLACE ".*#define[ \t]LASZIP_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" LASZIP_VERSION_MAJOR "${LASZIP_VERSION_H_CONTENTS}")
string(REGEX REPLACE ".*#define[ \t]LASZIP_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" LASZIP_VERSION_MINOR "${LASZIP_VERSION_H_CONTENTS}")
string(REGEX REPLACE ".*#define[ \t]LASZIP_VERSION_REVISION[ \t]+([0-9]+).*" "\\1" LASZIP_VERSION_REVISION "${LASZIP_VERSION_H_CONTENTS}")

if(NOT ${LASZIP_VERSION_MAJOR} MATCHES "[0-9]+")
message(FATAL_ERROR "LASzip version parsing failed for LASZIP_VERSION_MAJOR!")
endif()
if(NOT ${LASZIP_VERSION_MINOR} MATCHES "[0-9]+")
message(FATAL_ERROR "LASzip version parsing failed for LASZIP_VERSION_MINOR!")
endif()
if(NOT ${LASZIP_VERSION_REVISION} MATCHES "[0-9]+")
message(FATAL_ERROR "LASzip version parsing failed for LASZIP_VERSION_REVISION!")
endif()


SET(LASZIP_VERSION "${LASZIP_VERSION_MAJOR}.${LASZIP_VERSION_MINOR}.${LASZIP_VERSION_REVISION}"
CACHE INTERNAL "The version string for LASzip library")

IF (LASZIP_VERSION VERSION_LESS LASzip_FIND_VERSION)
MESSAGE(FATAL_ERROR "LASzip version check failed. Version ${LASZIP_VERSION} was found, at least version ${LASzip_FIND_VERSION} is required")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "Failed to open ${LASZIP_VERSION_H} file")
ENDIF()
ELSE()
return()
ENDIF()
]]

# Handle the QUIETLY and REQUIRED arguments and set LASZIP_FOUND to TRUE
# if all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
Expand Down
13 changes: 13 additions & 0 deletions doc/stages/filters.crop.rst
Expand Up @@ -8,6 +8,14 @@ box (2D), polygon, or point+distance. If more than one bounding region is
specified, the filter will pass all input points through each bounding region,
creating an output point set for each input crop region.

The provided bounding regions are assumed to have the same spatial reference
as the points unless the option `a_srs` provides an explicit spatial reference
for bounding regions.
If the point input consists of multiple point views with differing
spatial references, one is chosen at random and assumed to be the
spatial reference of the input bounding region. In this case a warning will
be logged.

Example
-------

Expand Down Expand Up @@ -46,3 +54,8 @@ point

distance
Distance in units of common X, Y, and Z :ref:`dimensions` to crop circle or sphere in combination with ``point``.

a_srs
Indicates the spatial reference of the bounding regions. If not provided,
it is assumed that the spatial reference of the bounding region matches
that of the points (if possible).
36 changes: 21 additions & 15 deletions doc/stages/filters.pmf.rst
Expand Up @@ -52,6 +52,12 @@ Notes
extra iteration. This parameter can have a strongly negative impact on
computation performance.

* ``exponential`` is used to control the rate of growth of morphological window
sizes toward ``max_window_size``. Linear growth preserves gradually changing
topographic features well, but demands considerable compute time. The default
behavior is to grow the window sizes exponentially, thus reducing the number
of iterations.

* This filter will mark all returns deemed to be ground returns with a
classification value of 2 (per the LAS specification). To extract only these
returns, users can add a :ref:`range filter<filters.range>` to the pipeline.
Expand All @@ -71,27 +77,27 @@ Notes
Options
-------------------------------------------------------------------------------

max_window_size
Maximum window size. [Default: **33**]

slope
Slope. [Default: **1.0**]

max_distance
Maximum distance. [Default: **2.5**]

initial_distance
Initial distance. [Default: **0.15**]

cell_size
Cell Size. [Default: **1**]

approximate
Use approximate algorithm? [Default: **false**]
exponential
Use exponential growth for window sizes? [Defualt: **true**]

ignore
Optional range of values to ignore.

initial_distance
Initial distance. [Default: **0.15**]

last
Consider only last returns (when return information is available)? [Default:
**true**]

max_distance
Maximum distance. [Default: **2.5**]

max_window_size
Maximum window size. [Default: **33**]

slope
Slope. [Default: **1.0**]
38 changes: 26 additions & 12 deletions doc/stages/filters.poisson.rst
Expand Up @@ -4,14 +4,26 @@
filters.poisson
===============================================================================

The Poisson filter passes data through the Point Cloud Library (`PCL`_) Poisson
surface reconstruction algorithm.

Poisson is an implementation of the method described in [Kazhdan2006]_.
The poisson filter passes data Mischa Kazhdan's poisson surface reconstruction
algorithm. [Kazhdan2006]_ It creates a watertight surface from the original
point set by creating an entirely new point set representing the imputed
isosurface. The algorithm requires normal vectors to each point in order
to run. If the x, y and z normal dimensions are present in the input point
set, they will be used by the algorithm. If they don't exist, the poisson
filter will invoke the PDAL normal filter to create them before running.

The poisson algorithm will usually create a larger output point set
than the input point set. Because the algorithm constructs new points, data
associated with the original points set will be lost, as the algorithm has
limited ability to impute associated data. However, if color dimensions
(red, green and blue) are present in the input, colors will be reconstruced
in the output point set.

.. [Kazhdan2006] Kazhdan, Michael, Matthew Bolitho, and Hugues Hoppe. "Poisson surface reconstruction." Proceedings of the fourth Eurographics symposium on Geometry processing. Vol. 7. 2006.
.. _`PCL`: http://www.pointclouds.org
This integration of the algorithm with PDAL only supports a limited set of
the options available to the implementation. If you need support for further
options, please let us know.

Example
-------------------------------------------------------------------------------
Expand All @@ -23,12 +35,10 @@ Example
"dense.las",
{
"type":"filters.poisson",
"depth":"8",
"point_weight":"4"
},
{
"type":"writers.las",
"filename":"thinned.las",
"type":"writers.ply",
"filename":"isosurface.ply",
}
]
}
Expand All @@ -37,8 +47,12 @@ Example
Options
-------------------------------------------------------------------------------

density
Write an estimate of neighborhood density for each point in the output
set.

depth
Maximum depth of the tree used for reconstruction. [Default: **8**]
Maximum depth of the tree used for reconstruction. The output is sentsitve
to this parameter. Increase if the results appear unsatisfactory.
[Default: **8**]

point_weight
Importance of interpolation of point samples in the screened Poisson equation. [Default: **4.0**]
20 changes: 9 additions & 11 deletions doc/tutorial/python-filtering.rst
Expand Up @@ -33,9 +33,8 @@ be a very quick way to prototype a tool that identified specific points
we would like to filter.

PDAL has three different ways to manipulate data with Python. The first is
:ref:`filters.python`, which we will be using in this tutorial. The
second is :ref:`filters.`, which allows you to keep or remove points
given a Python filtering operation. The third is the Python extension at
:ref:`filters.python`, which we will be using in this tutorial.
The second is the Python extension at
https://pypi.python.org/pypi/PDAL that allows you to utilize PDAL processing
operations in your own Python programs.

Expand Down Expand Up @@ -75,12 +74,11 @@ running.
Python Filter
-------------------------------------------------------------------------------

Through the use of the :ref:`filters.python` and :ref:`filters.`
filters, PDAL allows the use of Python and |NumPy| to process point cloud
data. This can be very useful in prototyping situations, where PDAL can provide
convenient data access and the processing logic of software that is still
taking shape can be constructed with the rapid prototyping tools that Python
can provide.
Through the use of the :ref:`filters.python`, PDAL allows the use of Python and
|NumPy| to process point cloud data. This can be very useful in prototyping
situations, where PDAL can provide convenient data access and the processing
logic of software that is still taking shape can be constructed with the rapid
prototyping tools that Python can provide.


.. code-block:: python
Expand Down Expand Up @@ -112,7 +110,7 @@ can provide.
# Print our dict to stdout
print output
# filters. must return True to tell
# filters.python must return True to tell
# PDAL it successfully completed
return True
Expand Down Expand Up @@ -221,7 +219,7 @@ three standard deviations:
# Print our dict to stdout
print output
# filters. must return True to tell
# filters.python must return True to tell
# PDAL it successfully completed
return True
Expand Down
36 changes: 9 additions & 27 deletions doc/tutorial/writing-reader.rst
Expand Up @@ -33,15 +33,7 @@ These methods are required to fulfill the specs for defining a new plugin.

.. literalinclude:: ../../examples/writing-reader/MyReader.hpp
:language: cpp
:lines: 20
:linenos:

``getDefaultDimensions`` returns a list of :ref:`dimensions` that the
reader provides.

.. literalinclude:: ../../examples/writing-reader/MyReader.hpp
:language: cpp
:lines: 23-25
:lines: 21-23
:linenos:

``m_stream`` is used to process the input, while ``m_index`` is used to track
Expand Down Expand Up @@ -111,16 +103,7 @@ dimension MyData.

.. literalinclude:: ../../examples/writing-reader/MyReader.cpp
:language: cpp
:lines: 31-40
:linenos:

This method returns the list of :ref:`dimensions` that the reader can
provide.


.. literalinclude:: ../../examples/writing-reader/MyReader.cpp
:language: cpp
:lines: 42-46
:lines: 31-35
:linenos:

This method is called when the Reader is ready for use. It will only be
Expand All @@ -129,7 +112,7 @@ processed.

.. literalinclude:: ../../examples/writing-reader/MyReader.cpp
:language: cpp
:lines: 49-62
:lines: 37-50
:linenos:

This is a helper function, which will convert a string value into the type
Expand All @@ -139,7 +122,7 @@ strings to doubles when reading from the input stream.

.. literalinclude:: ../../examples/writing-reader/MyReader.cpp
:language: cpp
:lines: 65
:lines: 53
:linenos:

This method is the main processing method for the reader. It takes a
Expand All @@ -152,15 +135,15 @@ PointView object.

.. literalinclude:: ../../examples/writing-reader/MyReader.cpp
:language: cpp
:lines: 74-76
:lines: 62-64
:linenos:

In preparation for reading the file, we prepare to skip some header lines. In
our case, the header is only a single line.

.. literalinclude:: ../../examples/writing-reader/MyReader.cpp
:language: cpp
:lines: 77-82
:lines: 65-70
:linenos:

Here we begin our main loop. In our example file, the first line is a header,
Expand All @@ -171,18 +154,17 @@ sure we are skipping the header lines here before moving on.

.. literalinclude:: ../../examples/writing-reader/MyReader.cpp
:language: cpp
:lines: 85-94
:lines: 73-82
:linenos:

Here we take the line we read in the for block header, split it, and make sure
that we have the proper number of fields.

.. literalinclude:: ../../examples/writing-reader/MyReader.cpp
:language: cpp
:lines: 96-109
:lines: 84-97
:linenos:


Here we take the values we read and put them into the PointView object. The
X and Y fields are simply converted from the file and put into the respective
fields. MyData is done likewise with the custom dimension we defined. The Z
Expand All @@ -195,7 +177,7 @@ each iteration of the loop), and the dimension value.

.. literalinclude:: ../../examples/writing-reader/MyReader.cpp
:language: cpp
:lines: 111-113
:lines: 99-101
:linenos:

Finally, we increment the nextId and make a call into the progress callback
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/writing-writer.rst
Expand Up @@ -58,7 +58,7 @@ that corresponds to the data field for easier lookup.
As mentioned, there cen be additional configurations done as needed.


The header
The source
-------------------------------------------------------------------------------

We will start with a full listing of the writer source.
Expand Down

0 comments on commit bf0f9f5

Please sign in to comment.