[pdal] 01/06: Imported Upstream version 1.5.0

Bas Couwenberg sebastic at debian.org
Fri Apr 7 10:24:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository pdal.

commit 026f414b6cad6a236dbf8f2d1c8bd44892fc2e9b
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Apr 7 11:14:10 2017 +0200

    Imported Upstream version 1.5.0
---
 doc/about.rst                        |  19 +++--
 doc/apps/density.rst                 |   6 +-
 doc/community.rst                    |  22 +++---
 doc/development/compilation/unix.rst |   6 +-
 doc/development/docker.rst           |  28 +++++---
 doc/development/docs.rst             |  16 +++++
 doc/download.rst                     |  16 ++---
 doc/index.rst                        |  28 ++++----
 doc/references.rst                   |   4 +-
 doc/stages/filters.elm.rst           |  76 ++++++++++++++++++++
 doc/tutorial/las.rst                 |   4 +-
 filters/ELMFilter.cpp                | 132 +++++++++++++++++++++++++++++++++++
 filters/ELMFilter.hpp                |  76 ++++++++++++++++++++
 io/LasReader.cpp                     |   2 +-
 io/PlyWriter.cpp                     |   2 +-
 pdal/StageFactory.cpp                |   2 +
 pdal/gitsha.cpp                      |   2 +-
 python/VERSION.txt                   |   2 +-
 scripts/docker/Dockerfile            |   2 +-
 scripts/docker/Dockerfile.xenial     |  63 -----------------
 scripts/vagrant/loadpgpointcloud.xml |  16 -----
 scripts/vagrant/readpgpointcloud.xml |  14 ----
 test/unit/io/LasReaderTest.cpp       |  22 +++---
 23 files changed, 393 insertions(+), 167 deletions(-)

diff --git a/doc/about.rst b/doc/about.rst
index 9aa062b..fc7461a 100644
--- a/doc/about.rst
+++ b/doc/about.rst
@@ -225,7 +225,7 @@ of raster and vector formats. PDAL provides the same capability for point
 cloud data types.
 
 PDAL evolved out of the development of database storage and access capabilities
-for the |USACE| CRREL |GRiD| project. Functionality that was creeping into libLAS
+for the |USACE| `CRREL <http://www.erdc.usace.army.mil/Media/Fact-Sheets/Fact-Sheet-Article-View/Article/476649/remote-sensinggeographic-information-systems-center/>`__ |GRiD| project. Functionality that was creeping into |libLAS|
 was pulled into a new library, and it was designed from the ground up to mimic
 successful extract, transform, and load libraries in the geospatial software
 domain. PDAL has steadily attracted more contributors as other software developers
@@ -253,6 +253,11 @@ important to be able to efficiently leverage the available computing. These
 characteristics demand a library oriented toward these approaches and PDAL
 achieves it.
 
+.. note::
+
+    Possible point cloud dimension types provided and supported by PDAL
+    can be found at :ref:`dimensions`.
+
 What tasks are PDAL good at?
 --------------------------------------------------------------------------------
 
@@ -301,7 +306,7 @@ Core C++ Software Library
 PDAL provides a :ref:`C++ API <api>` software developers can use to provide
 point cloud processing capabilities in their own software. PDAL is
 cross-platform C++, and it can compile and run on Linux, OS X, and Windows. The
-best place to learn how to use PDAL's C API is the :ref:`test suite
+best place to learn how to use PDAL's C++ API is the :ref:`test suite
 <pdal_test>` and its `source code
 <https://github.com/PDAL/PDAL/tree/master/test/unit>`__.
 
@@ -309,8 +314,7 @@ best place to learn how to use PDAL's C API is the :ref:`test suite
 
     PDAL :ref:`software <reading>` :ref:`development <writing>`
     :ref:`tutorials <writing-reader>` have more information on how to
-    use the library from a software developer's perspective. We won't
-    get very deep in the C++ swamp in this workshop.
+    use the library from a software developer's perspective.
 
 Command Line Utilities
 ................................................................................
@@ -334,6 +338,13 @@ users can achieve with these applications include:
 * :ref:`Merge <merge_command>` or :ref:`split <split_command>` data
 * :ref:`Catalog <tindex_command>` collections of data
 
+.. note::
+
+    The command line utilities are often simply :ref:`pipeline_command` and
+    :ref:`pipeline` collected into a convenient application. In
+    many cases you can replicate the functionality of an application
+    entirely within a single pipeline.
+
 Python API
 ................................................................................
 
diff --git a/doc/apps/density.rst b/doc/apps/density.rst
index b3f983c..7194846 100644
--- a/doc/apps/density.rst
+++ b/doc/apps/density.rst
@@ -4,13 +4,15 @@
 density
 ********************************************************************************
 
