whitebox-tools icon indicating copy to clipboard operation
whitebox-tools copied to clipboard

Raster shift in LidarPointStats?

Open yurithefury opened this issue 2 years ago • 3 comments

  • whitebox version: 2.1.4
  • Python version: 3.8
  • Operating System: Win11/WSL2

Description

Hi. I used LidarPointStats tool through whitebox-python to create a grid with each raster cell representing the number of points. The tool worked fine. However, it looks like the output is either incorrect or shifted (see the screenshot below). Is this the expected behaviour or am I doing something wrong?

What I Did

wbt.lidar_point_stats(
    i=lidar.las, 
    resolution=1.0,
    num_points=True,
    num_pulses=False,
    avg_points_per_pulse=False,
    z_range=False,
    intensity_range=False,
    predom_class=False
)

Layout 1

yurithefury avatar Sep 06 '22 03:09 yurithefury

Could you provide your LAS file? I tried with one of my files and the number points in the raster matches the reality (mostly... I have few cells with a discrepancy nothing like you, only by one unit).

jfbourdon avatar Sep 06 '22 15:09 jfbourdon

Here's a snippet of the data: CentralAndSouth201306-C2-AHD_481052305_55_1.zip. Use EPSG:28355 to define projection of the output raster, as whitebox's output doesn't preserve this information. Thanks for looking into this.

yurithefury avatar Sep 06 '22 23:09 yurithefury

There was an issue in the way the position of each point in the raster was determined.

jfbourdon avatar Sep 07 '22 16:09 jfbourdon