r-lidar-lab / ALSroads

Road corrections and measurements from ALS data
19 stars 4 forks source link

Error using loop roads #23

Closed ilythiamorley closed 2 years ago

ilythiamorley commented 2 years ago

Hi JR,

When running the measure_road() function on a loop road I get the error:

> corrected_road <- MFFProads::measure_road(road = road, ctg = ctg, dtm = dtm, water = NULL, param = param)
Progress: Loop detected. Splitting the roads in 2 chunks of 32 m to process.
Road 1 of 2  Progress: .
Road 2 of 2  Progress: .
......Error in if (new_road$STATE < 3) sf::st_geometry(new_road) <- geom : 
  missing value where TRUE/FALSE needed
In addition: Warning messages:
1: Too short (< 40 m) road to compute anything. Original road returned. 
2: Too short (< 40 m) road to compute anything. Original road returned.  

I understand that the loop is being split into two segments, which are <40m long, but is there a way to avoid the error?

Reproducible data: https://drive.google.com/drive/folders/1UCb9hmccaVFKxJjTk8L_m8LGI2sNAyMF?usp=sharing

Thanks JR

Jean-Romain commented 2 years ago

I do not have access to the files.

ilythiamorley commented 2 years ago

Apologies, I have changed the sharing rules:

https://drive.google.com/drive/folders/1UCb9hmccaVFKxJjTk8L_m8LGI2sNAyMF?usp=sharing

Thanks, L

Jean-Romain commented 2 years ago

Fixed. But as I explained I cannot compute anything on this road because it is a short loop. A loop must be split in two parts to "unloop". But here each part is too short to be analysed :disappointed:

By the way the repo is public, you no longer need a token to install :wink:

ilythiamorley commented 2 years ago

Great, thank you for that.

Jean-Romain commented 2 years ago

Too fast.... I did not push the change. It's ok now