-The density command produces a tessellated hexagonal OGR layer from the
+The density command produces a tessellated hexagonal `OGR layer`_ from the
 output of :ref:`filters.hexbin`.
 
+.. _`OGR layer`: http://www.gdal.org/ogr_utilities.html
+
 .. note::
 
     The ``density`` command is only available when PDAL is linked with Hexer
-    (BUILD_PLUGIN_HEXBIN=ON in CMakeCache.txt).
+    (BUILD_PLUGIN_HEXBIN=ON).
 
 ::
 
diff --git a/doc/community.rst b/doc/community.rst
index 4bad636..a3f3357 100644
--- a/doc/community.rst
+++ b/doc/community.rst
@@ -4,12 +4,13 @@
 Community
 ******************************************************************************
 
-PDAL's community interacts through `Mailing List`_, `GitHub`_, `Gitter`_ and `IRC`_.
-Please feel welcome to ask questions and participate in all of the venues.
-The `Mailing List`_ communication channel is for general questions, development
-discussion, and feedback. The `GitHub`_ communication channel is for development
-activities, bug reports, and testing. The `IRC`_ channel is for real-time
-chat activities such as meetings and interactive debugging sessions.
+PDAL's community interacts through `Mailing List`_, `GitHub`_, `Gitter`_ and
+`IRC`_.  Please feel welcome to ask questions and participate in all of the
+venues.  The `Mailing List`_ communication channel is for general questions,
+development discussion, and feedback. The `GitHub`_ communication channel is
+for development activities, bug reports, and testing. The `IRC`_ and `Gitter`_
+channels are for real-time chat activities such as meetings and interactive
+debugging sessions.
 
 Mailing List
 ..............................................................................
@@ -18,19 +19,14 @@ Developers and users of PDAL participate on the PDAL mailing list. It is OK to
 ask questions about how to use PDAL, how to integrate PDAL into your own software,
 and report issues that you might have.
 
+http://lists.osgeo.org/mailman/listinfo/pdal
+
 .. note::
 
     Please remember that an email to the PDAL list is going to 100s of
     individuals. Do your diligence the best you can on your question before
     asking, but don't be afraid to ask. We won't bite. Promise.
 
-Subscribe
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can find the mailing list management page at
-
-http://lists.osgeo.org/mailman/listinfo/pdal
-
 GitHub
 ..............................................................................
 
diff --git a/doc/development/compilation/unix.rst b/doc/development/compilation/unix.rst
index 4c607c4..57b4f89 100644
--- a/doc/development/compilation/unix.rst
+++ b/doc/development/compilation/unix.rst
@@ -26,7 +26,11 @@ PDAL is known to compile on Linux 2.6's of various flavors and OSX with XCode.
 .. seealso::
 
     :ref:`docker` contains an automated way to build PDAL and all of
-    its dependencies.
+    its dependencies. The `Dockerfile`_ for PDAL build on Xenial is an
+    excellent script describing how to build PDAL and all of its
+    dependencies.
+
+.. _`Dockerfile`: https://github.com/PDAL/PDAL/blob/master/scripts/docker/Dockerfile
 
 .. note::
 
diff --git a/doc/development/docker.rst b/doc/development/docker.rst
index f4f9574..d7c4833 100644
--- a/doc/development/docker.rst
+++ b/doc/development/docker.rst
@@ -9,8 +9,8 @@ PDAL's :ref:`repository <source>` is linked to `DockerHub`_ for automatic buildi
 of `Docker`_ containers. PDAL keeps three Docker containers current.
 
 * ``pdal/dependencies:latest`` -- PDAL's dependencies
-* ``pdal/pdal:latest`` -- PDAL master, manually specified
-* ``pdal/pdal:1.4`` -- PDAL maintenance, automatically generated
+* ``pdal/pdal:latest`` -- PDAL master
+* ``pdal/pdal:1.5`` -- PDAL maintenance branch
 
 
 
@@ -18,7 +18,6 @@ of `Docker`_ containers. PDAL keeps three Docker containers current.
 .. _`Docker`: https://www.docker.com/
 .. _`DockerHub`: https://hub.docker.com/r/pdal/pdal/
 
-.. figure:: ../images/docker-master-branch.png
 
 .. note::
 
@@ -37,7 +36,7 @@ branch Docker containers. The dependencies container is also used during
 :ref:`integration` testing by Travis. It is built using the
 Dockerfile at https://github.com/PDAL/PDAL/blob/master/scripts/docker/dependencies/Dockerfile
 
-The ``pdal/pdal:dependencies`` image is generated by force-pushing a tag
+The ``pdal/dependencies:latest`` image is regenerated by force-pushing a tag
 of the SHA you wish to use to have `DockerHub`_ build.
 
 ::
@@ -47,9 +46,8 @@ of the SHA you wish to use to have `DockerHub`_ build.
 
 .. note::
 
