Skip to content

Commit

Permalink
maj nom attributs
Browse files Browse the repository at this point in the history
  • Loading branch information
alavenant committed May 29, 2024
1 parent b217324 commit 43bba12
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/filter_radius_assign/RadiusAssignFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.);
args.add("max2d_above", "if search in 2d : upward maximum distance in Z for potential neighbors (corresponds to a search in a cylinder with a height = max2d_above above the source point). Default (0) = infinite height", m_args->m_max2d_above, 0.);
args.add("max2d_below", "if search in 2d : upward maximum distance in Z for potential neighbors (corresponds to a search in a cylinder with a height = max2d_below below the source point). Default (0) = infinite height", m_args->m_max2d_below, 0.);
}

void RadiusAssignFilter::addDimensions(PointLayoutPtr layout)
Expand Down Expand Up @@ -81,14 +81,14 @@ void RadiusAssignFilter::doOneNoDomain(PointRef &point)
if (!m_args->search3d)
{
double Zref = point.getFieldAs<double>(Dimension::Id::Z);
if (m_args->m_search_below>0 || m_args->m_search_above>0)
if (m_args->m_max2d_below>0 || m_args->m_max2d_above>0)
{
bool take (false);
for (PointId ptId : iNeighbors)
{
double Zpt = refView->point(ptId).getFieldAs<double>(Dimension::Id::Z);
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 && Zpt<Zref && (Zref-Zpt)<=m_args->m_search_above) {take=true; break;}
if (m_args->m_max2d_below>0 && Zpt>Zref && (Zpt-Zref)<=m_args->m_max2d_below) {take=true; break;}
if (m_args->m_max2d_above>0 && Zpt<Zref && (Zref-Zpt)<=m_args->m_max2d_above) {take=true; break;}
}
if (!take) return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/filter_radius_assign/RadiusAssignFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_below, m_search_above;
double m_max2d_above, m_max2d_below;
};
std::unique_ptr<RadiusAssignArgs> m_args;
PointViewPtr refView;
Expand Down
4 changes: 2 additions & 2 deletions test/test_radius_assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def run_filter(arrays_las, distance_radius, search_3d, distance_cylinder=0. ):
"reference_domain": "REF_DOMAIN",
"output_dimension": "radius_search",
"is3d": search_3d,
"is2d_above": distance_cylinder,
"is2d_below": distance_cylinder,
"max2d_above": distance_cylinder,
"max2d_below": distance_cylinder,
}
]

Expand Down

0 comments on commit 43bba12

Please sign in to comment.