Global Mapper Pro Coming Soon

Can IMPORT handle wildcards?

kbelliskbellis Global Mapper UserPosts: 529Trusted User
edited October 2013 in Technical Support
I tried using the following line in a little script:
IMPORT FILENAME="c:\mcctests\data\*.las"
which resulted in this error message:
no can find.PNG

There's a little twist on this (and shouldn't matter I think); the script is being called from within a .bat - plenty of places for me to make mistakes! However, it didn't seem to matter, it failed from both the running of the .bat AND running just the script from an open GM session.

The full .bat and .gms:
[B]meta09.gms[/B]
GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Saturday, October 12, 2013, 4:30 PM, VKB - Filtered Export Scripting - Is It Possible?
IMPORT FILENAME="c:\mcctests\data\*.las" TYPE="LIDAR_LAS" ELEV_UNITS="METERS" \
     LABEL_FIELD_FORCE_OVERWRITE="NO" LOAD_FLAGS="1048576,6.000,0,2~0~0~0~0~0~0~0,,4294967295,0.00,5.00,1" \
     LIDAR_DRAW_MODE="ELEV" LIDAR_POINT_SIZE="0" LIDAR_DRAW_QUALITY="50" SAMPLING_METHOD="NEAREST_NEIGHBOR" \
     AUTO_CONTRAST="NO" CONTRAST_SHARED="YES" CONTRAST_MODE="NONE" CLIP_COLLAR="NONE" \
     TEXTURE_MAP="NO"
EXPORT_METADATA FILENAME="*.las" METADATA_FILENAME="C:\MCC-LIDAR experiments\examinations\Baseline\stats001.txt"
[B]gm_meta01.bat[/B]
@ECHO off
echo Adding global_mapper folder to PATH environment variable...
PATH="C:\Program Files\GlobalMapper15_64bit";%PATH%
global_mapper "C:\MCC-LIDAR experiments\meta09.gms" 
PAUSE

Thank you for any pointers,

Kelly

Comments

  • tjhbtjhb Global Mapper User Posts: 454Trusted User
    edited October 2013
    Kelly,

    Either use IMPORT within a loop--
    DEFINE_VAR NAME="INPUT" VALUE="[I]path[/I]"
    ...
    
    DIR_LOOP_START \
        DIRECTORY="%INPUT%" \
        FILENAME_MASKS="*.LAS" \
        RECURSE_DIR=NO
    
        IMPORT \
            FILENAME="%FNAME_W_DIR%" \
            TYPE=LIDAR_LAS \
            ...
            
    DIR_LOOP_END
    

    or use IMPORT_DIR_TREE.

    Tim
  • kbelliskbellis Global Mapper User Posts: 529Trusted User
    edited October 2013
    Is path implied to be spelled out like:
    DEFINE_VAR NAME="INPUT" VALUE="c:\mcctests\data"
    
    or instead intended to be literal:
    DEFINE_VAR NAME="INPUT" VALUE="path"
    
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2013
    You would put your path in there, or you can just use IMPORT_DIR_TREE instead, you don't have to use a variable, but it could be handy for re-using scripts.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Global Mapper
  • tjhbtjhb Global Mapper User Posts: 454Trusted User
    edited October 2013
    I probably complicated things by including a variable for the folder name in the loop example, sorry. The path in italics needs replacing with an actual path.


    But variables are a good and worthwhile habit! Apart from the obvious joy of building on what has previously worked, writing scripts for reuse makes debugging them much easier.
  • kbelliskbellis Global Mapper User Posts: 529Trusted User
    edited October 2013
    I'm on board with your logic Tim - thank you both very much for the help :)
Sign In or Register to comment.