-    The dependencies container is currently built upon
-    `Ubuntu Xenial`_. When the next Ubuntu LTS is released,
-    the PDAL project will likely move to it.
+    The dependencies container is currently built upon `Ubuntu Xenial`_. When
+    the next Ubuntu LTS is released, the PDAL project will likely move to it.
 
 .. _`Ubuntu Xenial`: http://releases.ubuntu.com/16.04/
 
@@ -78,8 +76,18 @@ used for testing and verification of fixes, and it is recommended that users
 looking to depend on PDAL's Docker containers always use known release
 versions off of the last stable release branch.
 
-::
+.. warning::
 
-    git tag -f docker-master
+    You should be using the `Maintenance`_ Docker container for any
+    production-oriented operations. Only use the latest one to test
+    or prototype a latest, unreleased feature.
+
+.. figure:: ../images/docker-master-branch.png
+
+    The ``pdal/pdal:latest`` branch is current relative to the
+    ``docker-master`` branch in GitHub.
+
+::
 
-    git push origin refs/tags/docker-master -f
+    $ git tag -f docker-master
+    $ git push origin refs/tags/docker-master -f
diff --git a/doc/development/docs.rst b/doc/development/docs.rst
index c6de3ba..7ec5bc2 100644
--- a/doc/development/docs.rst
+++ b/doc/development/docs.rst
@@ -115,6 +115,22 @@ issuing the following command:
 
     docker run -v /path/to/pdal/root/tree:/data -w /data/doc pdal/docs make html
 
+
+Container refresh
+................................................................................
+
+The ``pdal/docs`` container can be refreshed on DockerHub by tagging a ``docbuild``
+tag and force-pushing it to the main repository:
+
+::
+
+    $ git tag -f docbuild
+    $ git push origin -f refs/tags/docbuild
+
+.. note::
+
+    The ``pdal/docs`` container is constructed from the `Dockerfile <https://github.com/PDAL/PDAL/blob/master/scripts/docker/docbuild/Dockerfile>`__ at whatever revision the ``docbuild`` tag points to.
+
 .. _`GitHub Pages`: https://pages.github.com/
 .. _`GitHub`: http://github.com/PDAL/PDAL
 
diff --git a/doc/download.rst b/doc/download.rst
index b55d2e7..89380f4 100644
--- a/doc/download.rst
+++ b/doc/download.rst
@@ -13,24 +13,24 @@ Download
 Current Release(s)
 ------------------------------------------------------------------------------
 
-* **2016-12-15** `PDAL-1.4.0-src.tar.gz`_ `Release Notes`_ (`md5`_)
+* **2017-04-06** `PDAL-1.5.0-src.tar.gz`_ `Release Notes`_ (`md5`_)
 
-.. _`Release Notes`: https://github.com/PDAL/PDAL/releases/tag/1.4.0
+.. _`Release Notes`: https://github.com/PDAL/PDAL/releases/tag/1.5.0
 
-.. _`PDAL-1.4.0-src.tar.gz`: http://download.osgeo.org/pdal/PDAL-1.4.0-src.tar.gz
-.. _`md5`: http://download.osgeo.org/pdal/PDAL-1.4.0-src.tar.gz.md5
+.. _`PDAL-1.5.0-src.tar.gz`: http://download.osgeo.org/pdal/PDAL-1.5.0-src.tar.gz
+.. _`md5`: http://download.osgeo.org/pdal/PDAL-1.5.0-src.tar.gz.md5
 .. _`DebianGIS`: http://wiki.debian.org/DebianGis
 
 
 Past Releases
 ------------------------------------------------------------------------------
 
-* **2016-08-29** `PDAL-1.3.0-src.tar.gz`_ `Release Notes`_
-* **2016-03-31** `PDAL-1.2.0-src.tar.gz`_ `Release Notes`_
+* **2016-12-15** `PDAL-1.4.0-src.tar.gz`_
+* **2016-08-29** `PDAL-1.3.0-src.tar.gz`_
 
 
+.. _`PDAL-1.4.0-src.tar.gz`: http://download.osgeo.org/pdal/PDAL-1.4.0-src.tar.gz
 .. _`PDAL-1.3.0-src.tar.gz`: http://download.osgeo.org/pdal/PDAL-1.3.0-src.tar.gz
-.. _`PDAL-1.2.0-src.tar.gz`: http://download.osgeo.org/pdal/PDAL-1.2.0-src.tar.gz
 
 
 
@@ -54,7 +54,7 @@ Docker
 ................................................................................
 
 The fastest way to get going with PDAL is to use the Docker build. See the
-tutorial at :ref:`docker` for more information.
+:ref:`Docker tutorial <docker>` for more information.
 
 ::
 
