Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into lazperf
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed May 17, 2021
2 parents 0bf884f + b172d83 commit c5a44c9
Show file tree
Hide file tree
Showing 115 changed files with 2,221 additions and 2,112 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
platform: ['ubuntu-latest','windows-latest','macos-latest']

env:
PLATFORM: ${{ matrix.platform }}
PDAL_PLATFORM: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
containers:
runs-on: ubuntu-latest
env:
PUSH_PACKAGES: ${{ github.repository_owner == 'PDAL' }}
PUSH_PACKAGES: ${{ github.repository_owner == 'PDAL' && github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v2
- name: Lint
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ include(${PDAL_CMAKE_DIR}/gdal.cmake)
include(${PDAL_CMAKE_DIR}/geotiff.cmake) # Optional (not really)
include(${PDAL_CMAKE_DIR}/lazperf.cmake) # Optional
include(${PDAL_CMAKE_DIR}/laszip.cmake) # Optional
include(${PDAL_CMAKE_DIR}/draco.cmake) # Optional
include(${PDAL_CMAKE_DIR}/threads.cmake)
include(${PDAL_CMAKE_DIR}/zlib.cmake)
include(${PDAL_CMAKE_DIR}/lzma.cmake)
Expand Down
21 changes: 4 additions & 17 deletions cmake/draco.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
#
option(WITH_DRACO "Choose if Draco support should be built" TRUE)
find_package(Draco EXACT 1.3.6)
# the `pkg_check_modules` function is created with this call
find_package(PkgConfig REQUIRED)
pkg_check_modules(DRACO REQUIRED draco>1.4.0)

if (WITH_DRACO)
set_package_properties(Draco PROPERTIES TYPE RECOMMENDED
PURPOSE "Provides Draco compression")
if(Draco_FOUND)
include_directories(${draco_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${draco_LIBRARIES})
set(PDAL_HAVE_DRACO 1)
set(BUILD_PLUGIN_DRACO 1)
set(DRACO_LIBRARY "draco")
else()
set(WITH_DRACO FALSE)
endif()
else()
set(WITH_DRACO FALSE)
endif()
set(PDAL_HAVE_DRACO 1)
6 changes: 3 additions & 3 deletions cmake/gdal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ function(gdal_find_version _version)
set(${_version} ${MAJOR}.${MINOR}.${REV} PARENT_SCOPE)
endfunction(gdal_find_version)

find_package(GDAL 2.2.0 REQUIRED)
find_package(GDAL 3.0 REQUIRED)
set_package_properties(GDAL PROPERTIES TYPE REQUIRED
PURPOSE "Provides general purpose raster, vector, and reference system support")
if (GDAL_FOUND)
gdal_find_version(GDAL_VERSION)
#
# Older versions of FindGDAL.cmake don't properly set GDAL_VERSION
#
if (GDAL_VERSION VERSION_LESS 2.2.0)
if (GDAL_VERSION VERSION_LESS 3.0.0)
message(FATAL_ERROR
"Found GDAL version ${GDAL_VERSION}. Version 2.2+ is required")
"Found GDAL version ${GDAL_VERSION}. Version 3.0+ is required")
endif()
mark_as_advanced(CLEAR GDAL_INCLUDE_DIR)
mark_as_advanced(CLEAR GDAL_LIBRARY)
Expand Down
4 changes: 2 additions & 2 deletions doc/apps/chamfer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ distance :math:`d_{CD}(X,Y)` is

::

--source arg Non-positional option for specifying filename of source file.
--candidate arg Non-positional option for specifying filename to test against source.
--source arg Source filename
--candidate arg Candidate filename

The algorithm makes no distinction between source and candidate files (i.e.,
they can be transposed with no affect on the computed distance).
Expand Down
70 changes: 70 additions & 0 deletions doc/apps/eval.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.. _eval_command:

********************************************************************************
eval
********************************************************************************

The ``eval`` command is used to compare the ``Classification`` dimensions of two
point clouds.
::

$ pdal eval <predicted> <truth> --labels <labels>

::

--predicted arg Positional argument specifying point cloud filename containing predicted labels.
--truth arg Positional argument specifying point cloud filename containing truth labels.
--labels arg Comma-separated list of classification labels to evaluate.

The command returns 0 along with a JSON-formatted classification report
summarizing various classification metrics.

In the provided example below, the truth and predicted point clouds contain
points classified as ground (class 2) and medium vegetation (class 4) in
accordance with the LAS specification. Both point clouds also contain some
number of classifications that are either unlabeled or do not fall into the
specificied classes.

::

$ pdal eval predicted.las truth.las --labels 2,4
{
"confusion_matrix": "[[5240537,3860,24102],[268015,3179304,326677],[111453,115516,2950315]]",
"f1_score": 0.944,
"labels": [
{
"accuracy": 0.967,
"f1_score": 0.973,
"intersection_over_union": 0.947,
"label": "1",
"precision": 0.951,
"sensitivity": 0.995,
"specificity": 0.929,
"support": 5268499
},
{
"accuracy": 0.934,
"f1_score": 0.914,
"intersection_over_union": 0.842,
"label": "2",
"precision": 0.999,
"sensitivity": 0.842,
"specificity": 0.999,
"support": 3773996
}
],
"mean_intersection_over_union": 0.894,
"overall_accuracy": 0.931,
"pdal_version": "2.2.0 (git-version: 6e80b9)",
"predicted_file": "predicted.las",
"truth_file": "truth.las"
}

Most of the returned metrics will be self explanatory, with scores reported
both for individual classes and at a summary level. The returned confusion
matrix is presented in row-major order, where each row corresponds to a truth
label (the last row is a catch-all for any unlabeled or ignored entries).
Similarly, confusion matrix columns correspond to predicted labels where the
last column is once again a catch-all for unlabeled entries. Although
unlabeled/ignored truth labels are reported in the confusion matrix, they are
excluded from all computed scores.
4 changes: 2 additions & 2 deletions doc/apps/hausdorff.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ supremum and infimum respectively.

::

--source arg Non-positional option for specifying filename of source file.
--candidate arg Non-positional option for specifying filename to test against source.
--source arg Source filename
--candidate arg Candidate filename

The algorithm makes no distinction between source and candidate files (i.e.,
they can be transposed with no affect on the computed distance).
Expand Down
4 changes: 2 additions & 2 deletions doc/stages/filters.assign.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ assignment
to the dimension value as set when the filter began processing. [Required]

condition
A list of :ref:`ranges <ranges>` that a point's values must pass in order
for the assignment to be performed. [Default: none]
A single :ref:`ranges <ranges>` that a point's values must pass in order
for the assignment to be performed. [Default: none] [Deprecated - use 'value']

value
A list of :ref:`assignment expressions <Assignment Expressions>` to be applied to points.
Expand Down
2 changes: 2 additions & 0 deletions doc/stages/filters.cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ is3d
By default, clusters are formed by considering neighbors in a 3D sphere, but
if ``is3d`` is set to false, it will instead consider neighbors in a 2D
cylinder (XY plane only). [Default: true]

.. include:: filter_opts.rst
6 changes: 3 additions & 3 deletions doc/stages/filters.icp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ The metadata output might start something like:
"filters.icp":
{
"centroid": " 583394 5.2831e+06 498.152",
"composed": " 1 2.60209e-18 -1.97906e-09 -0.374999 8.9407e-08 1 5.58794e-09 -0.614662 6.98492e -10 -5.58794e-09 1 0.033234 0 0 0 1",
"composed": " 1 2.60209e-18 -1.97906e-09 -0.374999 8.9407e-08 1 5.58794e-09 -0.614662 6.98492e-10 -5.58794e-09 1 0.033234 0 0 0 1",
"converged": true,
"fitness": 0.01953125097,
"transform": " 1 2.60209e-18 -1.97906e-09 -0.375 8.9407e-08 1 5.58794e-09 -0.5625 6.98492e -10 -5.58794e-09 1 0.00411987 0 0 0 1"
"transform": " 1 2.60209e-18 -1.97906e-09 -0.375 8.9407e-08 1 5.58794e-09 -0.5625 6.98492e-10 -5.58794e-09 1 0.00411987 0 0 0 1"
}
Expand All @@ -89,7 +89,7 @@ would be similar to:
},
{
"type": "filters.transformation",
"matrix": "1 2.60209e-18 -1.97906e-09 -0.375 8.9407e-08 1 5.58794e-09 -0.5625 6.98492e -10 -5.58794e-09 1 0.00411987 0 0 0 1"
"matrix": "1 2.60209e-18 -1.97906e-09 -0.375 8.9407e-08 1 5.58794e-09 -0.5625 6.98492e-10 -5.58794e-09 1 0.00411987 0 0 0 1"
},
{
"type": "filters.transformation",
Expand Down
52 changes: 52 additions & 0 deletions doc/stages/filters.zsmooth.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. _filters.zsmooth:

filters.zsmooth
===============================================================================

The **Zsmooth Filter** computes a new Z value as another dimension that is based
on the Z values of neighboring points.

All points within some distance in the X-Y plane from a reference point are ordered by Z value.
The reference point's new smoothed Z value is chosen to be that of the Nth median value of
the neighboring points, where N is specified as the _`medianpercent` option.

Use :ref:`filters.assign` to assign the smoothed Z value to the actual Z dimension if
desired.

Example
-------

Compute the smoothed Z value as the median Z value of the neighbors within 2 units and
assign the value back to the Z dimension.

[
"input.las",
{
"type": "filters.zsmooth",
"radius": 2,
"dim": "Zadj"
},
{
"type": "filters.assign",
"value": "Z = Zadj"
},
"output.las"
]

Options
-------------------------------------------------------------------------------

radius
All points within `radius` units from the reference point in the X-Y plane are considered
to determine the smoothed Z value. [Default: 1]

medianpercent
A value between 0 and 100 that specifies the relative position of ordered Z values of neighbors
to use as the new smoothed Z value. 0 specifies the minimum value. 100 specifies the
maximum value. 50 specifies the mathematical median of the values. [Default: 50]

dim
The name of a dimension to use for the adjusted Z value. Cannot be 'Z'. [Required]

.. include:: filter_opts.rst

5 changes: 2 additions & 3 deletions doc/stages/readers.ept.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ polygon

When using ``pdal info --summary``, using the ``polygon`` option will cause the resulting bounds to be clipped to the maximal extents of all provided polygons, and the resulting number of points to be an upper bound for this polygon selection.

threads
Number of worker threads used to download and process EPT data. A
minimum of 4 will be used no matter what value is specified.
requests
Maximum number of simultaneous requests for EPT data. [Minimum: 4] [Default: 15]

.. _Entwine Point Tile: https://entwine.io/entwine-point-tile.html
.. _Entwine: https://entwine.io/
Expand Down
5 changes: 5 additions & 0 deletions doc/stages/readers.las.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,8 @@ ignore_vlr
fix_dims
Make invalid dimension names valid by converting disallowed characters to '_'. Only
applies to names specified in an extra-bytes VLR. [Default: true]

nosrs
Don't read the SRS VLRs. The data will not be assigned an SRS. This option is
for use only in special cases where processing the SRS could cause performance
issues. [Default: false]
4 changes: 4 additions & 0 deletions doc/stages/readers.mrsid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
readers.mrsid
=============

.. note::

The MrSID reader is deprecated and will be removed in a future release.

Implements MrSID 4.0 LiDAR Compressor. It requires the `Lidar_DSDK`_ to be able to
decompress and read data.

Expand Down
13 changes: 13 additions & 0 deletions doc/stages/writer_opts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
where
An :ref:`expression <PDAL expression>` that limits points passed to a writer.
Points that don't pass the
expression skip the stage but are available to subsequent stages in a pipeline.
[Default: no filtering]

where_merge
A strategy for merging points skipped by a '`where'` option when running in standard mode.
If ``true``, the skipped points are added to the first point view returned by the skipped
filter. If ``false``, skipped points are placed in their own point view. If ``auto``,
skipped points are merged into the returned point view provided that only one point view
is returned and it has the same point count as it did when the writer was run.
[Default: ``auto``]
4 changes: 2 additions & 2 deletions doc/stages/writers.draco.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ quantization
"GENERIC": 8
}


.. include:: writer_opts.rst

.. _PDAL's Type specification: https://github.com/PDAL/PDAL/blob/master/pdal/DimUtil.hpp
.. _Draco: https://github.com/google/draco
.. _Draco: https://github.com/google/draco
1 change: 1 addition & 0 deletions doc/stages/writers.raster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,4 @@ nodata
[Default: depends on the data_type_. -9999 for double, float, int and short, 9999 for
unsigned int and unsigned short, 255 for unsigned char and -128 for char]

.. include:: writer_opts.rst
2 changes: 1 addition & 1 deletion doc/tutorial/iowa.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"pipeline": [
{
"bounds": "([-10425171.940, -10423171.940], [5164494.710, 5166494.710])",
"filename": "https://s3-us-west-2.amazonaws.com/usgs-lidar-public/IA_FullState",
"filename": "https://s3-us-west-2.amazonaws.com/usgs-lidar-public/IA_FullState/ept.json",
"type": "readers.ept",
"tag": "readdata"
},
Expand Down
3 changes: 1 addition & 2 deletions filters/CropFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ void CropFilter::transform(const SpatialReference& srs)
// if it is missing we assign it from the point data.
assert(!m_args->m_assignedSrs.empty());
if (srs.empty() || m_args->m_assignedSrs.empty())
throwError("Unable to transform crop geometry to point "
"coordinate system.");
throwError("Unable to transform crop geometry to point coordinate system.");

for (auto& box : m_boxes)
{
Expand Down
9 changes: 8 additions & 1 deletion filters/FarthestPointSamplingFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,16 @@ PointViewSet FarthestPointSamplingFilter::run(PointViewPtr inView)
{
// Return empty PointViewSet if the input PointView has no points.
PointViewSet viewSet;
if (!inView->size() || (inView->size() < m_count))
if (!inView->size())
return viewSet;

// Return inView if input PointView has fewer than count points.
if (inView->size() < m_count)
{
viewSet.insert(inView);
return viewSet;
}

PointIdList ids = Segmentation::farthestPointSampling(*inView, m_count);

PointViewPtr outView = inView->makeNew();
Expand Down
6 changes: 2 additions & 4 deletions filters/GpsTimeConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,15 @@ void GpsTimeConvert::initialize()
}


std::tm GpsTimeConvert::gpsTime2Date(const double seconds)
std::tm GpsTimeConvert::gpsTime2Date(int seconds)
{
std::tm gpsZero = {};
gpsZero.tm_year = 80;
gpsZero.tm_mon = 0;
gpsZero.tm_mday = 6;
gpsZero.tm_hour = 0;
gpsZero.tm_min = 0;
gpsZero.tm_sec = 0;

gpsZero.tm_sec += seconds;
gpsZero.tm_sec = seconds;

// refresh struct
std::mktime(&gpsZero);
Expand Down
2 changes: 1 addition & 1 deletion filters/GpsTimeConvert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PDAL_DLL GpsTimeConvert : public Filter
void gpsTime2WeekSeconds(PointView& view);
void gpsTime2GpsTime(PointView& view);

std::tm gpsTime2Date(const double seconds);
std::tm gpsTime2Date(int seconds);
int weekStartGpsSeconds(std::tm date);
void unwrapWeekSeconds(PointView& view);
void wrapWeekSeconds(PointView& view);
Expand Down

0 comments on commit c5a44c9

Please sign in to comment.