diff --git a/.gitignore b/.gitignore index 62169b6619..1f7e0f4639 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,13 @@ ipch/ *.suo *.opensdf *.sln.docstates +*.ilk +*.exe +*.lib +*.pdb +*.exp +*.dll +*.manifest # # intellij, clion diff --git a/cmake/examples/hobu-config.sh b/cmake/examples/hobu-config.sh index 467a3297ad..19b8e9d0d9 100755 --- a/cmake/examples/hobu-config.sh +++ b/cmake/examples/hobu-config.sh @@ -16,7 +16,7 @@ MATLAB_HOME=/Applications/MATLAB_R2017b.app export GDAL_HOME=/usr/local/opt/gdal2 CONFIG="Unix Makefiles" -#CONFIG="Ninja" /usr/local/Cellar/hdf5/1.8.16_1/ +CONFIG="Ninja" if ! [ -z "$1" ]; then CONFIG="$1" diff --git a/doc/references.rst b/doc/references.rst index 2f3394704c..b03a239407 100644 --- a/doc/references.rst +++ b/doc/references.rst @@ -7,14 +7,22 @@ References .. index:: References +.. [Alexa2003] Alexa, Marc, et al. "Computing and rendering point set surfaces." Visualization and Computer Graphics, IEEE Transactions on 9.1 (2003): 3-15. + .. [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. +.. [Kazhdan2006] Kazhdan, Michael, Matthew Bolitho, and Hugues Hoppe. "Poisson surface reconstruction." Proceedings of the fourth Eurographics symposium on Geometry processing. Vol. 7. 2006. + +.. [Li2010] Li, Ruosi, et al. "Polygonizing extremal surfaces with manifold guarantees." Proceedings of the 14th ACM Symposium on Solid and Physical Modeling. ACM, 2010. + .. [Mesh2009] ALoopingIcon. "Meshing Point Clouds." *MESHLAB STUFF*. n.p., 7 Sept. 2009. Web. 13 Nov. 2015. +.. [Mongus2012] Mongus, D., Zalik, B., 2012. Parameter-free ground filtering of LiDAR data for automatic DTM generation. ISPRS J. Photogramm. Remote Sens. 67, 1–12. + .. [Pingel2013] Pingel, Thomas J., Keith C. Clarke, and William A. McBride. “An Improved Simple Morphological Filter for the Terrain Classification of Airborne LIDAR Data.” ISPRS Journal of Photogrammetry and Remote Sensing 77 (2013): 21–30. .. [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. diff --git a/doc/stages/filters.gridprojection.rst b/doc/stages/filters.gridprojection.rst index 3489fabba0..8fd88e58f8 100644 --- a/doc/stages/filters.gridprojection.rst +++ b/doc/stages/filters.gridprojection.rst @@ -10,8 +10,6 @@ GridProjection algorithm. GridProjection is an implementation of the surface reconstruction method described in [Li2010]_. -.. [Li2010] Li, Ruosi, et al. "Polygonizing extremal surfaces with manifold guarantees." Proceedings of the 14th ACM Symposium on Solid and Physical Modeling. ACM, 2010. - .. _`PCL`: http://www.pointclouds.org .. plugin:: diff --git a/doc/stages/filters.mongus.rst b/doc/stages/filters.mongus.rst index ae38bc45ed..3fc5ff552c 100644 --- a/doc/stages/filters.mongus.rst +++ b/doc/stages/filters.mongus.rst @@ -23,8 +23,6 @@ Some warts about the current implementation: * We require specification of a max level, whereas the original paper automatically determined an appropriate max level. -.. [Mongus2012] Mongus, D., Zalik, B., 2012. Parameter-free ground filtering of LiDAR data for automatic DTM generation. ISPRS J. Photogramm. Remote Sens. 67, 1–12. - .. embed:: Example diff --git a/doc/stages/filters.movingleastsquares.rst b/doc/stages/filters.movingleastsquares.rst index 0b94f2855c..29739da60d 100644 --- a/doc/stages/filters.movingleastsquares.rst +++ b/doc/stages/filters.movingleastsquares.rst @@ -12,8 +12,6 @@ algorithm for data smoothing and improved normal estimation described in [Alexa2003]_. It also contains methods for upsampling the resulting cloud based on the parametric fit. -.. [Alexa2003] Alexa, Marc, et al. "Computing and rendering point set surfaces." Visualization and Computer Graphics, IEEE Transactions on 9.1 (2003): 3-15. - .. _`PCL`: http://www.pointclouds.org .. plugin:: diff --git a/doc/stages/filters.poisson.rst b/doc/stages/filters.poisson.rst index cb166b6cce..c4f5c418b8 100644 --- a/doc/stages/filters.poisson.rst +++ b/doc/stages/filters.poisson.rst @@ -19,8 +19,6 @@ 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. - 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. @@ -70,4 +68,3 @@ depth Maximum depth of the tree used for reconstruction. The output is sentsitve to this parameter. Increase if the results appear unsatisfactory. [Default: **8**] - diff --git a/doc/stages/filters.rst b/doc/stages/filters.rst index 0bc482b48c..23740efca7 100644 --- a/doc/stages/filters.rst +++ b/doc/stages/filters.rst @@ -3,14 +3,377 @@ Filters ======= -Filters operate on data as inline operations. They can remove, modify, reorganize, -and add points to the data stream as it goes by. Some filters can only operate on -dimensions they understand (consider :ref:`filters.reprojection` doing geographic -reprojection on XYZ coordinates), while others do not interrogate the point data at -all and simply reorganize or split data. +Filters operate on data as inline operations. They can remove, modify, +reorganize, and add points to the data stream as it goes by. Some filters can +only operate on dimensions they understand (consider :ref:`filters.reprojection` +doing geographic reprojection on XYZ coordinates), while others do not +interrogate the point data at all and simply reorganize or split data. + +Create +------ + +PDAL filters commonly create new dimensions (e.g., ``HeightAboveGround``) or +alter existing ones (e.g., ``Classification``). These filters will not +invalidate an existing KD-tree. + +.. note:: + + We treat those filters that alter XYZ coordinates separately. + +.. note:: + + When creating new dimensions, be mindful of the writer you are using and + whether or not the custom dimension can be written to disk if that is the + desired behavior. .. toctree:: :maxdepth: 1 :glob: + :hidden: + + filters.approximatecoplanar + filters.assign + filters.cluster + filters.colorinterp + filters.colorization + filters.eigenvalues + filters.estimaterank + filters.elm + filters.ferry + filters.hag + filters.kdistance + filters.lof + filters.mongus + filters.neighborclassifier + filters.normal + filters.outlier + filters.overlay + filters.pmf + filters.radialdensity + filters.smrf + +:ref:`filters.approximatecoplanar` + Estimate pointwise planarity, based on k-nearest neighbors. Returns a new + dimension ``Coplanar`` where a value of 1 indicates that a point is part of + a coplanar neighborhood (0 otherwise). + +:ref:`filters.assign` + Assign values for a dimension range to a specified value. + +:ref:`filters.cluster` + Extract and label clusters using Euclidean distance metric. Returns a new + dimension ``ClusterID`` that indicates the cluster that a point belongs + to. Points not belonging to a cluster are given a cluster ID of 0. + +:ref:`filters.colorinterp` + Assign RGB colors based on a dimension and a ramp + +:ref:`filters.colorization` + Fetch and assign RGB color information from a GDAL-readable datasource. + +:ref:`filters.eigenvalues` + Compute pointwise eigenvalues, based on k-nearest neighbors. + +:ref:`filters.estimaterank` + Compute pointwise rank, based on k-nearest neighbors. + +:ref:`filters.elm` + Marks low points as noise. + +:ref:`filters.ferry` + Copy data from one dimension to another. + +:ref:`filters.hag` + Compute pointwise height above ground estimate. Requires points to be + classified as ground/non-ground prior to estimating. + +:ref:`filters.kdistance` + Compute pointwise K-Distance (the Euclidean distance to a point's k-th + nearest neighbor). + +:ref:`filters.lof` + Compute pointwise Local Outlier Factor (along with K-Distance and Local + Reachability Distance). + +:ref:`filters.mongus` + Label ground/non-ground returns using [Mongus2012]_. + +:ref:`filters.neighborclassifier` + Update pointwise classification using k-nearest neighbor consensus voting. + +:ref:`filters.normal` + Compute pointwise normal and curvature, based on k-nearest neighbors. + +:ref:`filters.outlier` + Label noise points using either a statistical or radius outlier detection. + +:ref:`filters.overlay` + Assign values to a dimension based on the extent of an OGR-readable data + source or an OGR SQL query. + +:ref:`filters.pmf` + Label ground/non-ground returns using [Zhang2003]_. + +:ref:`filters.radialdensity` + Compute pointwise density of points within a given radius. + +:ref:`filters.smrf` + Label ground/non-ground returns using [Pingel2013]_. + +Order +----- + +There are currently three PDAL filters that can be used to reorder points. These +filters will invalidate an existing KD-tree. + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + filters.mortonorder + filters.randomize + filters.sort + +:ref:`filters.mortonorder` + Sort XY data using Morton ordering (aka Z-order/Z-curve). + +:ref:`filters.randomize` + Randomize points in a view. + +:ref:`filters.sort` + Sort data based on a given dimension. + +Move +---- + +PDAL filters that move XYZ coordinates will invalidate an existing KD-tree. + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + filters.cpd + filters.icp + filters.reprojection + filters.transformation + +:ref:`filters.cpd` + Compute and apply transformation between two point clouds using the + Coherent Point Drift algorithm. + +:ref:`filters.icp` + Compute and apply transformation between two point clouds using the + Iterative Closest Point algorithm. + +:ref:`filters.reprojection` + Reproject data using GDAL from one coordinate system to another. + +:ref:`filters.transformation` + Transform each point using a 4x4 transformation matrix. + +Cull +---- + +Some PDAL filters will cull points, returning a point cloud that is smaller than +the input. These filters will invalidate an existing KD-tree. + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + filters.crop + filters.decimation + filters.head + filters.iqr + filters.locate + filters.mad + filters.range + filters.sample + filters.tail + filters.voxelcenternearestneighbor + filters.voxelcentroidnearestneighbor + +:ref:`filters.crop` + Filter points inside or outside a bounding box or a polygon + +:ref:`filters.decimation` + Keep every Nth point. + +:ref:`filters.head` + Return N points from beginning of the point cloud. + +:ref:`filters.iqr` + Cull points falling outside the computed Interquartile Range for a given + dimension. + +:ref:`filters.locate` + Return a single point with min/max value in the named dimension. + +:ref:`filters.mad` + Cull points falling outside the computed Median Absolute Deviation for a + given dimension. + +:ref:`filters.range` + Pass only points given a dimension/range. + +:ref:`filters.sample` + Perform Poisson sampling and return only a subset of the input points. + +:ref:`filters.tail` + Return N points from end of the point cloud. + +:ref:`filters.voxelcenternearestneighbor` + Return the point within each voxel that is nearest the voxel center. + +:ref:`filters.voxelcentroidnearestneighbor` + Return the point within each voxel that is nearest the voxel centroid. + +New +--- + +PDAL filters can be used to split the incoming point cloud into subsets. These +filters will invalidate an existing KD-tree. + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + filters.chipper + filters.divider + filters.groupby + filters.returns + filters.splitter + +:ref:`filters.chipper` + Organize points into spatially contiguous, squarish, and non-overlapping + chips. + +:ref:`filters.divider` + Divide points into approximately equal sized groups based on a simple + scheme. + +:ref:`filters.groupby` + Split data categorically by dimension. + +:ref:`filters.returns` + Split data by return order (e.g., 'first', 'last', 'intermediate', 'only'). + +:ref:`filters.splitter` + Split data based on a X/Y box length. + +Join +---- + +Multiple point clouds can be joined to form a single point cloud. These filters +will invalidate an existing KD-tree. + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + filters.merge + +:ref:`filters.merge` + Merge data from two different readers into a single stream. + +Metadata +-------- + +PDAL filters can be used to create new metadata. These filters will not +invalidate an existing KD-tree. + +.. note:: + + :ref:`filters.cpd` and :ref:`filters.icp` can optionally create metadata as + well, inserting the computed transformation matrix. + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + filters.hexbin + filters.stats + +:ref:`filters.hexbin` + Tessellate XY domain and determine point density and/or point boundary. + +:ref:`filters.stats` + Compute statistics about each dimension (mean, min, max, etc.). + +Mesh +---- + +Meshes can be computed from point clouds. These filters will invalidate an +existing KD-tree. + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + filters.greedyprojection + filters.gridprojection + filters.movingleastsquares + filters.poisson + +:ref:`filters.greedyprojection` + Create mesh using the Greedy Projection Triangulation approach. + +:ref:`filters.gridprojection` + Create mesh using the Grid Projection approach [Li2010]_. + +:ref:`filters.movingleastsquares` + Data smoothing and normal estimation using the approach of [Alexa2003]_. + +:ref:`filters.poisson` + Create mesh using the Poisson surface reconstruction algorithm + [Kazhdan2006]_. + +Languages +--------- + +PDAL has two filters than can be used to pass point clouds to other languages. +These filters will invalidate an existing KD-tree. + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + filters.matlab + filters.pclblock + filters.python + +:ref:`filters.matlab` + Embed MATLAB software in a pipeline. + +:ref:`filters.pclblock` + Embed select PCL filters in a pipeline. + +:ref:`filters.python` + Embed Python software in a pipeline. + +Other +----- + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + filters.streamcallback + filters.voxelgrid + +:ref:`filters.streamcallback` + Provide a hook for a simple point-by-point callback. - filters.* +:ref:`filters.voxelgrid` + Create a new point cloud composed of voxel centroids computed from the + input point cloud. All incoming dimension data (e.g., intensity, RGB) will + be lost. diff --git a/doc/stages/readers.numpy.rst b/doc/stages/readers.numpy.rst new file mode 100644 index 0000000000..868de49532 --- /dev/null +++ b/doc/stages/readers.numpy.rst @@ -0,0 +1,167 @@ +.. _readers.numpy: + +readers.numpy +================================================================================ + +PDAL has support for processing data using :ref:`filters.python`, but it is also +convenient to read data from `Numpy`_ for processing in PDAL. + +`Numpy`_ supports saving files with the ``save`` method, usually with the +extension ``.npy``. As of PDAL 1.7.0, ``.npz`` files were not yet supported. + +.. warning:: + + It is untested whether the version of Python PDAL was linked against and + the version that saved the ``.npy`` files can be mixed. + +Array Types +-------------------------------------------------------------------------------- + +:ref:`readers.numpy` supports reading data in two forms: + +* Arrays as named fields all of the same shape (from `laspy`_ for example) +* 2-dimensional arrays + + +Named Field Arrays +................................................................................ + +`laspy`_ provides its ``.points`` Numpy array as a bunch of named fields: + +:: + + import laspy + f = laspy.file.File('test/data/autzen/autzen.las') + print (f.points[0:1]) + +:: + + array([ ((63608330, 84939865, 40735, 65, 73, 1, -11, 126, 7326, 245385.60820904),)], + dtype=[('point', [('X', '` + +y + Dimension number (starting from 0) to map to the ``Y`` PDAL :ref:`dimension ` + +z + Dimension number (starting from 0) to map to the ``Z`` PDAL :ref:`dimension ` + +assign_z + A single value to override for ``Z`` values when ``dimension`` is used to assign the + Numpy values to another dimension + +.. _formatted: http://en.cppreference.com/w/cpp/string/basic_string/stof diff --git a/doc/stages/readers.rst b/doc/stages/readers.rst index e064b32a4b..556b018b81 100644 --- a/doc/stages/readers.rst +++ b/doc/stages/readers.rst @@ -14,6 +14,121 @@ like :ref:`readers.oci`, or a network service like :ref:`readers.greyhound`. .. toctree:: :maxdepth: 1 :glob: + :hidden: - readers.* + readers.bpf + readers.buffer + readers.faux + readers.gdal + readers.geowave + readers.greyhound + readers.ilvis2 + readers.las + readers.matlab + readers.mbio + readers.mrsid + readers.nitf + readers.numpy + readers.oci + readers.optech + readers.pcd + readers.pgpointcloud + readers.ply + readers.pts + readers.qfit + readers.rxp + readers.sbet + readers.sqlite + readers.terrasolid + readers.text + readers.tindex +:ref:`readers.bpf` + Read BPF files encoded as version 1, 2, or 3. BPF is an NGA specification + for point cloud data. + +:ref:`readers.buffer` + Special stage that allows you to read data from your own PointView rather + than fetching data from a specific reader. + +:ref:`readers.faux` + Used for testing pipelines. It does not read from a file or database, but + generates synthetic data to feed into the pipeline. + +:ref:`readers.gdal` + Read GDAL readable raster data sources as point clouds. + +:ref:`readers.geowave` + Read point cloud data from Accumulo. + +:ref:`readers.greyhound` + Query point cloud data from a Greyhound server. + +:ref:`readers.ilvis2` + Read from files in the ILVIS2 format. + +:ref:`readers.las` + Read ASPRS LAS versions 1.0 - 1.4. Does not support point formats + containing waveform data. LASzip support is also enabled through this + driver if LASzip or LAZperf are found during compilation. + +:ref:`readers.matlab` + Read point cloud data from MATLAB .mat files where dimensions are stored as + arrays in a MATLAB struct. + +:ref:`readers.mbio` + Read sonar bathymetry data from formats supported by the MB-System library. + +:ref:`readers.mrsid` + Read data compressed by the MrSID 4.0 LiDAR Compressor. Requires the + LizardTech Lidar_DSDK. + +:ref:`readers.nitf` + Read point cloud data (LAS or LAZ) wrapped in NITF 2.1 files. + +:ref:`readers.numpy` + Read point cloud data from Numpy ``.npy`` files. + +:ref:`readers.oci` + Read data from Oracle point cloud databases. + +:ref:`readers.optech` + Read Optech Corrected Sensor Data (.csd) files. + +:ref:`readers.pcd` + Read files in the PCD format. + +:ref:`readers.pgpointcloud` + Read point cloud data from a PostgreSQL database with the PostgreSQL + Pointcloud extension enabled. + +:ref:`readers.ply` + Read points and vertices from either ASCII or binary PLY files. + +:ref:`readers.pts` + Read data from Leica Cyclone PTS files. + +:ref:`readers.qfit` + Read data in the QFIT format originated for NASA's Airborne Topographic + Mapper project. + +:ref:`readers.rxp` + Read data in the RXP format, the in-house streaming format used by RIEGL. + The reader requires a copy of RiVLib during compilation. + +:ref:`readers.sbet` + Read the SBET format. + +:ref:`readers.sqlite` + Read data stored in a SQLite database. + +:ref:`readers.terrasolid` + TerraSolid Reader + +:ref:`readers.text` + Read point clouds from ASCII text files. + +:ref:`readers.tindex` + The tindex (tile index) reader allows you to automatically merge and query + data described in tile index files that have been generated using the PDAL + tindex command. diff --git a/doc/stages/writers.bpf.rst b/doc/stages/writers.bpf.rst index 641d1fd955..d6e0804acc 100644 --- a/doc/stages/writers.bpf.rst +++ b/doc/stages/writers.bpf.rst @@ -34,7 +34,7 @@ Options ------- filename - BPF file to read. The writer will accept a filename containing + BPF file to write. The writer will accept a filename containing a single placeholder character ('#'). If input to the writer consists of multiple PointViews, each will be written to a separate file, where the placeholder will be replaced with an incrementing integer. If no diff --git a/doc/stages/writers.rst b/doc/stages/writers.rst index e52bc5d7b3..1b6bdcd2bc 100644 --- a/doc/stages/writers.rst +++ b/doc/stages/writers.rst @@ -14,6 +14,76 @@ dimension type, while others only understand fixed dimension names. .. toctree:: :maxdepth: 1 :glob: + :hidden: - writers.* + writers.bpf + writers.gdal + writers.geowave + writers.greyhound + writers.las + writers.matlab + writers.nitf + writers.null + writers.oci + writers.ogr + writers.pcd + writers.pgpointcloud + writers.ply + writers.sbet + writers.sqlite + writers.text +:ref:`writers.bpf` + Write BPF version 3 files. BPF is an NGA specification for point cloud data. + +:ref:`writers.gdal` + Create a raster from a point cloud using an interpolation algorithm. + +:ref:`writers.geowave` + Write point cloud data to Accumulo. + +:ref:`writers.greyhound` + Append new dimensions (or update existing dimensions) onto a Greyhound + resource. Must be used along with a Greyhound reader, and intermediate + filters that cull points are not allowed. + +:ref:`writers.las` + Write ASPRS LAS versions 1.0 - 1.4 formatted data. LAZ support is also + available if enabled at compile-time. Note that LAZ does not provide LAS + 1.4 support at this time. + +:ref:`writers.matlab` + Write MATLAB .mat files. The output has a single array struct. + +:ref:`writers.nitf` + Write LAS and LAZ point cloud data, wrapped in a NITF 2.1 file. + +:ref:`writers.null` + Provides a sink for points in a pipeline. It's the same as sending pipeline + output to /dev/null. + +:ref:`writers.oci` + Write data to Oracle point cloud databases. + +:ref:`writers.ogr` + Write a point cloud as a set of OGR points/multipoints + +:ref:`writers.pcd` + Write PCD-formatted files in the ASCII, binary, or compressed format. + +:ref:`writers.pgpointcloud` + Write to a PostgreSQL database that has the PostgreSQL Pointcloud extension + enabled. + +:ref:`writers.ply` + Write points as PLY vertices. Can also emit a mesh as a set of faces. + +:ref:`writers.sbet` + Write data in the SBET format. + +:ref:`writers.sqlite` + Write point cloud data in a scheme that matches the approach used in the + PostgreSQL Pointcloud and OCI readers. + +:ref:`writers.text` + Write points in a text file. GeoJSON and CSV formats are supported. diff --git a/doc/stages/writers.sbet.rst b/doc/stages/writers.sbet.rst new file mode 100644 index 0000000000..370ffc0d2a --- /dev/null +++ b/doc/stages/writers.sbet.rst @@ -0,0 +1,30 @@ +.. _writers.sbet: + +writers.sbet +============ + +The **SBET writer** writes files in the SBET format, used for exchange data from interital measurement units (IMUs). + +.. embed:: + +.. streamable:: + +Example +------- + + +.. code-block:: json + + { + "pipeline":[ + "input.sbet", + "output.sbet" + ] + } + + +Options +------- + +filename + File to write. [Required] diff --git a/filters/ApproximateCoplanarFilter.cpp b/filters/ApproximateCoplanarFilter.cpp index 5b3a6670da..fc7cb4e095 100644 --- a/filters/ApproximateCoplanarFilter.cpp +++ b/filters/ApproximateCoplanarFilter.cpp @@ -49,7 +49,7 @@ namespace pdal static StaticPluginInfo const s_info { "filters.approximatecoplanar", - "ApproximateCoplanar Filter", + "Estimates the planarity of a neighborhood of points using eigenvalues.", "http://pdal.io/stages/filters.approximatecoplanar.html" }; diff --git a/filters/AssignFilter.cpp b/filters/AssignFilter.cpp index fcc876f876..24e790d11d 100644 --- a/filters/AssignFilter.cpp +++ b/filters/AssignFilter.cpp @@ -45,7 +45,7 @@ namespace pdal static StaticPluginInfo const s_info { "filters.assign", - "Assign values for a dimension using a specified value.", + "Assign values for a dimension range to a specified value.", "http://pdal.io/stages/filters.assign.html" }; @@ -160,4 +160,3 @@ void AssignFilter::filter(PointView& view) } } // namespace pdal - diff --git a/filters/ClusterFilter.cpp b/filters/ClusterFilter.cpp index 849aa531b2..8769eba419 100644 --- a/filters/ClusterFilter.cpp +++ b/filters/ClusterFilter.cpp @@ -44,7 +44,7 @@ namespace pdal static StaticPluginInfo const s_info { "filters.cluster", - "Label clusters", + "Extract and label clusters using Euclidean distance.", "http://pdal.io/stages/filters.cluster.html" }; diff --git a/filters/ELMFilter.cpp b/filters/ELMFilter.cpp index 8f715787b6..e0ed3df321 100644 --- a/filters/ELMFilter.cpp +++ b/filters/ELMFilter.cpp @@ -48,7 +48,7 @@ namespace pdal static StaticPluginInfo const s_info { "filters.elm", - "Extended Local Minimum Filter", + "Marks low points as noise.", "http://pdal.io/stages/filters.elm.html" }; diff --git a/filters/EigenvaluesFilter.cpp b/filters/EigenvaluesFilter.cpp index 4a2ec2820a..791341476b 100644 --- a/filters/EigenvaluesFilter.cpp +++ b/filters/EigenvaluesFilter.cpp @@ -49,7 +49,7 @@ namespace pdal static StaticPluginInfo const s_info { "filters.eigenvalues", - "Eigenvalues Filter", + "Returns the eigenvalues for a given point, based on its k-nearest neighbors.", "http://pdal.io/stages/filters.eigenvalues.html" }; diff --git a/filters/EstimateRankFilter.cpp b/filters/EstimateRankFilter.cpp index eb74bd6f2c..6ba9e134d7 100644 --- a/filters/EstimateRankFilter.cpp +++ b/filters/EstimateRankFilter.cpp @@ -47,7 +47,7 @@ namespace pdal static StaticPluginInfo const s_info { "filters.estimaterank", - "EstimateRank Filter", + "Computes the rank of a neighborhood of points.", "http://pdal.io/stages/filters.estimaterank.html" }; diff --git a/filters/HAGFilter.cpp b/filters/HAGFilter.cpp index 2cee7b7957..577c242037 100644 --- a/filters/HAGFilter.cpp +++ b/filters/HAGFilter.cpp @@ -45,7 +45,7 @@ namespace pdal static StaticPluginInfo const s_info { "filters.hag", - "HAG Filter", + "Computes height above ground using ground-classified returns.", "http://pdal.io/stages/filters.hag.html" }; diff --git a/pdal/StageExtensions.cpp b/pdal/StageExtensions.cpp index aaabda529a..f800522f6f 100644 --- a/pdal/StageExtensions.cpp +++ b/pdal/StageExtensions.cpp @@ -70,6 +70,7 @@ R"PDALEXTENSIONS( "readers.icebridge" : "icebridge h5", "readers.matlab" : "mat", "writers.matlab" : "mat", + "readers.numpy" : "npy", "readers.nitf" : "nitf, nsf, ntf", "writers.nitf" : "nitf, nsf, ntf", "readers.pcd" : "pcd", diff --git a/plugins/python/CMakeLists.txt b/plugins/python/CMakeLists.txt index ac1a1632c6..9d4763ce61 100644 --- a/plugins/python/CMakeLists.txt +++ b/plugins/python/CMakeLists.txt @@ -4,5 +4,32 @@ include(${PDAL_CMAKE_DIR}/python.cmake) + +set(plang_srcs + ./plang/Invocation.cpp + ./plang/Environment.cpp + ./plang/Redirector.cpp + ./plang/Script.cpp +) +set(PDAL_PLANG_LIB_NAME pdal_plang) +PDAL_ADD_LIBRARY(${PDAL_PLANG_LIB_NAME} ${plang_srcs} ) +set_target_properties(${PDAL_PLANG_LIB_NAME} PROPERTIES + VERSION "${PDAL_BUILD_VERSION}" + SOVERSION "${PDAL_API_VERSION}" + CLEAN_DIRECT_OUTPUT 1) +target_link_libraries(${PDAL_PLANG_LIB_NAME} PUBLIC + ${PDAL_BASE_LIB_NAME} + ${PDAL_UTIL_LIB_NAME} + ${PYTHON_LIBRARY}) +target_include_directories(${PDAL_PLANG_LIB_NAME} PRIVATE + ${PYTHON_INCLUDE_DIR} + ${PROJECT_BINARY_DIR}/include) +install(TARGETS ${PLANG_LIB_NAME} + RUNTIME DESTINATION ${PDAL_BIN_INSTALL_DIR} + LIBRARY DESTINATION ${PDAL_LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${PDAL_LIB_INSTALL_DIR}) + + + add_subdirectory(filters) add_subdirectory(io) diff --git a/plugins/python/filters/CMakeLists.txt b/plugins/python/filters/CMakeLists.txt index 42f0e1f766..1eaecf3451 100644 --- a/plugins/python/filters/CMakeLists.txt +++ b/plugins/python/filters/CMakeLists.txt @@ -1,24 +1,19 @@ -set(PLANG ../plang/Invocation.cpp - ../plang/Environment.cpp - ../plang/Redirector.cpp - ../plang/Script.cpp) PDAL_ADD_PLUGIN(python_libname filter python FILES - ${PLANG} PythonFilter.cpp ) target_include_directories(${python_libname} PRIVATE ${PYTHON_INCLUDE_DIR} ${PDAL_JSONCPP_INCLUDE_DIR}) target_link_libraries(${python_libname} PUBLIC - ${PYTHON_LIBRARY} ${CMAKE_DL_LIBS}) + ${PYTHON_LIBRARY} ${CMAKE_DL_LIBS} PRIVATE ${PDAL_PLANG_LIB_NAME}) if (WITH_TESTS) PDAL_ADD_TEST(pdal_filters_python_test - FILES ../test/PythonFilterTest.cpp ${PLANG} + FILES ../test/PythonFilterTest.cpp LINK_WITH ${programmable_libname} ) target_link_libraries(pdal_filters_python_test PUBLIC - ${PYTHON_LIBRARY} ${CMAKE_DL_LIBS}) + ${PYTHON_LIBRARY} ${CMAKE_DL_LIBS} PRIVATE ${PDAL_PLANG_LIB_NAME}) endif() diff --git a/plugins/python/io/NumpyReader.cpp b/plugins/python/io/NumpyReader.cpp index e946486ad5..abe14a33f2 100644 --- a/plugins/python/io/NumpyReader.cpp +++ b/plugins/python/io/NumpyReader.cpp @@ -43,11 +43,13 @@ #include "../plang/Environment.hpp" +/** #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #define NO_IMPORT_ARRAY #define PY_ARRAY_UNIQUE_SYMBOL PDAL_ARRAY_API #include +**/ namespace pdal { diff --git a/plugins/python/plang/Environment.cpp b/plugins/python/plang/Environment.cpp index 01558d910c..936590cb50 100644 --- a/plugins/python/plang/Environment.cpp +++ b/plugins/python/plang/Environment.cpp @@ -47,7 +47,6 @@ #pragma warning(disable: 4127) // conditional expression is constant -#include #include #undef toupper #undef tolower diff --git a/plugins/python/plang/Environment.hpp b/plugins/python/plang/Environment.hpp index dbaa7c8328..fcdd001943 100644 --- a/plugins/python/plang/Environment.hpp +++ b/plugins/python/plang/Environment.hpp @@ -38,11 +38,16 @@ // forward declare PyObject so we don't need the python headers everywhere // see: http://mail.python.org/pipermail/python-dev/2003-August/037601.html +/** #ifndef PyObject_HEAD struct _object; typedef _object PyObject; #endif - +**/ +#include +#undef toupper +#undef tolower +#undef isspace #include #include @@ -56,10 +61,10 @@ namespace pdal namespace plang { -PyObject *fromMetadata(MetadataNode m); -void addMetadata(PyObject *list, MetadataNode m); +PDAL_DLL PyObject *fromMetadata(MetadataNode m); +PDAL_DLL void addMetadata(PyObject *list, MetadataNode m); -std::string getTraceback(); +PDAL_DLL std::string getTraceback(); class Environment; typedef Environment *EnvironmentPtr; diff --git a/plugins/python/plang/Invocation.cpp b/plugins/python/plang/Invocation.cpp index 8aabef60d0..97ddedee35 100644 --- a/plugins/python/plang/Invocation.cpp +++ b/plugins/python/plang/Invocation.cpp @@ -33,20 +33,8 @@ ****************************************************************************/ #include "Invocation.hpp" -#include "Environment.hpp" - -#pragma warning(disable: 4127) // conditional expression is constant -#ifdef _WIN32 -#define HAVE_ROUND // inconsistent dll linkage otherwise -#endif - -#include -#undef toupper -#undef tolower -#undef isspace #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION - #define NO_IMPORT_ARRAY #define PY_ARRAY_UNIQUE_SYMBOL PDAL_ARRAY_API #include diff --git a/plugins/python/plang/Invocation.hpp b/plugins/python/plang/Invocation.hpp index 7bd762f5c1..5858988836 100644 --- a/plugins/python/plang/Invocation.hpp +++ b/plugins/python/plang/Invocation.hpp @@ -42,6 +42,7 @@ #include #include + namespace pdal { namespace plang diff --git a/plugins/python/plang/Redirector.hpp b/plugins/python/plang/Redirector.hpp index 65a6ed6762..92dd0c69f0 100644 --- a/plugins/python/plang/Redirector.hpp +++ b/plugins/python/plang/Redirector.hpp @@ -12,12 +12,7 @@ #include -#ifdef _WIN32 -# pragma warning(disable: 4127) // conditional expression is constant -//#ifndef HAVE_ROUND -//#define HAVE_ROUND // inconsistent dll linkage otherwise -//#endif -#endif +#pragma warning(disable: 4127) // conditional expression is constant #include diff --git a/plugins/python/test/NumpyReaderTest.cpp b/plugins/python/test/NumpyReaderTest.cpp index e632b11c38..4557ed525b 100644 --- a/plugins/python/test/NumpyReaderTest.cpp +++ b/plugins/python/test/NumpyReaderTest.cpp @@ -65,7 +65,8 @@ TEST(NumpyReaderTest, NumpyReaderTest_read_fields) EXPECT_EQ(view->size(), 1065u); EXPECT_EQ(view->layout()->pointSize(), 34u); - EXPECT_EQ(view->getFieldAs(pdal::Dimension::Id::Intensity,800), 49); + EXPECT_EQ(view->getFieldAs(pdal::Dimension::Id::Intensity,800), + 49); EXPECT_EQ(view->getFieldAs(pdal::Dimension::Id::X,400), 63679039); } @@ -90,8 +91,8 @@ TEST(NumpyReaderTest, NumpyReaderTest_read_array) EXPECT_EQ(view->size(), 10000u); EXPECT_EQ(view->layout()->pointSize(), 16u); - EXPECT_EQ(view->getFieldAs(pdal::Dimension::Id::Intensity,5000), 0.5); + EXPECT_EQ(view->getFieldAs(pdal::Dimension::Id::Intensity,5000), + 0.5); EXPECT_EQ(view->getFieldAs(pdal::Dimension::Id::X,5000), 51u); - } diff --git a/plugins/python/test/make-test-data.py b/plugins/python/test/make-test-data.py new file mode 100644 index 0000000000..c3a875bd90 --- /dev/null +++ b/plugins/python/test/make-test-data.py @@ -0,0 +1,10 @@ + +import laspy + +f = laspy.file.File('../../../test/data/las/1.2-with-color.las') + +import numpy +import pdb;pdb.set_trace() +out = open('../../../test/data/plang/1.2-with-color.npy','wb') +numpy.save(out, f.points['point'], allow_pickle=False) +out.close()