diff --git a/doc/index.rst b/doc/index.rst
index d597d55..e8add2a 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -8,37 +8,39 @@ PDAL - Point Data Abstraction Library
    :alt: PDAL logo
    :align: right
 
-PDAL is a C++ `BSD`_ library for translating and manipulating `point cloud data`_.
-It is very much like the `GDAL`_ library which handles raster and vector data.
-See :ref:`readers` and :ref:`writers` for data formats PDAL supports, see
-:ref:`filters` for filtering operations that you can apply with PDAL, and
-visit :ref:`about` for a high level over of the library and its philosophy.
+PDAL is a C++ `BSD`_ library for translating and manipulating `point cloud
+data`_.  It is very much like the `GDAL`_ library which handles raster and
+vector data.  The :ref:`about` page provides high level overview of the library
+and its philosophy. Visit :ref:`readers` and :ref:`writers` to list data
+formats it supports, and see :ref:`filters` for filtering operations that you
+can apply with PDAL.
 
 In addition to the library code, PDAL provides a suite of command-line
 applications that users can conveniently use to process, filter, translate, and
 query point cloud data.  :ref:`apps` provides more information on that topic.
 
-Finally, PDAL speaks Python. Visit :ref:`python` to find out how you can
-use PDAL with Python to process point cloud data.
+Finally, PDAL speaks Python by both embedding and extending it. Visit
+:ref:`python` to find out how you can use PDAL with Python to process point
+cloud data.
 
 The entire website is available as a single PDF at http://pdal.io/PDAL.pdf
 
 News
 --------------------------------------------------------------------------------
 
-**12-15-2016**
+**04-6-2016**
 ................................................................................
 
+PDAL 1.5.0 has been released. Visit :ref:`download` to obtain a copy of the
+source code, or follow the :ref:`quickstart` to get going in a hurry with
+`Docker`_.
+
+
 .. image:: ./images/foss4g-2017.png
     :scale: 40%
     :align: right
     :target: http://2017.foss4g.org
 
-PDAL 1.4.0 has been released. Visit :ref:`download` to obtain a copy of the
-source code, or follow the :ref:`quickstart` to get going in a hurry with
-`Docker`_.
-
-
 .. _`Docker`: https://www.docker.com/
 
 .. _`Howard Butler`: http://github.com/hobu
diff --git a/doc/references.rst b/doc/references.rst
index d9adcbd..a3bfe0d 100644
--- a/doc/references.rst
+++ b/doc/references.rst
@@ -7,6 +7,8 @@ References
 .. index:: References
 
 
+.. [Chen2012] Chen, Ziyue et al. “Upward-Fusion Urban DTM Generating Method Using Airborne Lidar Data.” ISPRS Journal of Photogrammetry and Remote Sensing 72 (2012): 121–130.
+
 .. [Cook1986] Cook, Robert L. "Stochastic sampling in computer graphics." *ACM Transactions on Graphics (TOG)* 5.1 (1986): 51-72.
 
 .. [Dippe1985] Dippé, Mark AZ, and Erling Henry Wold. "Antialiasing through stochastic sampling." *ACM Siggraph Computer Graphics* 19.3 (1985): 69-78.
@@ -16,5 +18,3 @@ References
 .. [Rusu2008] Rusu, Radu Bogdan, et al. "Towards 3D point cloud based object maps for household environments." Robotics and Autonomous Systems 56.11 (2008): 927-941.
 
 .. [Zhang2003] Zhang, Keqi, et al. "A progressive morphological filter for removing nonground measurements from airborne LIDAR data." Geoscience and Remote Sensing, IEEE Transactions on 41.4 (2003): 872-882.
