From 641dfafd44fff0f056c14d16e07b07d18b827383 Mon Sep 17 00:00:00 2001 From: Antoine Lavenant Date: Fri, 17 May 2024 15:21:55 +0200 Subject: [PATCH] update nom attributes --- doc/grid_decimation.md | 2 +- doc/radius_assign.md | 2 +- macro/macro.py | 2 +- src/filter_grid_decimation/GridDecimationFilter.cpp | 7 +++---- src/filter_grid_decimation/GridDecimationFilter.hpp | 2 +- src/filter_radius_assign/RadiusAssignFilter.cpp | 2 +- test/test_grid_decimation.py | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/grid_decimation.md b/doc/grid_decimation.md index 573a46b..cd2b37f 100755 --- a/doc/grid_decimation.md +++ b/doc/grid_decimation.md @@ -37,6 +37,6 @@ Options **resolution** : The resolution of the cells in meter. [Default: 1.] -**output_name_attribut**: The name of the new attribut. [Default: grid] +**output_dimension**: The name of the new dimension. [Default: grid] **output_wkt**: the name of the export grid file as wkt polygon. If none, no export [Default:""] diff --git a/doc/radius_assign.md b/doc/radius_assign.md index 521cd40..43c8479 100755 --- a/doc/radius_assign.md +++ b/doc/radius_assign.md @@ -42,7 +42,7 @@ Options **update_expression** : A list of :ref:`assignment expressions ` to be applied to the points that satisfy the radius search. The list of values is evaluated in order. -**output_name_attribut**: The name of the new attribute'. [Default: radius] +**output_dimension**: The name of the new dimension'. [Default: radius] **is3d**: Search in 3d (as a ball). [Default: false] diff --git a/macro/macro.py b/macro/macro.py index db638fd..3403f77 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_attribute="grid", + pipeline |= pdal.Filter.grid_decimation(resolution=grid_resolution, output_dimension="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/GridDecimationFilter.cpp b/src/filter_grid_decimation/GridDecimationFilter.cpp index 1ece7c0..0461f6e 100755 --- a/src/filter_grid_decimation/GridDecimationFilter.cpp +++ b/src/filter_grid_decimation/GridDecimationFilter.cpp @@ -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_attribute", "Name of the added attribut", m_args->m_nameAddAttribute, "grid" ); + args.add("output_dimension", "Name of the added dimension", m_args->m_nameOutDimension, "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_nameAddAttribute.empty()) + if (m_args->m_nameOutDimension.empty()) throwError("The output_name_attribut must be given."); if (!m_args->m_nameWktgrid.empty()) @@ -70,8 +70,7 @@ void GridDecimationFilter::ready(PointTableRef table) void GridDecimationFilter::addDimensions(PointLayoutPtr layout) { - m_args->m_dim = layout->registerOrAssignDim(m_args->m_nameAddAttribute, - Dimension::Type::Double); + m_args->m_dim = layout->registerOrAssignDim(m_args->m_nameOutDimension, Dimension::Type::Double); } void GridDecimationFilter::processOne(BOX2D bounds, PointRef& point, PointViewPtr view) diff --git a/src/filter_grid_decimation/GridDecimationFilter.hpp b/src/filter_grid_decimation/GridDecimationFilter.hpp index fb5e810..231a6a1 100755 --- a/src/filter_grid_decimation/GridDecimationFilter.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_nameAddAttribute; // name of the new attribut + std::string m_nameOutDimension; // name of the new dimension std::string m_nameWktgrid; // export wkt grid Dimension::Id m_dim; }; diff --git a/src/filter_radius_assign/RadiusAssignFilter.cpp b/src/filter_radius_assign/RadiusAssignFilter.cpp index be4e72b..c2cff07 100644 --- a/src/filter_radius_assign/RadiusAssignFilter.cpp +++ b/src/filter_radius_assign/RadiusAssignFilter.cpp @@ -35,7 +35,7 @@ void RadiusAssignFilter::addArgs(ProgramArgs& args) args.add("src_domain", "Selects which points will be subject to radius-based neighbors search", m_args->m_srcDomain, "SRC_DOMAIN"); args.add("reference_domain", "Selects which points will be considered as potential neighbors", m_args->m_referenceDomain, "REF_DOMAIN"); 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("output_dimension", "Name of the added dimension", m_args->m_outputDimension, "radius"); args.add("is3d", "Search in 3d", m_args->search3d, false ); 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.); diff --git a/test/test_grid_decimation.py b/test/test_grid_decimation.py index 324afba..947a43a 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_attribute": "grid", + "output_dimension": "grid", "output_wkt": tmp_out_wkt, }, {