Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/PDAL/PDAL into point-context
Browse files Browse the repository at this point in the history
Conflicts:
	test/unit/CMakeLists.txt
  • Loading branch information
abellgithub committed Jun 3, 2014
2 parents 52d22aa + bf6b6c5 commit 1a85304
Show file tree
Hide file tree
Showing 20 changed files with 307 additions and 159 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ language: cpp
compiler:
- g++

env:
- PDAL_OPTIONAL_COMPONENTS=all
- PDAL_OPTIONAL_COMPONENTS=none

before_install: ./scripts/ci/before_install.sh

script: ./scripts/ci/script.sh
Expand Down
5 changes: 4 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder "/Users/hobu/dev/git/pointcloud", "/pointcloud", nfs: use_nfs
end
end


if RUBY_PLATFORM.include? "win32"
config.vm.synced_folder ".", "/vagrant", type: "smb"
end


ppaRepos = [
Expand Down
4 changes: 4 additions & 0 deletions apps/pdal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ void outputVersion()
std::cout << " - delta" << std::endl;
std::cout << " - diff" << std::endl;
std::cout << " - info" << std::endl;
#ifdef PDAL_HAVE_PCL
std::cout << " - pcl" << std::endl;
#endif
std::cout << " - pipeline" << std::endl;
std::cout << " - translate" << std::endl;
std::cout << std::endl;
Expand Down Expand Up @@ -123,11 +125,13 @@ int main(int argc, char* argv[])
return app.run();
}

#ifdef PDAL_HAVE_PCL
if (boost::iequals(action, "pcl"))
{
pdal::kernel::PCL app(count, args);
return app.run();
}
#endif