-
-
diff --git a/doc/stages/filters.elm.rst b/doc/stages/filters.elm.rst
new file mode 100644
index 0000000..d45047b
--- /dev/null
+++ b/doc/stages/filters.elm.rst
@@ -0,0 +1,76 @@
+.. _filters.elm:
+
+filters.elm
+===============================================================================
+
+The Extended Local Minimum (ELM) filter marks low points as noise. This filter
+is an implementation of the method described in [Chen2012]_.
+
+ELM begins by rasterizing the input point cloud data at the given ``cell`` size.
+Within each cell, the lowest point is considered noise if the next lowest point
+is a given threshold above the current point. If it is marked as noise, the
+difference between the next two points is also considered, marking points as
+noise if needed, and continuing until another neighbor is found to be within the
+threshold. At this point, iteration for the current cell stops, and the next
+cell is considered.
+
+Example #1
+----------
+
+The following PDAL pipeline applies the ELM filter, using a cell size of 20 and
+applying the classification code of 18 to those points determined to be noise.
+
+.. code-block:: json
+
+    {
+      "pipeline":[
+        "input.las",
+        {
+          "type":"filters.elm",
+          "cell":20.0,
+          "class":18
+        },
+        "output.las"
+      ]
+    }
+    
+Example #2
+----------
+
+This variation of the pipeline begins by assigning a value of 0 to all
+classifications, thus resetting any existing classifications. It then proceeds
+to compute ELM with a threshold value of 2.0, and finishes by extracting all
+returns that are not marked as noise.
+
+.. code-block:: json
+
+    {
+      "pipeline":[
+        "input.las",
+        {
+          "type":"filters.assign",
+          "assignment":"Classification[:]=0"
+        },
+        {
+          "type":"filters.elm",
+          "threshold":2.0
+        },
+        {
+          "type":"filters.range",
+          "limits":"Classification![7:7]"
+        },
+        "output.las"
+      ]
+    }
+
+Options
+-------------------------------------------------------------------------------
+
+cell
+  Cell size. [Default: **10.0**]
+
+class
+  Classification value to apply to noise points. [Default: **7**]
+
+threshold
+  Threshold value to identify low noise points. [Default: **1.0**]
diff --git a/doc/tutorial/las.rst b/doc/tutorial/las.rst
index 4a22efd..7856710 100644
--- a/doc/tutorial/las.rst
+++ b/doc/tutorial/las.rst
@@ -400,7 +400,7 @@ extent information, and format settings.
         ]
     }
 
-::note
+.. note::
 
     If multiple input LAS files are being written to an output file, the
     ``forward`` option can only preserve values when they are the same in
@@ -470,7 +470,7 @@ Compression
 It is supported by two different software libraries, and it can be used in both
 the C/C++ and the JavaScript execution environments.  LAZ support is provided
 by both :ref:`readers.las` and :ref:`writers.las`.  It can be enabled by
-setting the ``compression`` option to "laszip".  LAZ support is not
+setting the ``compression`` option to ``laszip``.  LAZ support is not
 fully compatible with LAS 1.4 as of March 2017. A
 revision with 1.4 support is expected.
 
