Skip to content

Commit

Permalink
update nom attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
alavenant committed May 17, 2024
1 parent a2cf0be commit 641dfaf
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/grid_decimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:""]
2 changes: 1 addition & 1 deletion doc/radius_assign.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Options
**update_expression** :
A list of :ref:`assignment expressions <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]

Expand Down
2 changes: 1 addition & 1 deletion macro/macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/filter_grid_decimation/GridDecimationFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, "" );

}
Expand All @@ -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())
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/filter_grid_decimation/GridDecimationFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion src/filter_radius_assign/RadiusAssignFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.);
Expand Down
2 changes: 1 addition & 1 deletion test/test_grid_decimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
{
Expand Down

0 comments on commit 641dfaf

Please sign in to comment.