1

I am trying to run track_sensor() and am receiving the following error:

track_sensor(ctg, Roussel2020(), thin_pulse_with_time = 0, multi_pulse = T)
#> Processing [========>-----------------------------------]  20% (4/20) eta: 20mAn error occurred when processing the chunk 4. Try to load this chunk with:
#>  chunk <- readRDS("/tmp/RtmpEBHRvU/chunk4.rds")
#>  las <- readLAS(chunk)
#> After keeping only first and last returns of multiple returns pulses, 8 pulses still have more than 2 points. This dataset is corrupted and gpstime is likely to be invalid.

After investigating I am finding the following kinds of problematic pulses:

chunk <- readRDS("/tmp/RtmpEBHRvU/chunk4.rds")
las <- readLAS(chunk)
las@data[gpstime == 84410683.44697999954224]
#>                          X                       Y                       Z
#> 1: 552000.4799999999813735 4561465.839999999850988 374.7699999999999818101
#> 2: 552005.1900000000605360 4561404.139999999664724 381.9800000000000181899
#> 3: 552001.1600000000325963 4561404.379999999888241 366.8000000000000113687
#>                    gpstime ReturnNumber NumberOfReturns ScanAngleRank UserData
#> 1: 84410683.44697999954224            1               3           -17        0
#> 2: 84410683.44697999954224            1               3           -17        0
#> 3: 84410683.44697999954224            2               3           -17        0
#>    PointSourceID buffer  flag problem
#> 1:          3345      1 FALSE    TRUE
#> 2:          3345      1 FALSE    TRUE
#> 3:          3345      1 FALSE      NA
las@data[gpstime == 84410683.53884577751160]
#>                          X                       Y                       Z
#> 1: 552000.0799999999580905 4561473.350000000558794 376.0500000000000113687
#> 2: 552004.7900000000372529 4561411.690000000409782 383.3899999999999863576
#> 3: 552002.4300000000512227 4561411.839999999850988 374.4900000000000090949
#>                   gpstime ReturnNumber NumberOfReturns ScanAngleRank UserData
#> 1: 84410683.5388457775116            1               3           -17        0
#> 2: 84410683.5388457775116            1               3           -17        0
#> 3: 84410683.5388457775116            2               3           -17        0
#>    PointSourceID buffer  flag
#> 1:          3345      1 FALSE
#> 2:          3345      1 FALSE
#> 3:          3345      1 FALSE

This looks like a clear case of mislabeled ReturnNumber. Would it be ok to correct ReturnNumber myself? I would likely order them by Z within each gpstime group (pulse). The other option would be to identify these pulses ahead of time and filter them out, though I'm not sure which option is better.

1 Answer 1

3

Your points are not spatially aligned meaning they are not from the same pulse.

d = read.table(text = "
 X Y Z
552000.08 4561473.35 376.05
552004.8 4561411.69 383.39
552002.43 4561411.84 374.50
", header = T)

library(lidR)
las = LAS(d)
plot(las, size = 3, axis = T)

So the problem is not a problem of mislabelling of ReturnNumber. Maybe a mislabelling of UserData. But ScanAngle are equal while points seem to a be at very different location. Some points look incorrect.

Anyway you can manually modify an attribute if you are sure of what you are doing

las$UserData[1] = 1L
1
  • 1
    Very interesting...Thanks for pointing this out! I think I'd rather flag and filter these points.
    – Lucas
    Dec 1, 2020 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.