diff --git a/filters/ELMFilter.cpp b/filters/ELMFilter.cpp
new file mode 100644
index 0000000..7f2017c
--- /dev/null
+++ b/filters/ELMFilter.cpp
@@ -0,0 +1,132 @@
+/******************************************************************************
+ * Copyright (c) 2017, Bradley J Chambers (brad.chambers at gmail.com)
+ *
+ * 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.
+ ****************************************************************************/
+
+// PDAL implementation of the Extended Local Minimum (ELM) method as published
+// in Z. Chen, B. Devereux, B. Gao, and G. Amable, “Upward-fusion urban DTM
+// generating method using airborne Lidar data,” ISPRS J. Photogramm. Remote
+// Sens., vol. 72, pp. 121–130, 2012.
+
+#include "ELMFilter.hpp"
+
+#include <pdal/pdal_macros.hpp>
+
+#include <map>
+#include <string>
+
+namespace pdal
+{
+
+static PluginInfo const s_info =
+    PluginInfo("filters.elm", "Extended Local Minimum Filter",
+               "http://pdal.io/stages/filters.elm.html");
+
+CREATE_STATIC_PLUGIN(1, 0, ELMFilter, Filter, s_info)
+
+std::string ELMFilter::getName() const
+{
+    return s_info.name;
+}
+
+void ELMFilter::addArgs(ProgramArgs& args)
+{
+    args.add("cell", "Cell size", m_cell, 10.0);
+    args.add("class", "Class to use for noise points", m_class, uint8_t(7));
+    args.add("threshold", "Threshold value", m_threshold, 1.0);
+}
+
+void ELMFilter::addDimensions(PointLayoutPtr layout)
+{
+    layout->registerDim(Dimension::Id::Classification);
+}
+
+void ELMFilter::filter(PointView& view)
+{
+    BOX2D bounds;
+    view.calculateBounds(bounds);
+
+    size_t cols = ((bounds.maxx - bounds.minx) / m_cell) + 1;
+    size_t rows = ((bounds.maxy - bounds.miny) / m_cell) + 1;
+
+    // Make an initial pass through the input PointView to index elevation
+    // values and PointIds by row and column.
+    std::map<uint32_t, std::multimap<double, PointId>> hash;
+    for (PointId id = 0; id < view.size(); ++id)
+    {
+        double x = view.getFieldAs<double>(Dimension::Id::X, id);
+        double y = view.getFieldAs<double>(Dimension::Id::Y, id);
+        double z = view.getFieldAs<double>(Dimension::Id::Z, id);
+
+        size_t c = static_cast<size_t>(floor(x - bounds.minx) / m_cell);
+        size_t r = static_cast<size_t>(floor(y - bounds.miny) / m_cell);
+
+        hash[c * rows + r].emplace(z, id);
+    }
+
+    // Count the number of points we classify as noise.
+    point_count_t num(0);
+
+    // Make a second pass through the now rasterized PointView to compute the
+    // extended local minimum.
+    for (size_t c = 0; c < cols; ++c)
+    {
+        for (size_t r = 0; r < rows; ++r)
+        {
+            std::multimap<double, PointId> ids(hash[c * rows + r]);
+
+            if (ids.size() <= 1)
+                continue;
+
+            for (auto it = ids.begin(); it != std::prev(ids.end()); ++it)
+            {
+                // Where the current value is sufficiently close to the next, we
+                // consider that this is not a low outlier and break the current
+                // loop.
+                if (std::fabs(it->first - std::next(it)->first) < m_threshold)
+                    break;
+
+                // Otherwise this point is classified as noise, and we proceed
+                // to the next lowest value.
+                view.setField(Dimension::Id::Classification, it->second,
+                              m_class);
+                ++num;
+            }
+        }
+    }
+
+    log()->get(LogLevel::Info)
+        << "Classified " << num
+        << " points as noise by Extended Local Minimum (ELM).\n";
+}
+
+} // namespace pdal
diff --git a/filters/ELMFilter.hpp b/filters/ELMFilter.hpp
new file mode 100644
index 0000000..2cd5cc4
--- /dev/null
+++ b/filters/ELMFilter.hpp
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * Copyright (c) 2017, Bradley J Chambers (brad.chambers at gmail.com)
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
+ *       names of its contributors may be used to endorse or promote
+ *       products derived from this software without specific prior
+ *       written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ ****************************************************************************/
+
+#pragma once
+
+#include <pdal/Filter.hpp>
+#include <pdal/plugin.hpp>
+
+#include <cstdint>
+#include <string>
+
+extern "C" int32_t ELMFilter_ExitFunc();
+extern "C" PF_ExitFunc ELMFilter_InitPlugin();
+
+namespace pdal
+{
+
+class PointLayout;
+class PointView;
+
+class PDAL_DLL ELMFilter : public Filter
+{
+public:
+    ELMFilter() : Filter()
+    {
+    }
+
+    static void* create();
+    static int32_t destroy(void*);
+    std::string getName() const;
+
+private:
+    double m_cell;
+    double m_threshold;
+    uint8_t m_class;
+
+    virtual void addArgs(ProgramArgs& args);
+    virtual void addDimensions(PointLayoutPtr layout);
+    virtual void filter(PointView& view);
+
+    ELMFilter& operator=(const ELMFilter&); // not implemented
+    ELMFilter(const ELMFilter&);            // not implemented
+};
+
+} // namespace pdal
diff --git a/io/LasReader.cpp b/io/LasReader.cpp
index cc4070e..5a68d8a 100644
--- a/io/LasReader.cpp
+++ b/io/LasReader.cpp
@@ -506,7 +506,7 @@ void LasReader::addDimensions(PointLayoutPtr layout)
             continue;
         if (dim.m_dimType.m_xform.nonstandard())
             type = Dimension::Type::Double;
-        dim.m_dimType.m_id = layout->assignDim(dim.m_name, type);
+        dim.m_dimType.m_id = layout->registerOrAssignDim(dim.m_name, type);
     }
 }
 
diff --git a/io/PlyWriter.cpp b/io/PlyWriter.cpp
index cfa888c..407a8e1 100644
--- a/io/PlyWriter.cpp
+++ b/io/PlyWriter.cpp
@@ -158,7 +158,7 @@ void PlyWriter::done(PointTableRef table)
     auto dimensions = table.layout()->dims();
     for (auto dim : dimensions) {
         std::string name = table.layout()->dimName(dim);
-        e_ply_type plyType = getPlyType(Dimension::defaultType(dim));
+        e_ply_type plyType = getPlyType(table.layout()->dimType(dim));
         if (!ply_add_scalar_property(m_ply, name.c_str(), plyType))
             throwError("Could not add scalar property '" + name  + "'");
     }
diff --git a/pdal/StageFactory.cpp b/pdal/StageFactory.cpp
index 3e0385f..676df53 100644
--- a/pdal/StageFactory.cpp
+++ b/pdal/StageFactory.cpp
@@ -47,6 +47,7 @@
 #include <filters/DecimationFilter.hpp>
 #include <filters/DividerFilter.hpp>
 #include <filters/EigenvaluesFilter.hpp>
+#include <filters/ELMFilter.hpp>
 #include <filters/EstimateRankFilter.hpp>
 #include <filters/FerryFilter.hpp>
 #include <filters/GroupByFilter.hpp>
@@ -247,6 +248,7 @@ StageFactory::StageFactory(bool no_plugins)
     PluginManager::initializePlugin(DecimationFilter_InitPlugin);
     PluginManager::initializePlugin(DividerFilter_InitPlugin);
     PluginManager::initializePlugin(EigenvaluesFilter_InitPlugin);
