diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91a22ec..d1b8b12 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ repos: - repo: https://github.com/ambv/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 + rev: 7.1.1 hooks: - id: flake8 - repo: https://github.com/pycqa/isort diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4dc9a34..93ba4d8 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,10 @@ ### 0.3.0 -Update algorithm of [mark_points_to_use_for_digital_models_with_new_dimension](pdal_ign_macro/mark_points_to_use_for_digital_models_with_new_dimension.py), +Update algorithm of [mark_points_to_use_for_digital_models_with_new_dimension](pdal_ign_macro/mark_points_to_use_for_digital_models_with_new_dimension.py) +In details : +- manage water and virtuals points, +- update building consideration +- 2 levels of water ### 0.2.1 diff --git a/pdal_ign_macro/mark_points_to_use_for_digital_models_with_new_dimension.py b/pdal_ign_macro/mark_points_to_use_for_digital_models_with_new_dimension.py index cdc1417..e0ce78a 100755 --- a/pdal_ign_macro/mark_points_to_use_for_digital_models_with_new_dimension.py +++ b/pdal_ign_macro/mark_points_to_use_for_digital_models_with_new_dimension.py @@ -137,7 +137,7 @@ def define_marking_pipeline(input_las, output_las, dsm_dimension, dtm_dimension) 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_below=900, # prendre tous les points qui sont en dessous des points pont (condition_ref) + max2d_below=-1, # prendre tous les points qui sont en dessous des points pont (condition_ref) ) pipeline = macro.add_radius_assign( pipeline, @@ -183,7 +183,7 @@ def define_marking_pipeline(input_las, output_las, dsm_dimension, dtm_dimension) condition_ref="Classification==2", condition_out="PT_ON_SOL=1", max2d_above=0, - max2d_below=900, + max2d_below=-1, ) pipeline = macro.add_radius_assign( pipeline, @@ -278,7 +278,7 @@ def define_marking_pipeline(input_las, output_las, dsm_dimension, dtm_dimension) 1, False, condition_src=f"Classification==2 && {dsm_dimension}==0 && PT_ON_BUILDING==1 && {dtm_dimension}==1", - condition_ref=f"Classification==2 && PT_ON_BUILDING==0 && PT_VEG_DSM==0", + condition_ref="Classification==2 && PT_ON_BUILDING==0 && PT_VEG_DSM==0", condition_out=f"{dsm_dimension}=1", ) ################################################################################################################### @@ -292,17 +292,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_below=900, # prendre tous les points qui sont en dessous des points pont (condition_ref) + max2d_above=0, # ne pas prendre les points qui sont au dessus des points pont (condition_ref) + max2d_below=-1, # 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) diff --git a/src/filter_radius_assign/RadiusAssignFilter.cpp b/src/filter_radius_assign/RadiusAssignFilter.cpp index e670956..991f1d5 100644 --- a/src/filter_radius_assign/RadiusAssignFilter.cpp +++ b/src/filter_radius_assign/RadiusAssignFilter.cpp @@ -83,12 +83,12 @@ void RadiusAssignFilter::doOneNoDomain(PointRef &point) double Zref = point.getFieldAs(Dimension::Id::Z); if (m_args->m_max2d_below>=0 || m_args->m_max2d_above>=0) { - bool take (false); + bool take (true); for (PointId ptId : iNeighbors) { double Zpt = refView->point(ptId).getFieldAs(Dimension::Id::Z); - 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 (m_args->m_max2d_below>=0 && Zrefm_args->m_max2d_below) {take=false; break;} + if (m_args->m_max2d_above>=0 && Zref>Zpt && (Zref-Zpt)>m_args->m_max2d_above) {take=false; break;} } if (!take) return; }