if (boost::iequals(action, "pipeline"))
{
Expand Down
221 changes: 122 additions & 99 deletions doc/apps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ PDAL Applications
:Date: 10/21/2013

PDAL contains a single `git`_-style application, called *pdal*. The `pdal`
application currently contains four commands:
application currently contains six commands:

* :ref:`translate <translate_command>`
* :ref:`info <info_command>`
* :ref:`pipeline <pipeline_command>`
* :ref:`delta <delta_command>`
* :ref:`diff <diff_command>`
* :ref:`info <info_command>`
* :ref:`pcl <pcl_command>`
* :ref:`pipeline <pipeline_command>`
* :ref:`translate <translate_command>`

Applications are run by invoking the *pdal* application along with the
command name:
Expand All @@ -40,41 +41,81 @@ particular drivers and their options
.. _`git`: http://git-scm.com/


.. _translate_command:
.. _delta_command:

``translate`` command
``delta`` command
------------------------------------------------------------------------------

The *translate* command is used for simple conversion of files based on their
file extensions. Use the :ref:`pipeline_command` for more significant
translation operations.
The *delta* command is used to select a nearest point from a candidate file
for each point in the source file. If the ``--2d`` option is used, the
query only happens in XY coordinate space.

::

-i [ --input ] arg input file name
-o [ --output ] arg output file name
--a_srs arg Assign input coordinate system (if supported by
output format)
--t_srs arg Transform to output coordinate system (if
supported by output format)
-z [ --compress ] Compress output data (if supported by output
format)
--count arg (=0) How many points should we write?
--skip arg (=0) How many points should we skip?
--bounds arg Extent (in XYZ to clip output to)
--polygon arg POLYGON WKT to use for precise crop of data (2d
or 3d)
--scale arg A comma-separated or quoted, space-separated
list of scales to set on the output file:
--scale 0.1,0.1,0.00001
--scale "0.1 0.1 0.00001"
--offset arg A comma-separated or quoted, space-separated
list of offsets to set on the output file:
--offset 0,0,0
--offset "1234 5678 91011"
-m [ --metadata ] [=arg(=1)] Forward metadata (VLRs, header entries, etc)
from previous stages

$ pdal delta test/data/1.2-with-color.las test/data/1.2-with-color.las > deltas

A simple CSV-style text is output with delta information:

::

[hobu@pyro pdal (master)]$ ./bin/pdal delta test/data/1.2-with-color.las test/data/1.2-with-color.las
------------------------------------------------------------------------------------------
Delta summary for source 'test/data/1.2-with-color.las' and candidate 'test/data/1.2-with-color.las'
------------------------------------------------------------------------------------------

----------- --------------- --------------- --------------
Dimension X Y Z
----------- --------------- --------------- --------------
Min 0.0000 0.0000 0.0000
Min 0.0000 0.0000 0.0000
Mean 0.0000 0.0000 0.0000
----------- --------------- --------------- --------------

::

[hobu@pyro pdal (master)]$ ./bin/pdal delta test/data/1.2-with-color.las test/data/1.2-with-color.las --detail

::

"ID","DeltaX","DeltaY","DeltaZ"
0,0.00,0.00,0.00
1,0.00,0.00,0.00
2,0.00,0.00,0.00
3,0.00,0.00,0.00
4,0.00,0.00,0.00
5,0.00,0.00,0.00

::

--source arg source file name
--candidate arg candidate file name
--output arg output file name
--2d only 2D comparisons/indexing


.. _diff_command:

``diff`` command
------------------------------------------------------------------------------

The *diff* command is used for executing a simple contextual difference
between two sources.

::

$ pdal diff test/data/1.2-with-color.las test/data/1.2-with-color-clipped.las

It will output JSON if there are any differences. It will output nothing
and return 0 if there are no differences. At this time it supports
checking the following:

* Different schema
* Expected count
* Metadata
* Actual point count
* Byte-by-byte point data


.. _info_command:

``info`` command
Expand Down Expand Up @@ -126,93 +167,75 @@ Print three selected points of the file as `reStructuredText`_
--seed arg (=0) Seed value for random sample
--sample_size arg (=1000) Sample size for random sample

.. _pipeline_command:

``pipeline`` command
------------------------------------------------------------------------------

The pipeline command is used to execute :ref:`pipeline` XML. See :ref:`reading`
or :ref:`pipeline` for more information.

::

-i [ --input ] arg input file name
--pipeline-serialization arg
--validate Validate the pipeline (including serialization),
but do not execute writing of points
--count arg (=0) How many points should we write?
--skip arg (=0) How many points should we skip?

.. _delta_command:
.. _pcl_command:

``delta`` command
``pcl`` command
------------------------------------------------------------------------------

The *delta* command is used to select a nearest point from a candidate file
for each point in the source file. If the ``--2d`` option is used, the
query only happens in XY coordinate space.

::

$ pdal delta test/data/1.2-with-color.las test/data/1.2-with-color.las > deltas

A simple CSV-style text is output with delta information:
The *pcl* command is used to invoke a PCL JSON pipeline. See
:ref:`pcl_block_tutorial` for more information.

::

[hobu@pyro pdal (master)]$ ./bin/pdal delta test/data/1.2-with-color.las test/data/1.2-with-color.las
------------------------------------------------------------------------------------------
Delta summary for source 'test/data/1.2-with-color.las' and candidate 'test/data/1.2-with-color.las'
------------------------------------------------------------------------------------------
-i [ --input ] arg input file name
-o [ --output ] arg output file name
-p [ --pcl ] arg pcl file name
-z [ --compress ] Compress output data (if supported by output format)

----------- --------------- --------------- --------------
Dimension X Y Z
----------- --------------- --------------- --------------
Min 0.0000 0.0000 0.0000
Min 0.0000 0.0000 0.0000
Mean 0.0000 0.0000 0.0000
----------- --------------- --------------- --------------
The *pcl* command is only available when PDAL is build with PCL support.

::

[hobu@pyro pdal (master)]$ ./bin/pdal delta test/data/1.2-with-color.las test/data/1.2-with-color.las --detail
.. _pipeline_command:

::
``pipeline`` command
------------------------------------------------------------------------------

"ID","DeltaX","DeltaY","DeltaZ"
0,0.00,0.00,0.00
1,0.00,0.00,0.00
2,0.00,0.00,0.00
3,0.00,0.00,0.00
4,0.00,0.00,0.00
5,0.00,0.00,0.00
The *pipeline* command is used to execute :ref:`pipeline` XML. See :ref:`reading`
or :ref:`pipeline` for more information.

::

--source arg source file name
--candidate arg candidate file name
--output arg output file name
--2d only 2D comparisons/indexing
-i [ --input ] arg input file name
--pipeline-serialization arg
--validate Validate the pipeline (including serialization),
but do not execute writing of points
--count arg (=0) How many points should we write?
--skip arg (=0) How many points should we skip?


.. _diff_command:
.. _translate_command:

``diff`` command
``translate`` command
------------------------------------------------------------------------------

The *diff* command is used for executing a simple contextual difference
between two sources.
The *translate* command is used for simple conversion of files based on their
file extensions. Use the :ref:`pipeline_command` for more significant
translation operations.

::

$ pdal diff test/data/1.2-with-color.las test/data/1.2-with-color-clipped.las

It will output JSON if there are any differences. It will output nothing
and return 0 if there are no differences. At this time it supports
checking the following:
-i [ --input ] arg input file name
-o [ --output ] arg output file name
--a_srs arg Assign input coordinate system (if supported by
output format)
--t_srs arg Transform to output coordinate system (if
supported by output format)
-z [ --compress ] Compress output data (if supported by output
format)
--count arg (=0) How many points should we write?
--skip arg (=0) How many points should we skip?
--bounds arg Extent (in XYZ to clip output to)
--polygon arg POLYGON WKT to use for precise crop of data (2d
or 3d)
--scale arg A comma-separated or quoted, space-separated
list of scales to set on the output file:
--scale 0.1,0.1,0.00001
--scale "0.1 0.1 0.00001"
--offset arg A comma-separated or quoted, space-separated
list of offsets to set on the output file:
--offset 0,0,0
--offset "1234 5678 91011"
-m [ --metadata ] [=arg(=1)] Forward metadata (VLRs, header entries, etc)
from previous stages

* Different schema
* Expected count
* Metadata
* Actual point count
* Byte-by-byte point data
6 changes: 6 additions & 0 deletions include/pdal/Filters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,21 @@
#include <pdal/filters/Cache.hpp>
#include <pdal/filters/Chipper.hpp>
#include <pdal/filters/Color.hpp>
#ifdef PDAL_HAVE_GDAL
#include <pdal/filters/Colorization.hpp>
#endif
#include <pdal/filters/Crop.hpp>
#include <pdal/filters/Decimation.hpp>
#include <pdal/filters/HexBin.hpp>
#include <pdal/filters/InPlaceReprojection.hpp>
#include <pdal/filters/Mosaic.hpp>
#ifdef PDAL_HAVE_PCL
#include <pdal/filters/PCLBlock.hpp>
#endif
#ifdef PDAL_HAVE_PYTHON
#include <pdal/filters/Predicate.hpp>
#include <pdal/filters/Programmable.hpp>
#endif
#include <pdal/filters/Reprojection.hpp>
#include <pdal/filters/Scaling.hpp>
#include <pdal/filters/Selector.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/pdal/PointBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <boost/interprocess/managed_shared_memory.hpp>

#include <pdal/pdal_internal.hpp>
#include <pdal/pdal_macros.hpp>
#include <pdal/Bounds.hpp>
#include <pdal/PointContext.hpp>
#include <pdal/Schema.hpp>
Expand Down
2 changes: 2 additions & 0 deletions include/pdal/drivers/bpf/BpfSeqIterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ class BpfSeqIterator : public ReaderSequentialIterator

private:
size_t readBlock(std::vector<char>& outBuf, size_t index);
#ifdef PDAL_HAVE_ZLIB
int inflate(char *inbuf, size_t insize, char *outbuf, size_t outsize);
#endif
void seekPointMajor(uint32_t ptIdx);
void seekDimMajor(size_t dimIdx, uint32_t ptIdx);
void seekByteMajor(size_t dimIdx, size_t byteIdx, uint32_t ptIdx);
Expand Down
4 changes: 0 additions & 4 deletions include/pdal/filters/Colorization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,7 @@ class PDAL_DLL Colorization : public pdal::FilterSequentialIterator
boost::array<double, 6> m_forward_transform;
boost::array<double, 6> m_inverse_transform;

#ifdef PDAL_HAVE_GDAL
GDALDatasetH m_ds;
#else
void* m_ds;
#endif

};

Expand Down
2 changes: 2 additions & 0 deletions include/pdal/kernel/Kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
#include "Support.hpp"

#include "Info.hpp"
#ifdef PDAL_HAVE_PCL
#include "PCL.hpp"
#endif
#include "Pipeline.hpp"
#include "Delta.hpp"
#include "Translate.hpp"
Expand Down
Loading

0 comments on commit 1a85304

Please sign in to comment.