+    PluginManager::initializePlugin(ELMFilter_InitPlugin);
     PluginManager::initializePlugin(EstimateRankFilter_InitPlugin);
     PluginManager::initializePlugin(FerryFilter_InitPlugin);
     PluginManager::initializePlugin(GroupByFilter_InitPlugin);
diff --git a/pdal/gitsha.cpp b/pdal/gitsha.cpp
index d58c91f..40889ed 100644
--- a/pdal/gitsha.cpp
+++ b/pdal/gitsha.cpp
@@ -1,3 +1,3 @@
 #include <pdal/gitsha.h>
-#define GIT_SHA1 "0d03c5af0cc09edc526b505407713adb4bcd9bc5"
+#define GIT_SHA1 "6a64e0b1033cbd8d5c1adda34133c8ee9a98839e"
 const char g_GIT_SHA1[] = GIT_SHA1;
diff --git a/python/VERSION.txt b/python/VERSION.txt
index bc80560..3e1ad72 100644
--- a/python/VERSION.txt
+++ b/python/VERSION.txt
@@ -1 +1 @@
-1.5.0
+1.5.0
\ No newline at end of file
diff --git a/scripts/docker/Dockerfile b/scripts/docker/Dockerfile
index 8949aba..22c5fa1 100644
--- a/scripts/docker/Dockerfile
+++ b/scripts/docker/Dockerfile
@@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --fix-missing --no-install-recommends \
 
 RUN git clone --depth=1 https://github.com/PDAL/PDAL \
     && cd PDAL \
-    && git checkout master \
+    && git checkout 1.5-maintenance \
     && mkdir build \
     && cd build \
     && cmake \
