diff --git a/macro/macro.py b/macro/macro.py index 0cddaf7..809b410 100755 --- a/macro/macro.py +++ b/macro/macro.py @@ -19,7 +19,7 @@ def add_radius_assign(pipeline, radius, search_3d, condition_src, condition_ref, "REF_DOMAIN = 0", f"REF_DOMAIN = 1 WHERE {condition_ref}", "radius_search = 0"]) pipeline |= pdal.Filter.radius_assign(radius=radius, src_domain="SRS_DOMAIN",reference_domain="REF_DOMAIN", - output_name_attribute="radius_search", search_3d=search_3d) + output_dimension="radius_search", search_3d=search_3d) pipeline |= pdal.Filter.assign(value=condition_out,where="radius_search==1") return pipeline diff --git a/src/filter_radius_assign/radius_assignFilter.cpp b/src/filter_radius_assign/radius_assignFilter.cpp index cad6fbf..55becf3 100644 --- a/src/filter_radius_assign/radius_assignFilter.cpp +++ b/src/filter_radius_assign/radius_assignFilter.cpp @@ -35,7 +35,7 @@ void RadiusSearchFilter::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_name_attribute", "Name of the added attribut", m_args->m_nameAddAttribute, "radius" ); + args.add("output_dimension", "Name of the added attribut", m_args->m_outputDimension, "radius" ); args.add("search_3d", "Search in 3d", m_args->search3d, false ); args.add("search_2d_above", "if search in 2d : filter point above the distance", m_args->m_search_bellow, 0. ); args.add("search_2d_bellow", "if search in 2d : filter point bellow the distance", m_args->m_search_above, 0. ); @@ -43,7 +43,7 @@ void RadiusSearchFilter::addArgs(ProgramArgs& args) void RadiusSearchFilter::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_outputDimension, Dimension::Type::Double); m_args->m_dim_ref = layout->registerOrAssignDim(m_args->m_referenceDomain,Dimension::Type::Unsigned8); m_args->m_dim_src = layout->registerOrAssignDim(m_args->m_srcDomain,Dimension::Type::Unsigned8); } @@ -54,7 +54,7 @@ void RadiusSearchFilter::initialize() throwError("The reference_domain must be given."); if (m_args->m_radius <= 0) throwError("Invalid 'radius' option: " + std::to_string(m_args->m_radius) + ", must be > 0"); - if (m_args->m_nameAddAttribute.empty()) + if (m_args->m_outputDimension.empty()) throwError("The output_name_attribut must be given."); } diff --git a/src/filter_radius_assign/radius_assignFilter.hpp b/src/filter_radius_assign/radius_assignFilter.hpp index 3a4346e..edd3527 100644 --- a/src/filter_radius_assign/radius_assignFilter.hpp +++ b/src/filter_radius_assign/radius_assignFilter.hpp @@ -28,7 +28,7 @@ class PDAL_DLL RadiusSearchFilter : public Filter std::string m_srcDomain; double m_radius; PointIdList m_ptsToUpdate; - std::string m_nameAddAttribute; + std::string m_outputDimension; Dimension::Id m_dim; bool search3d; Dimension::Id m_dim_ref, m_dim_src; diff --git a/test/test_radius_assign.py b/test/test_radius_assign.py index f517252..4bc759b 100755 --- a/test/test_radius_assign.py +++ b/test/test_radius_assign.py @@ -51,7 +51,7 @@ def run_filter(arrays_las, distance_radius, search_3d, distance_cylinder=0. ): "radius": distance_radius, "src_domain": "SRS_DOMAIN", "reference_domain": "REF_DOMAIN", - "output_name_attribute": "radius_search", + "output_dimension": "radius_search", "search_3d": search_3d, "search_2d_above": distance_cylinder, "search_2d_bellow": distance_cylinder,