Skip to content

Commit

Permalink
attribut => dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
alavenant committed May 30, 2024
1 parent 623a47c commit 2bdc54c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions doc/grid_decimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Purpose
---------------------------------------------------------------------------------------------------------

The **grid decimation filter** transform only one point in each cells of a grid calculated from the points cloud and a resolution therm. The transformation is done by the value information. The selected point could be the highest or the lowest point on the cell. It can be used, for exemple, to quickly filter vegetation points in order to keep only the canopy points. A new attribut is created with the value '1' for the grid, and '0' for the other points.
The **grid decimation filter** transform only one point in each cells of a grid calculated from the points cloud and a resolution therm. The transformation is done by the value information. The selected point could be the highest or the lowest point on the cell. It can be used, for exemple, to quickly filter vegetation points in order to keep only the canopy points. A new dimension is created with the value '1' for the grid, and '0' for the other points.


Example
Expand All @@ -20,7 +20,7 @@ This example transform highest points of classification 5 in classification 9, o
{
"type": "filters.gridDecimation",
"output_type":"max",
"output_name_attribut": "grid",
"output_dimension": "grid",
"output_wkt":"file-output.wkt"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

def parse_args():
parser = argparse.ArgumentParser("Tool to apply pdal pipelines for DSM and DTM calculation (with add attributs for the concerned points)")
parser = argparse.ArgumentParser("Tool to apply pdal pipelines for DSM and DTM calculation (with add dimensions for the concerned points)")
parser.add_argument("--input", "-i", type=str, required=True, help="Input las file")
parser.add_argument("--output_las", "-o", type=str, required=True, help="Output cloud las file")
parser.add_argument("--output_dsm", "-s", type=str, required=True, help="Output dsm tiff file")
Expand All @@ -20,7 +20,7 @@ def parse_args():

pipeline = pdal.Reader.las(args.input)

# 0 - ajout d'attributs temporaires
# 0 - ajout de dimensions temporaires
pipeline |= pdal.Filter.ferry(dimensions=f"=>PT_GRID_DSM, =>PT_VEG_DSM, =>PT_GRID_DTM, =>PT_ON_BRIDGE")


Expand Down Expand Up @@ -48,7 +48,7 @@ def parse_args():

# selection de points DSM (max) sur une grille régulière
pipeline |= pdal.Filter.gridDecimation(resolution=0.5, value="PT_GRID_DSM=1", output_type="max",
where="(" + macro.build_condition("Classification", [2,3,4,5,6,9,17,64]) + ") || PT_GRID_DSM==1")
where="(" + macro.build_condition("Classification", [6,9,17,64]) + ") || PT_GRID_DSM==1")

# assigne des points sol sélectionnés : les points proches de la végétation, des ponts, de l'eau, 64
pipeline = macro.add_radius_assign(pipeline, 1.5, False, condition_src="PT_GRID_DTM==1",
Expand All @@ -62,11 +62,11 @@ def parse_args():
pipeline = macro.add_radius_assign(pipeline, 1.5, False, condition_src=macro.build_condition("Classification", [2,3,4,5,9]), condition_ref="Classification==17", condition_out="PT_ON_BRIDGE=1")
pipeline = macro.add_radius_assign(pipeline, 1.5, False, condition_src="PT_ON_BRIDGE==1",
condition_ref=macro.build_condition("Classification", [2,3,4,5]), condition_out="PT_ON_BRIDGE=0")
pipeline |= pdal.Filter.assign(value=["PT_GRID_DSM = 0 WHERE " + macro.build_condition("Classification", [2,3,4,5,9]) + " && PT_ON_BRIDGE==1"])
pipeline |= pdal.Filter.assign(value=["PT_GRID_DSM=0 WHERE PT_ON_BRIDGE==1"])


## 4 - point pour DTM servent au DSM également
pipeline |= pdal.Filter.assign(value=["PT_GRID_DSM = 1 WHERE PT_GRID_DTM==1"])
pipeline |= pdal.Filter.assign(value=["PT_GRID_DSM=1 WHERE PT_GRID_DTM==1"])

## 5 - export du nuage et des DSM

Expand Down
2 changes: 1 addition & 1 deletion src/filter_grid_decimation/GridDecimationFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void GridDecimationFilter::ready(PointTableRef table)
throwError("The output_type must be 'max' or 'min'.");

if (m_args->m_nameOutDimension.empty())
throwError("The output_name_attribut must be given.");
throwError("The output_dimension must be given.");

if (!m_args->m_nameWktgrid.empty())
std::remove(m_args->m_nameWktgrid.c_str());
Expand Down
4 changes: 2 additions & 2 deletions src/filter_radius_assign/RadiusAssignFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace pdal

static PluginInfo const s_info = PluginInfo(
"filters.radius_assign",
"Re-assign some point attributes based on KNN voting",
"Re-assign some point dimension based on KNN voting",
"" );

CREATE_SHARED_STAGE(RadiusAssignFilter, s_info)
Expand Down Expand Up @@ -55,7 +55,7 @@ void RadiusAssignFilter::initialize()
if (m_args->m_radius <= 0)
throwError("Invalid 'radius' option: " + std::to_string(m_args->m_radius) + ", must be > 0");
if (m_args->m_outputDimension.empty())
throwError("The output_name_attribut must be given.");
throwError("The output_dimension must be given.");
}

void RadiusAssignFilter::prepared(PointTableRef table)
Expand Down

0 comments on commit 2bdc54c

Please sign in to comment.