Menu

How to input entire folder (batch)?

Help
2013-10-10
2013-12-04
  • Kelly Bellis

    Kelly Bellis - 2013-10-10

    Is it possible to batch process an entire folder of .las files through mcc-
    lidar and to output those files (elsewhere) with same names?

     
  • Andrew Hudak

    Andrew Hudak - 2013-10-10

    Have you tried making a .bat file?

     
  • Kelly Bellis

    Kelly Bellis - 2013-10-11

    Hi Andy,

    That's what I was asking - if anybody knows if this is even possible, and if
    it was: How do you do it? For example when I tried running the following, it
    just seemed to cause some sort of freaky loop where the command prompt window
    filled with the lines from the bat and then just kept fluttering like
    something could have been happening, but there was no data showing up after
    several minutes in the target output directory.

    mcc-lidar -s 0.8 -t 0.2 C:\MCC-LIDAR experiments\data\ C:\MCC-LIDAR experiments\test 08\
    
     
  • Kelly Bellis

    Kelly Bellis - 2013-10-11

    Hi Andy,

    I think I'm getting closer … and pardon me for my inexperience is showing :)

    The line above has many things wrong with it beginning with the confusion that
    I've introduced by using the executable name in the naming of the directory
    *with spaces*

    There hopefully is a more elegant / succinct way of writing but this bat is
    working at least:

    [b]mcc-lidar_09.5.bat[/b]
    mcc-lidar -s 0.8 -t 0.2 ..\data\19_05624899.las 19_05624899_mcc.las
    mcc-lidar -s 0.8 -t 0.2 ..\data\19_05614899.las 19_05614899_mcc.las
    mcc-lidar -s 0.8 -t 0.2 ..\data\19_05604899.las 19_05604899_mcc.las
    mcc-lidar -s 0.8 -t 0.2 ..\data\19_05604900.las 19_05604900_mcc.las
    mcc-lidar -s 0.8 -t 0.2 ..\data\19_05614900.las 19_05614900_mcc.las
    mcc-lidar -s 0.8 -t 0.2 ..\data\19_05624900.las 19_05624900_mcc.las
    

    Can you suggest any means of improving it?

    Thank you very much.

    Kelly

     
  • Rupesh Shrestha

    Rupesh Shrestha - 2013-10-11

    Using python script to run mcc-lidar in parallel is an excellent idea. Here is
    one alternative that you can use to run mcc-lidar batch file without
    multithreading.  Create a .bat file with the following code, put it in
    the same folder as your las files and double-click to run the file.

    @ECHO off
    echo Adding MCC-LIDAR folder to PATH environment variable...
    PATH="C:\Program Files (x86)\MCC-LIDAR 2.1\bin";%PATH%
    for %%a in (*.las) do (
    echo Running MCC-LIDAR on "%%a" ...
    mcc-lidar "%%a" "%%a-out.las" -s 0.8 -t 0.2
    )
    PAUSE
    ECHO on
    
     
  • Kelly Bellis

    Kelly Bellis - 2013-10-11

    @jedfrechette - Thank you for the link and the idea, though I'm unable to run
    with it - I wish understood more.

    @rupeshs - Thank you very much for this; it is very much a gift that is well
    appreciated :)

    After a few trials and errors (thank goodness for Ctrl+C) and in getting
    reacquainted with eight-dot-three, I made a slight modification to allow using
    a single source directory for data in and then upon completion move results
    into a separate folder:

    [b]s15t03m.bat[/b]
    @ECHO off
    echo Adding MCC-LIDAR folder to PATH environment variable...
    PATH="C:\Program Files (x86)\MCC-LIDAR 2.1\bin";%PATH%
    for %%a in (..\data\*.las) do (
    echo Running MCC-LIDAR on "%%a" ...
    mcc-lidar "%%a" "%%a-out.las" -s 1.5 -t 0.3
    )
    PAUSE
    MOVE c:\mcctests\data\*out.las c:\mcctests\s15t03m
    PAUSE
    ECHO on
    
     
  • Andrew Hudak

    Andrew Hudak - 2013-10-11

    Great, thanks everyone for helping Kelly!

     
  • Kelly Bellis

    Kelly Bellis - 2013-10-20

    Hello,

    Above, in the call for the variable input

    %%a
    

    and then for MCC-LIDAR to write out that variable appended with

    -out.las
    

    , the result is something like:

    19_05624900[b][u].las[/u][/b]-out.las
    

    If I try and use %~n to write only the name before being appended with the
    -out.las, MCC-LIDAR doesn't run; i.e.;

    mcc-lidar "%%a" "%%a%~n-out.las" -s 1.5 -t 0.3
    

    Admittedly, this is trivial, I was just curious why it doesn't work :)

    Thanks!

    Kelly

     

Log in to post a comment.