Am using the r.in.lidar function in GRASS to manipulate multiple lidar files within GRASS.

For testing purposes i did everything with one file only by using the following line and this worked.

r.in.lidar -e -n -o --o output=Rst_Min_cf2  input="C:\Users\XXX\OneDrive - XXX\Projects\XXX\XXX_1K_Las.laz" method=min resolution=5 class_filter=2

However, i have more than 20 files that i would like to analyse together as file by file would be a bit cumbersome.

r.in.lidar allows the user to send a list of files to analyse together and i have successfully used that in the past. I tried to do the same in this case with the following line

r.in.lidar -e -n -o --overwrite output=Lidar file="C:\Users\XXX\OneDrive - XXX\Projects\XXX\AllLidarFiles.txt" method=min resolution=5 zrange=-1,100 class_filter=2

However, it did not work and i got

ERROR: Input file XXXX does not exist

After trying many thinks, i moved all my files to another folder making sure there were no spaces in the path

r.in.lidar -e -n -o -p --overwrite output=Lidar file=C:\Users\XXX\Desktop\XXX\AllLidarFiles.txt method=min resolution=5 zrange=-1,100 class_filter=2

and this did work, which made me think that the issue arises because of the spaces in the file path.

Does anyone know exactly why this problem occurs and how i could solve it without moving all my files to a folder whose path does not have any spaces at all?

  • Can you try with file=C:\Users\XXX\OneDrive^ -^ XXX\Projects\XXX\AllLidarFiles.txt ? Jan 29, 2020 at 23:25
  • put quotes around your path with spaces like "C:\path with\spaces\file.las" when using command line instructions. Eventually you may assimilate like us old DOS users and use paths without spaces, made of all alphanumeric characters - we've been bitten by the surprise space or punctuation in file path too many times. To get a file list of all your LAS files use DIR /B /S "C:\Users\XXX\OneDrive - XXX\Projects\XXX\XXX_1K_Las\*.LAS" > YourTextFile.txt and use the text file as your input - old CMD users trick. Jan 29, 2020 at 23:36
  • Thanks for your comments. The ^ did not work, but i ended up finding a solution.
    – Juan Ossa
    Jan 30, 2020 at 21:56

1 Answer 1


After trying many things i was able to find a solution. I used the same line i had tried before

r.in.lidar -e -n -o --overwrite output=Lidar file="C:\Users\XXX\OneDrive - XXX\Projects\XXX\AllLidarFiles.txt" method=min resolution=5 zrange=-1,100 class_filter=2

However, within the text file AllLidarFiles.txt files did not have to have quotes.

This is what i had before in the text file, and this was not working

"C:\Users\XXX\OneDrive - XXX\XXX\XXX_2011_608000_7412000_1K_Las.las"
"C:\Users\XXX\OneDrive - XXX\XXX\XXX_2011_608000_7413000_1K_Las.las"
"C:\Users\XXX\OneDrive - XXX\XXX\XXX_2011_609000_7412000_1K_Las.las"
"C:\Users\XXX\OneDrive - XXX\XXX\XXX_2011_609000_7413000_1K_Las.las"

This is what i have now in AllLidarFiles.txt and is working.

C:\Users\XXX\OneDrive - XXX\XXX\XXX_2011_608000_7412000_1K_Las.las
C:\Users\XXX\OneDrive - XXX\XXX\XXX_2011_608000_7413000_1K_Las.las
C:\Users\XXX\OneDrive - XXX\XXX\XXX_2011_609000_7412000_1K_Las.las
C:\Users\XXX\OneDrive - XXX\XXX\XXX_2011_609000_7413000_1K_Las.las

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.