Skip to content

Commit

Permalink
fix algo radius + fix script mnx
Browse files Browse the repository at this point in the history
  • Loading branch information
alavenant committed Oct 1, 2024
1 parent 5369251 commit e68806c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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",
)
###################################################################################################################
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/filter_radius_assign/RadiusAssignFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ void RadiusAssignFilter::doOneNoDomain(PointRef &point)
double Zref = point.getFieldAs<double>(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<double>(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 && Zref<Zpt && (Zpt-Zref)>m_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;
}
Expand Down

0 comments on commit e68806c

Please sign in to comment.