Hello Martin,
ok, another try:
The point cloud I'm working with is a photogrammetrically derived product from one of our workflows, so the point source id is an information from which model run the points originate. As mentioned we have problems with the points from two model runs, for which we assign point source ids 21 and 22. My aim is to get some kind of "ground" estimate from points with point source id 11 and 12 (those will mostly not represent real ground points, especially in forested areas) and then exclude as many of the big outliers originating from point source id 21 and 22 by some kind of height filtering.
I prepared a folder with the data of one of the tiles causing problems. It can be downloaded here:
My workflow is as follows:
# 1) make a ground estimate surface only using point source id 11 and 12 (omitting point source id 21 22)
lasground_new -i ...\LAS_164486_2018_10_LV95LN02.laz -o ...\LAS_164486_2018_10_LV95LN02_ps11_12_ground.laz -wilderness -bulge 5 -offset 10 ^
-keep_point_source_between 11 12
# 2) keep only ground points
las2las -i ...\LAS_164486_2018_10_LV95LN02_ps11_12_ground.laz -o ...\LAS_164486_2018_10_LV95LN02_ps11_12_onlyGround.laz -keep_class 2
# 3) calculate heights of points in original file with ground points from point source id 11 and 12 and store as extra_bytes
lasheight -i ...\LAS_164486_2018_10_LV95LN02.laz -o ...\LAS_164486_2018_10_LV95LN02_lh.laz -ground_points ...\LAS_164486_2018_10_LV95LN02_ps11_12_onlyGround.laz ^
-store_as_extra_bytes
I now found the problem, why everything below does not lead to the expected results. If I do a normalization of the point cloud with replace_z, the result looks very reasonable (but I actually can not use the normalized version for further processing).
# 4) calculate height of points with ground points from point source id 11 and 12 and replace z
lasheight -i ...\LAS_164486_2018_10_LV95LN02.laz -o ...\LAS_164486_2018_10_LV95LN02_lh_replacez.laz ^
-ground_points ...\LAS_164486_2018_10_LV95LN02_ps11_12_onlyGround.laz -replace_z
If I compare the lasinfo outputs on "
LAS_164486_2018_10_LV95LN02_lh.laz" and "
LAS_164486_2018_10_LV95LN02_lh_replacez.laz" there the problem gets visible.
In the "LAS_164486_2018_10_LV95LN02_lh.txt" heights stored as extra_bytes range from -77.63 to 577.62, whereas in "LAS_164486_2018_10_LV95LN02_lh_replacez.txt" the height of the points reange from -620.39 to 123.60.
It might be, that I did not understand the usage of storing heights as extra_bytes. Actually I must do something completely wrong.
Then I would do something like this, but for the moment this doesn't lead to reasonable results, because of above mentioned discrepancies:
If I then classify points as class 7 from
"LAS_164486_2018_10_LV95LN02_lh.laz, eighter the ones with heights above 0 or below 0 I get this problem, that points which are actually far below 0 seem to have positive heights:
# 5) classify points above 0 from file with heights stores as extra bytes as 7
las2las -i ...\LAS_164486_2018_10_LV95LN02_lh.laz -o ...\LAS_164486_2018_10_LV95LN02_lh_above0.laz -classify_attribute_above_as 0 0 7
#6) classify points below 0 from file with heights stores as extra bytes as 7
las2las -i ...\LAS_164486_2018_10_LV95LN02_lh.laz -o ...\LAS_164486_2018_10_LV95LN02_lh_below0.laz -classify_attribute_below_as 0 0 7