diff --git a/scripts/docker/Dockerfile.xenial b/scripts/docker/Dockerfile.xenial
deleted file mode 100644
index 190ffa6..0000000
--- a/scripts/docker/Dockerfile.xenial
+++ /dev/null
@@ -1,63 +0,0 @@
-FROM pdal/dependencies:xenial
-MAINTAINER Howard Butler <howard at hobu.co>
-#ARG branch=master
-
-ENV CC clang
-ENV CXX clang++
-
-RUN apt-get update && apt-get install -y --fix-missing --no-install-recommends \
-        cython \
-        python-pip \
-        libhpdf-dev \
-    && rm -rf /var/lib/apt/lists/*
-
-RUN git clone --depth=1 https://github.com/PDAL/PDAL \
-    && cd PDAL \
-    && git checkout master \
-    && mkdir build \
-    && cd build \
-    && cmake \
-        -DBUILD_PLUGIN_CPD=OFF \
-        -DBUILD_PLUGIN_GREYHOUND=ON \
-        -DBUILD_PLUGIN_HEXBIN=ON \
-        -DBUILD_PLUGIN_ICEBRIDGE=ON \
-        -DBUILD_PLUGIN_MRSID=ON \
-        -DBUILD_PLUGIN_NITF=ON \
-        -DBUILD_PLUGIN_OCI=OFF \
-        -DBUILD_PLUGIN_P2G=ON \
-        -DBUILD_PLUGIN_PCL=ON \
-        -DBUILD_PLUGIN_PGPOINTCLOUD=ON \
-        -DBUILD_PLUGIN_SQLITE=ON \
-        -DBUILD_PLUGIN_RIVLIB=OFF \
-        -DBUILD_PLUGIN_PYTHON=ON \
-        -DCMAKE_INSTALL_PREFIX=/usr \
-        -DENABLE_CTEST=OFF \
-        -DWITH_APPS=ON \
-        -DWITH_LAZPERF=ON \
-        -DWITH_LASZIP=ON \
-        -DWITH_TESTS=ON \
-        -DWITH_PDAL_JNI=ON \
-        -DCMAKE_BUILD_TYPE=Release \
-        .. \
-    && make -j4 \
-    && make install \
-    && rm -rf /PDAL
-
-#RUN pip install packaging \
-#    && pip install PDAL
-
-RUN git clone https://github.com/PDAL/PRC.git \
-    && cd PRC \
-    && git checkout master \
-    && mkdir build \
-    && cd build \
-    && echo `pwd` \
-    && ls .. \
-    && cmake \
-        -DCMAKE_BUILD_TYPE=Release \
-        -DPDAL_DIR=/usr/lib/pdal/cmake \
-        .. \
-    && make \
-    && make install \
-    && rm -rf /PRC
-
diff --git a/scripts/vagrant/loadpgpointcloud.xml b/scripts/vagrant/loadpgpointcloud.xml
deleted file mode 100644
index 87d4659..0000000
--- a/scripts/vagrant/loadpgpointcloud.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Pipeline version="1.0">
-    <Writer type="writers.pgpointcloud">
-        <Option name="connection">dbname='points'</Option>
-        <Option name="table">sthsm</Option>
-        <Option name="srid">26910</Option>
-        <Option name="capacity">600</Option>
-        <Filter type="filters.chipper">
-            <Option name="capacity">600</Option>
-	    <Reader type="readers.las">
-		<Option name="filename">/home/vagrant/pointcloud/st-helens-small.las</Option>
-		<Option name="spatialreference">EPSG:26910</Option>
-	    </Reader>
-        </Filter>
-    </Writer>
-</Pipeline>
diff --git a/scripts/vagrant/readpgpointcloud.xml b/scripts/vagrant/readpgpointcloud.xml
deleted file mode 100644
index 121373d..0000000
--- a/scripts/vagrant/readpgpointcloud.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Pipeline version="1.0">
-    <Writer type="writers.las">
-        <Option name="filename">st-helens-small-out.las</Option>
-        <Option name="spatialreference">EPSG:26910</Option>
-        <Reader type="readers.pgpointcloud">
-            <Option name="connection">dbname='points'</Option>
-            <Option name="table">sthsm</Option>
-            <Option name="column">pa</Option>
-            <Option name="srid">26910</Option>
-            <Option name="where">PC_Intersects(pa, ST_MakeEnvelope(560037.36, 5114846.45, 562667.31, 5118943.24, 26910))</Option>
-        </Reader>
-    </Writer>
-</Pipeline>
diff --git a/test/unit/io/LasReaderTest.cpp b/test/unit/io/LasReaderTest.cpp
index 63981b6..d3058aa 100644
--- a/test/unit/io/LasReaderTest.cpp
+++ b/test/unit/io/LasReaderTest.cpp
@@ -273,7 +273,7 @@ TEST(LasReaderTest, extraBytes)
     reader.prepare(table);
 
     DimTypeList dimTypes = layout->dimTypes();
-    EXPECT_EQ(dimTypes.size(), (size_t)25);
+    EXPECT_EQ(dimTypes.size(), (size_t)24);
 
     Dimension::Id color0 = layout->findProprietaryDim("Colors0");
     EXPECT_EQ(layout->dimType(color0), Dimension::Type::Unsigned16);
@@ -287,10 +287,7 @@ TEST(LasReaderTest, extraBytes)
     Dimension::Id flag1 = layout->findProprietaryDim("Flags1");
     EXPECT_EQ(layout->dimType(flag1), Dimension::Type::Signed8);
 
-    Dimension::Id intense2 = layout->findProprietaryDim("Intensity");
-    EXPECT_EQ(layout->dimType(intense2), Dimension::Type::Unsigned32);
-
-    Dimension::Id time2 = layout->findProprietaryDim("Time");
+    Dimension::Id time2 = layout->findDim("Time");
     EXPECT_EQ(layout->dimType(time2), Dimension::Type::Unsigned64);
 
     PointViewSet viewSet = reader.execute(table);
@@ -309,23 +306,20 @@ TEST(LasReaderTest, extraBytes)
 
     for (PointId idx = 0; idx < view->size(); ++idx)
     {
-        EXPECT_EQ(view->getFieldAs<uint16_t>(red, idx),
+        ASSERT_EQ(view->getFieldAs<uint16_t>(red, idx),
             view->getFieldAs<uint16_t>(color0, idx));
-        EXPECT_EQ(view->getFieldAs<uint16_t>(green, idx),
+        ASSERT_EQ(view->getFieldAs<uint16_t>(green, idx),
             view->getFieldAs<uint16_t>(color1, idx));
-        EXPECT_EQ(view->getFieldAs<uint16_t>(blue, idx),
+        ASSERT_EQ(view->getFieldAs<uint16_t>(blue, idx),
             view->getFieldAs<uint16_t>(color2, idx));
 
-        EXPECT_EQ(view->getFieldAs<uint16_t>(flag0, idx),
+        ASSERT_EQ(view->getFieldAs<uint16_t>(flag0, idx),
             view->getFieldAs<uint16_t>(returnNum, idx));
-        EXPECT_EQ(view->getFieldAs<uint16_t>(flag1, idx),
+        ASSERT_EQ(view->getFieldAs<uint16_t>(flag1, idx),
             view->getFieldAs<uint16_t>(numReturns, idx));
 
-        EXPECT_EQ(view->getFieldAs<uint16_t>(intensity, idx),
-            view->getFieldAs<uint16_t>(intense2, idx));
-
         // Time was written truncated rather than rounded.
-        EXPECT_NEAR(view->getFieldAs<double>(time, idx),
+        ASSERT_NEAR(view->getFieldAs<double>(time, idx),
             view->getFieldAs<double>(time2, idx), 1.0);
     }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pdal.git



More information about the Pkg-grass-devel mailing list