From a2cf0bec5ebf1b07021f7933364b1234f094834e Mon Sep 17 00:00:00 2001 From: Antoine Lavenant Date: Fri, 17 May 2024 15:16:25 +0200 Subject: [PATCH] fix : name, orthograph, ... --- doc/{grid_radius_assign.md => radius_assign.md} | 4 ++-- macro/macro.py | 2 +- ...d_decimationFilter.cpp => GridDecimationFilter.cpp} | 8 ++++---- ...d_decimationFilter.hpp => GridDecimationFilter.hpp} | 2 +- ...{radius_assignFilter.cpp => RadiusAssignFilter.cpp} | 10 +++++----- ...{radius_assignFilter.hpp => RadiusAssignFilter.hpp} | 2 +- test/test_grid_decimation.py | 2 +- test/test_radius_assign.py | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) rename doc/{grid_radius_assign.md => radius_assign.md} (81%) rename src/filter_grid_decimation/{grid_decimationFilter.cpp => GridDecimationFilter.cpp} (96%) rename src/filter_grid_decimation/{grid_decimationFilter.hpp => GridDecimationFilter.hpp} (95%) rename src/filter_radius_assign/{radius_assignFilter.cpp => RadiusAssignFilter.cpp} (85%) rename src/filter_radius_assign/{radius_assignFilter.hpp => RadiusAssignFilter.hpp} (96%) diff --git a/doc/grid_radius_assign.md b/doc/radius_assign.md similarity index 81% rename from doc/grid_radius_assign.md rename to doc/radius_assign.md index 3812175..521cd40 100755 --- a/doc/grid_radius_assign.md +++ b/doc/radius_assign.md @@ -46,7 +46,7 @@ Options **is3d**: Search in 3d (as a ball). [Default: false] -**is2d_above**: If is3d is false, take points only if exists points between the referent point and a distance above. [Default: 0.] +**is2d_above**: If search in 2d : upward maximum distance in Z for potential neighbors (corresponds to a search in a cylinder with a height = is2d_above above the source point). Default (0) = infinite height [Default: 0.] -**is2d_bellow**: If is3d is false, take points only if exists points between the referent point and a distance bellow. [Default: 0.] +**is2d_below**: If search in 2d : upward maximum distance in Z for potential neighbors (corresponds to a search in a cylinder with a height = is2d_below below the source point). Default (0) = infinite height [Default: 0.] diff --git a/macro/macro.py b/macro/macro.py index f4f5b5f..db638fd 100755 --- a/macro/macro.py +++ b/macro/macro.py @@ -35,7 +35,7 @@ def add_grid_decimation(pipeline, grid_resolution, output_type, condition, condi """ pipeline |= pdal.Filter.ferry(dimensions=f"=>grid,") pipeline |= pdal.Filter.assign(value="grid = 0") - pipeline |= pdal.Filter.grid_decimation(resolution=grid_resolution, output_name_attribut="grid", + pipeline |= pdal.Filter.grid_decimation(resolution=grid_resolution, output_name_attribute="grid", output_type=output_type, where=condition) pipeline |= pdal.Filter.assign(value=condition_out,where=f"grid==0 && ({condition})") return pipeline diff --git a/src/filter_grid_decimation/grid_decimationFilter.cpp b/src/filter_grid_decimation/GridDecimationFilter.cpp similarity index 96% rename from src/filter_grid_decimation/grid_decimationFilter.cpp rename to src/filter_grid_decimation/GridDecimationFilter.cpp index bc771f4..1ece7c0 100755 --- a/src/filter_grid_decimation/grid_decimationFilter.cpp +++ b/src/filter_grid_decimation/GridDecimationFilter.cpp @@ -5,7 +5,7 @@ * ****************************************************************************/ -#include "grid_decimationFilter.hpp" +#include "GridDecimationFilter.hpp" #include #include @@ -39,7 +39,7 @@ void GridDecimationFilter::addArgs(ProgramArgs& args) { args.add("resolution", "Cell edge size, in units of X/Y",m_args->m_edgeLength, 1.); args.add("output_type", "Point keept into the cells ('min', 'max')", m_args->m_methodKeep, "max" ); - args.add("output_name_attribut", "Name of the added attribut", m_args->m_nameAddAttribut, "grid" ); + args.add("output_name_attribute", "Name of the added attribut", m_args->m_nameAddAttribute, "grid" ); args.add("output_wkt", "Export the grid as wkt", m_args->m_nameWktgrid, "" ); } @@ -61,7 +61,7 @@ void GridDecimationFilter::ready(PointTableRef table) if (m_args->m_methodKeep != "max" && m_args->m_methodKeep != "min") throwError("The output_type must be 'max' or 'min'."); - if (m_args->m_nameAddAttribut.empty()) + if (m_args->m_nameAddAttribute.empty()) throwError("The output_name_attribut must be given."); if (!m_args->m_nameWktgrid.empty()) @@ -70,7 +70,7 @@ void GridDecimationFilter::ready(PointTableRef table) void GridDecimationFilter::addDimensions(PointLayoutPtr layout) { - m_args->m_dim = layout->registerOrAssignDim(m_args->m_nameAddAttribut, + m_args->m_dim = layout->registerOrAssignDim(m_args->m_nameAddAttribute, Dimension::Type::Double); } diff --git a/src/filter_grid_decimation/grid_decimationFilter.hpp b/src/filter_grid_decimation/GridDecimationFilter.hpp similarity index 95% rename from src/filter_grid_decimation/grid_decimationFilter.hpp rename to src/filter_grid_decimation/GridDecimationFilter.hpp index 781d8eb..fb5e810 100755 --- a/src/filter_grid_decimation/grid_decimationFilter.hpp +++ b/src/filter_grid_decimation/GridDecimationFilter.hpp @@ -32,7 +32,7 @@ class PDAL_DLL GridDecimationFilter : public Filter { std::string m_methodKeep; // type of output (min, max) double m_edgeLength; // lenght of grid - std::string m_nameAddAttribut; // name of the new attribut + std::string m_nameAddAttribute; // name of the new attribut std::string m_nameWktgrid; // export wkt grid Dimension::Id m_dim; }; diff --git a/src/filter_radius_assign/radius_assignFilter.cpp b/src/filter_radius_assign/RadiusAssignFilter.cpp similarity index 85% rename from src/filter_radius_assign/radius_assignFilter.cpp rename to src/filter_radius_assign/RadiusAssignFilter.cpp index 298f3b1..be4e72b 100644 --- a/src/filter_radius_assign/radius_assignFilter.cpp +++ b/src/filter_radius_assign/RadiusAssignFilter.cpp @@ -1,4 +1,4 @@ -#include "radius_assignFilter.hpp" +#include "RadiusAssignFilter.hpp" #include #include @@ -37,8 +37,8 @@ void RadiusAssignFilter::addArgs(ProgramArgs& args) args.add("radius", "Distance of neighbors to consult", m_args->m_radius, 1.); args.add("output_dimension", "Name of the added attribut", m_args->m_outputDimension, "radius"); args.add("is3d", "Search in 3d", m_args->search3d, false ); - args.add("is2d_above", "if search in 2d : filter point above the distance", m_args->m_search_bellow, 0.); - args.add("is2d_bellow", "if search in 2d : filter point bellow the distance", m_args->m_search_above, 0.); + args.add("is2d_above", "if search in 2d : upward maximum distance in Z for potential neighbors (corresponds to a search in a cylinder with a height = is2d_above above the source point). Default (0) = infinite height", m_args->m_search_above, 0.); + args.add("is2d_below", "if search in 2d : upward maximum distance in Z for potential neighbors (corresponds to a search in a cylinder with a height = is2d_below below the source point). Default (0) = infinite height", m_args->m_search_below, 0.); } void RadiusAssignFilter::addDimensions(PointLayoutPtr layout) @@ -81,13 +81,13 @@ void RadiusAssignFilter::doOneNoDomain(PointRef &point) if (!m_args->search3d) { double Zref = point.getFieldAs(Dimension::Id::Z); - if (m_args->m_search_bellow>0 || m_args->m_search_above>0) + if (m_args->m_search_below>0 || m_args->m_search_above>0) { bool take (false); for (PointId ptId : iNeighbors) { double Zpt = refView->point(ptId).getFieldAs(Dimension::Id::Z); - if (m_args->m_search_bellow>0 && Zpt>Zref && (Zpt-Zref)<=m_args->m_search_bellow) {take=true; break;} + if (m_args->m_search_below>0 && Zpt>Zref && (Zpt-Zref)<=m_args->m_search_below) {take=true; break;} if (m_args->m_search_above>0 && Zptm_search_above) {take=true; break;} } if (!take) return; diff --git a/src/filter_radius_assign/radius_assignFilter.hpp b/src/filter_radius_assign/RadiusAssignFilter.hpp similarity index 96% rename from src/filter_radius_assign/radius_assignFilter.hpp rename to src/filter_radius_assign/RadiusAssignFilter.hpp index 18bf817..3581e34 100644 --- a/src/filter_radius_assign/radius_assignFilter.hpp +++ b/src/filter_radius_assign/RadiusAssignFilter.hpp @@ -32,7 +32,7 @@ class PDAL_DLL RadiusAssignFilter : public Filter Dimension::Id m_dim; bool search3d; Dimension::Id m_dim_ref, m_dim_src; - double m_search_bellow, m_search_above; + double m_search_below, m_search_above; }; std::unique_ptr m_args; PointViewPtr refView; diff --git a/test/test_grid_decimation.py b/test/test_grid_decimation.py index 159d38a..324afba 100755 --- a/test/test_grid_decimation.py +++ b/test/test_grid_decimation.py @@ -31,7 +31,7 @@ def run_filter(type): "type": filter, "resolution": resolution, "output_type": type, - "output_name_attribut": "grid", + "output_name_attribute": "grid", "output_wkt": tmp_out_wkt, }, { diff --git a/test/test_radius_assign.py b/test/test_radius_assign.py index 33673e8..4d9b351 100755 --- a/test/test_radius_assign.py +++ b/test/test_radius_assign.py @@ -54,7 +54,7 @@ def run_filter(arrays_las, distance_radius, search_3d, distance_cylinder=0. ): "output_dimension": "radius_search", "is3d": search_3d, "is2d_above": distance_cylinder, - "is2d_bellow": distance_cylinder, + "is2d_below": distance_cylinder, } ]