Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
alavenant committed Jul 17, 2024
1 parent 75e8f0c commit 14a1591
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ def define_marking_pipeline(input_las, output_las, dsm_dimension, dtm_dimension)
pipeline = pdal.Pipeline() | pdal.Reader.las(input_las)

# 0 - ajout de dimensions temporaires et de sortie
temporary_dimensions = ["PT_VEG_DSM", "PT_ON_BRIDGE", "PT_ON_BUILDING", "PT_ON_VEGET", "PT_ON_SOL"]
temporary_dimensions = [
"PT_VEG_DSM",
"PT_ON_BRIDGE",
"PT_ON_BUILDING",
"PT_ON_VEGET",
"PT_ON_SOL",
]
added_dimensions = [dtm_dimension, dsm_dimension] + temporary_dimensions

pipeline |= pdal.Filter.ferry(dimensions="=>" + ", =>".join(added_dimensions))
Expand Down Expand Up @@ -119,7 +125,7 @@ def define_marking_pipeline(input_las, output_las, dsm_dimension, dtm_dimension)
condition_src=macro.build_condition("Classification", [6, 9, 17, 67]),
condition_ref=macro.build_condition("Classification", [4, 5]),
condition_out="PT_ON_VEGET=1",
max2d_above=0, # ne pas prendre les points qui sont au dessus des points pont (condition_ref)
max2d_above=-1, # ne pas prendre les points qui sont au dessus des points pont (condition_ref)
max2d_below=900, # prendre tous les points qui sont en dessous des points pont (condition_ref)
)
pipeline = macro.add_radius_assign(
Expand All @@ -134,12 +140,8 @@ def define_marking_pipeline(input_las, output_las, dsm_dimension, dtm_dimension)
pipeline,
1,
False,
condition_src="PT_ON_VEGET==1 && ( "
+ macro.build_condition("Classification", [6, 67])
+ " )",
condition_ref="PT_ON_VEGET==0 && ( "
+ macro.build_condition("Classification", [6, 67])
+ " )",
condition_src="PT_ON_VEGET==1 && " + macro.build_condition("Classification", [6, 67]),
condition_ref="PT_ON_VEGET==0 &&" + macro.build_condition("Classification", [6, 67]),
condition_out="PT_ON_VEGET=0",
max2d_above=0.5, # ne pas prendre les points qui sont au dessus des points pont (condition_ref)
max2d_below=0.5, # prendre tous les points qui sont en dessous des points pont (condition_ref)
Expand Down Expand Up @@ -192,7 +194,7 @@ def define_marking_pipeline(input_las, output_las, dsm_dimension, dtm_dimension)
condition_src="Classification==9",
condition_ref="Classification==2",
condition_out="PT_ON_SOL=1",
max2d_above=0,
max2d_above=-1,
max2d_below=900,
)
pipeline = macro.add_radius_assign(
Expand Down Expand Up @@ -222,9 +224,9 @@ def define_marking_pipeline(input_las, output_las, dsm_dimension, dtm_dimension)
resolution=0.5,
output_dimension=dsm_dimension,
output_type="max",
where="(PT_ON_VEGET==0 && ("
where="(PT_ON_VEGET==0 && "
+ macro.build_condition("Classification", [6, 9, 17, 64])
+ f") || {dsm_dimension}==1)",
+ f" || {dsm_dimension}==1)",
)

# assigne des points sol sélectionnés : les points proches de la végétation, des ponts, de l'eau, 67
Expand Down Expand Up @@ -263,17 +265,16 @@ def define_marking_pipeline(input_las, output_las, dsm_dimension, dtm_dimension)
condition_src=macro.build_condition("Classification", [2, 3, 4, 5, 6, 9, 67]),
condition_ref="Classification==17",
condition_out="PT_ON_BRIDGE=1",
max2d_above=0, # ne pas prendre les points qui sont au dessus des points pont (condition_ref)
max2d_above=-1, # ne pas prendre les points qui sont au dessus des points pont (condition_ref)
max2d_below=900, # prendre tous les points qui sont en dessous des points pont (condition_ref)
)
pipeline = macro.add_radius_assign(
pipeline,
1.25,
False,
condition_src="PT_ON_BRIDGE==1",
condition_ref="PT_ON_BRIDGE==0 && ( "
+ macro.build_condition("Classification", [2, 3, 4, 5, 6, 9, 67])
+ " )",
condition_ref="PT_ON_BRIDGE==0 && "
+ macro.build_condition("Classification", [2, 3, 4, 5, 6, 9, 67]),
condition_out="PT_ON_BRIDGE=0",
max2d_above=0.5, # ne pas prendre les points qui sont au dessus des points pont (condition_ref)
max2d_below=0.5, # prendre tous les points qui sont en dessous des points pont (condition_ref)
Expand Down

0 comments on commit 14a1591

Please sign in to comment.