Hi @sami26beniaouf,
I think you will be able to do this using raster processing:
- Sort each point cloud by z, in descending order, to ensure that highest elevations are first
- Rasterize each point cloud. Where there are more than one point per pixel, the lowest value is rendered last and so is the final result. The pixel size should be a bit higher than the average distance between points
- Subtract the Beam raster from the Ceiling raster to produce a raster of differences
- Get the minimum value of the new raster to find the minimum distance
@daveatsafe Thank you for your answer, sorry I think i did'nt explain it clearly. The two point clouds are :
- Ground points (colored in screenshot)
- Ceiling + Beams (white in screenshot)
What I'd like to find is the smallest vertical distance between the ground points and the Ceiling. So the idea is calculating for every ground point the direct vertical distance to the closest ceiling point. And sort maybe those distances in order to find the shortest one. Since the beams and walls are touching with the ground it is going to give me the shortest one with one of those, so to avoid that i thought about eliminating all the distances that are shorter than 2meters for example.
I am joining the 3D point cloud here : (https://we.tl/t-mxDyxbdWLU) if that would help :)
@daveatsafe Thank you for your answer, sorry I think i did'nt explain it clearly. The two point clouds are :
- Ground points (colored in screenshot)
- Ceiling + Beams (white in screenshot)
What I'd like to find is the smallest vertical distance between the ground points and the Ceiling. So the idea is calculating for every ground point the direct vertical distance to the closest ceiling point. And sort maybe those distances in order to find the shortest one. Since the beams and walls are touching with the ground it is going to give me the shortest one with one of those, so to avoid that i thought about eliminating all the distances that are shorter than 2meters for example.
Sorry for the misunderstanding. The same process should work with the Ceiling/Beam and the Ground Points point clouds. To eliminate the distances less than 2 meters, add a RasterCellValueReplacer between the RasterExpressionEvaluator and the RasterBandMinMaxExtractor, and set it to replace values from 0 to 2 with 9999.
Sorry for the misunderstanding. The same process should work with the Ceiling/Beam and the Ground Points point clouds. To eliminate the distances less than 2 meters, add a RasterCellValueReplacer between the RasterExpressionEvaluator and the RasterBandMinMaxExtractor, and set it to replace values from 0 to 2 with 9999.
@daveatsafe , Thank you for your answer. I believe this is a good approach, i have some questions though :
1- Why do we have to sort the clouds by Z if its transforming them to raster according to their spacial position? I tried not using the sorter, it saves more time and gets the same results.
2- I used the NumericRasterizer with raster properties "row and columns" with a 1000x1000 so they have the same size but i'm not sure if it is the right thing to do, because i did'nt know how to get the the lowest value rendered last like you explained.
3- I get finally a raster with band values corresponding to difference height between ceiling and ground (looks like the RasterBandMinMaxExtractor is not changing anything), which is already a really good result, all what is left to do is to get the coordinate of the points corresponding to the minimum distance and the minimum distance value.
I'm joining my workspace :)
Sorry for the misunderstanding. The same process should work with the Ceiling/Beam and the Ground Points point clouds. To eliminate the distances less than 2 meters, add a RasterCellValueReplacer between the RasterExpressionEvaluator and the RasterBandMinMaxExtractor, and set it to replace values from 0 to 2 with 9999.
The point clouds are sorted to ensure that lowest points are always last - when creating the raster, the Rasterizer uses the last point in for each pixel. It appears your data is already sorted that way, but that may not always be the case.
I would recommend using Cell Spacing instead of Rows and Columns when creating the raster, and also setting the Ground Extents, to ensure that both rasters are exactly the same size and resolution. I would also recommend setting the Background Value to 9999 and Fill Background with Nodata to Yes.
The MinMaxExtractor will give you the value of the closest point, but not the location. To get the location use another RasterCellValueReplacer after the MinMaxExtractor to set all values from 0 to _band{0}.min to -1. On the second row of the Replacer set values from _band{0}.min to 9999. This will set all of the raster except the closest point to Nodata.
Finally you can use a RasterCellCoercer to convert that pixel back to a point. Set Extract Nodata values to No, Extract Band Values as Z Values, and Preserve Attributes to Yes.
I am attaching an updated workspace for you.
Sorry for the misunderstanding. The same process should work with the Ceiling/Beam and the Ground Points point clouds. To eliminate the distances less than 2 meters, add a RasterCellValueReplacer between the RasterExpressionEvaluator and the RasterBandMinMaxExtractor, and set it to replace values from 0 to 2 with 9999.
@daveatsafe Thank you very much it's perfectly working!